2
0

_apidocs.html 912 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>API</title>
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css" integrity="sha256-vK3UTo/8wHbaUn+dTQD0X6dzidqc5l7gczvH+Bnowwk=" crossorigin="anonymous" id="bulma-theme-light" />
  9. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulmaswatch@0.7.5/cyborg/bulmaswatch.min.css" integrity="sha256-NEPZJFJGDcH6K+NW0Ij8VtItmbltoDzXHaZ4oBQzuvU=" crossorigin="anonymous" media="none" id="bulma-theme-dark" />
  10. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/fontawesome.min.css" integrity="sha256-AaQqnjfGDRZd/lUp0Dvy7URGOyRsh8g9JdWUkyYxNfI=" crossorigin="anonymous" />
  11. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/solid.min.css" integrity="sha256-3FfMfpeajSEpxWZTFowWZPTv7k3GEu7w4rQv49EWsEY=" crossorigin="anonymous" />
  12. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-themes@1.1.0/themes/prism-a11y-dark.css" integrity="sha256-d2qy226pP+oHAtEQPujaiXPslYW1Rmtla3Ivu1fFYxU=" crossorigin="anonymous">
  13. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-switch@2.0.0/dist/css/bulma-switch.min.css" integrity="sha256-jCV/cXwP13w0GNHLgFx6SFgTNAvJPvS5MIhuE30Ng08=" crossorigin="anonymous">
  14. <style>
  15. @media screen and (min-width: 768px) {
  16. .navbar-burger {
  17. display: none;
  18. }
  19. }
  20. </style>
  21. </head>
  22. <body class="has-navbar-fixed-top">
  23. <script>var main = (function () {
  24. 'use strict';
  25. function noop() { }
  26. const identity = x => x;
  27. function assign(tar, src) {
  28. // @ts-ignore
  29. for (const k in src)
  30. tar[k] = src[k];
  31. return tar;
  32. }
  33. function is_promise(value) {
  34. return value && typeof value === 'object' && typeof value.then === 'function';
  35. }
  36. function add_location(element, file, line, column, char) {
  37. element.__svelte_meta = {
  38. loc: { file, line, column, char }
  39. };
  40. }
  41. function run(fn) {
  42. return fn();
  43. }
  44. function blank_object() {
  45. return Object.create(null);
  46. }
  47. function run_all(fns) {
  48. fns.forEach(run);
  49. }
  50. function is_function(thing) {
  51. return typeof thing === 'function';
  52. }
  53. function safe_not_equal(a, b) {
  54. return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
  55. }
  56. function not_equal(a, b) {
  57. return a != a ? b == b : a !== b;
  58. }
  59. function validate_store(store, name) {
  60. if (store != null && typeof store.subscribe !== 'function') {
  61. throw new Error(`'${name}' is not a store with a 'subscribe' method`);
  62. }
  63. }
  64. function subscribe(store, ...callbacks) {
  65. if (store == null) {
  66. return noop;
  67. }
  68. const unsub = store.subscribe(...callbacks);
  69. return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
  70. }
  71. function get_store_value(store) {
  72. let value;
  73. subscribe(store, _ => value = _)();
  74. return value;
  75. }
  76. function component_subscribe(component, store, callback) {
  77. component.$$.on_destroy.push(subscribe(store, callback));
  78. }
  79. function create_slot(definition, ctx, $$scope, fn) {
  80. if (definition) {
  81. const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
  82. return definition[0](slot_ctx);
  83. }
  84. }
  85. function get_slot_context(definition, ctx, $$scope, fn) {
  86. return definition[1] && fn
  87. ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
  88. : $$scope.ctx;
  89. }
  90. function get_slot_changes(definition, $$scope, dirty, fn) {
  91. if (definition[2] && fn) {
  92. const lets = definition[2](fn(dirty));
  93. if ($$scope.dirty === undefined) {
  94. return lets;
  95. }
  96. if (typeof lets === 'object') {
  97. const merged = [];
  98. const len = Math.max($$scope.dirty.length, lets.length);
  99. for (let i = 0; i < len; i += 1) {
  100. merged[i] = $$scope.dirty[i] | lets[i];
  101. }
  102. return merged;
  103. }
  104. return $$scope.dirty | lets;
  105. }
  106. return $$scope.dirty;
  107. }
  108. function exclude_internal_props(props) {
  109. const result = {};
  110. for (const k in props)
  111. if (k[0] !== '$')
  112. result[k] = props[k];
  113. return result;
  114. }
  115. function once(fn) {
  116. let ran = false;
  117. return function (...args) {
  118. if (ran)
  119. return;
  120. ran = true;
  121. fn.call(this, ...args);
  122. };
  123. }
  124. function null_to_empty(value) {
  125. return value == null ? '' : value;
  126. }
  127. function set_store_value(store, ret, value = ret) {
  128. store.set(value);
  129. return ret;
  130. }
  131. const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  132. function action_destroyer(action_result) {
  133. return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
  134. }
  135. const is_client = typeof window !== 'undefined';
  136. let now = is_client
  137. ? () => window.performance.now()
  138. : () => Date.now();
  139. let raf = is_client ? cb => requestAnimationFrame(cb) : noop;
  140. // used internally for testing
  141. function set_now(fn) {
  142. now = fn;
  143. }
  144. function set_raf(fn) {
  145. raf = fn;
  146. }
  147. const tasks = new Set();
  148. function run_tasks(now) {
  149. tasks.forEach(task => {
  150. if (!task.c(now)) {
  151. tasks.delete(task);
  152. task.f();
  153. }
  154. });
  155. if (tasks.size !== 0)
  156. raf(run_tasks);
  157. }
  158. /**
  159. * For testing purposes only!
  160. */
  161. function clear_loops() {
  162. tasks.clear();
  163. }
  164. /**
  165. * Creates a new task that runs on each raf frame
  166. * until it returns a falsy value or is aborted
  167. */
  168. function loop(callback) {
  169. let task;
  170. if (tasks.size === 0)
  171. raf(run_tasks);
  172. return {
  173. promise: new Promise(fulfill => {
  174. tasks.add(task = { c: callback, f: fulfill });
  175. }),
  176. abort() {
  177. tasks.delete(task);
  178. }
  179. };
  180. }
  181. function append(target, node) {
  182. target.appendChild(node);
  183. }
  184. function insert(target, node, anchor) {
  185. target.insertBefore(node, anchor || null);
  186. }
  187. function detach(node) {
  188. node.parentNode.removeChild(node);
  189. }
  190. function destroy_each(iterations, detaching) {
  191. for (let i = 0; i < iterations.length; i += 1) {
  192. if (iterations[i])
  193. iterations[i].d(detaching);
  194. }
  195. }
  196. function element(name) {
  197. return document.createElement(name);
  198. }
  199. function element_is(name, is) {
  200. return document.createElement(name, { is });
  201. }
  202. function object_without_properties(obj, exclude) {
  203. const target = {};
  204. for (const k in obj) {
  205. if (has_prop(obj, k)
  206. // @ts-ignore
  207. && exclude.indexOf(k) === -1) {
  208. // @ts-ignore
  209. target[k] = obj[k];
  210. }
  211. }
  212. return target;
  213. }
  214. function svg_element(name) {
  215. return document.createElementNS('http://www.w3.org/2000/svg', name);
  216. }
  217. function text(data) {
  218. return document.createTextNode(data);
  219. }
  220. function space() {
  221. return text(' ');
  222. }
  223. function empty() {
  224. return text('');
  225. }
  226. function listen(node, event, handler, options) {
  227. node.addEventListener(event, handler, options);
  228. return () => node.removeEventListener(event, handler, options);
  229. }
  230. function prevent_default(fn) {
  231. return function (event) {
  232. event.preventDefault();
  233. // @ts-ignore
  234. return fn.call(this, event);
  235. };
  236. }
  237. function stop_propagation(fn) {
  238. return function (event) {
  239. event.stopPropagation();
  240. // @ts-ignore
  241. return fn.call(this, event);
  242. };
  243. }
  244. function self$1(fn) {
  245. return function (event) {
  246. // @ts-ignore
  247. if (event.target === this)
  248. fn.call(this, event);
  249. };
  250. }
  251. function attr(node, attribute, value) {
  252. if (value == null)
  253. node.removeAttribute(attribute);
  254. else if (node.getAttribute(attribute) !== value)
  255. node.setAttribute(attribute, value);
  256. }
  257. function set_attributes(node, attributes) {
  258. // @ts-ignore
  259. const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
  260. for (const key in attributes) {
  261. if (attributes[key] == null) {
  262. node.removeAttribute(key);
  263. }
  264. else if (key === 'style') {
  265. node.style.cssText = attributes[key];
  266. }
  267. else if (key === '__value' || descriptors[key] && descriptors[key].set) {
  268. node[key] = attributes[key];
  269. }
  270. else {
  271. attr(node, key, attributes[key]);
  272. }
  273. }
  274. }
  275. function set_svg_attributes(node, attributes) {
  276. for (const key in attributes) {
  277. attr(node, key, attributes[key]);
  278. }
  279. }
  280. function set_custom_element_data(node, prop, value) {
  281. if (prop in node) {
  282. node[prop] = value;
  283. }
  284. else {
  285. attr(node, prop, value);
  286. }
  287. }
  288. function xlink_attr(node, attribute, value) {
  289. node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
  290. }
  291. function get_binding_group_value(group) {
  292. const value = [];
  293. for (let i = 0; i < group.length; i += 1) {
  294. if (group[i].checked)
  295. value.push(group[i].__value);
  296. }
  297. return value;
  298. }
  299. function to_number(value) {
  300. return value === '' ? undefined : +value;
  301. }
  302. function time_ranges_to_array(ranges) {
  303. const array = [];
  304. for (let i = 0; i < ranges.length; i += 1) {
  305. array.push({ start: ranges.start(i), end: ranges.end(i) });
  306. }
  307. return array;
  308. }
  309. function children(element) {
  310. return Array.from(element.childNodes);
  311. }
  312. function claim_element(nodes, name, attributes, svg) {
  313. for (let i = 0; i < nodes.length; i += 1) {
  314. const node = nodes[i];
  315. if (node.nodeName === name) {
  316. let j = 0;
  317. while (j < node.attributes.length) {
  318. const attribute = node.attributes[j];
  319. if (attributes[attribute.name]) {
  320. j++;
  321. }
  322. else {
  323. node.removeAttribute(attribute.name);
  324. }
  325. }
  326. return nodes.splice(i, 1)[0];
  327. }
  328. }
  329. return svg ? svg_element(name) : element(name);
  330. }
  331. function claim_text(nodes, data) {
  332. for (let i = 0; i < nodes.length; i += 1) {
  333. const node = nodes[i];
  334. if (node.nodeType === 3) {
  335. node.data = '' + data;
  336. return nodes.splice(i, 1)[0];
  337. }
  338. }
  339. return text(data);
  340. }
  341. function claim_space(nodes) {
  342. return claim_text(nodes, ' ');
  343. }
  344. function set_data(text, data) {
  345. data = '' + data;
  346. if (text.data !== data)
  347. text.data = data;
  348. }
  349. function set_input_value(input, value) {
  350. if (value != null || input.value) {
  351. input.value = value;
  352. }
  353. }
  354. function set_input_type(input, type) {
  355. try {
  356. input.type = type;
  357. }
  358. catch (e) {
  359. // do nothing
  360. }
  361. }
  362. function set_style(node, key, value, important) {
  363. node.style.setProperty(key, value, important ? 'important' : '');
  364. }
  365. function select_option(select, value) {
  366. for (let i = 0; i < select.options.length; i += 1) {
  367. const option = select.options[i];
  368. if (option.__value === value) {
  369. option.selected = true;
  370. return;
  371. }
  372. }
  373. }
  374. function select_options(select, value) {
  375. for (let i = 0; i < select.options.length; i += 1) {
  376. const option = select.options[i];
  377. option.selected = ~value.indexOf(option.__value);
  378. }
  379. }
  380. function select_value(select) {
  381. const selected_option = select.querySelector(':checked') || select.options[0];
  382. return selected_option && selected_option.__value;
  383. }
  384. function select_multiple_value(select) {
  385. return [].map.call(select.querySelectorAll(':checked'), option => option.__value);
  386. }
  387. function add_resize_listener(element, fn) {
  388. if (getComputedStyle(element).position === 'static') {
  389. element.style.position = 'relative';
  390. }
  391. const object = document.createElement('object');
  392. object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
  393. object.setAttribute('aria-hidden', 'true');
  394. object.type = 'text/html';
  395. object.tabIndex = -1;
  396. let win;
  397. object.onload = () => {
  398. win = object.contentDocument.defaultView;
  399. win.addEventListener('resize', fn);
  400. };
  401. if (/Trident/.test(navigator.userAgent)) {
  402. element.appendChild(object);
  403. object.data = 'about:blank';
  404. }
  405. else {
  406. object.data = 'about:blank';
  407. element.appendChild(object);
  408. }
  409. return {
  410. cancel: () => {
  411. win && win.removeEventListener && win.removeEventListener('resize', fn);
  412. element.removeChild(object);
  413. }
  414. };
  415. }
  416. function toggle_class(element, name, toggle) {
  417. element.classList[toggle ? 'add' : 'remove'](name);
  418. }
  419. function custom_event(type, detail) {
  420. const e = document.createEvent('CustomEvent');
  421. e.initCustomEvent(type, false, false, detail);
  422. return e;
  423. }
  424. function query_selector_all(selector, parent = document.body) {
  425. return Array.from(parent.querySelectorAll(selector));
  426. }
  427. class HtmlTag {
  428. constructor(html, anchor = null) {
  429. this.e = element('div');
  430. this.a = anchor;
  431. this.u(html);
  432. }
  433. m(target, anchor = null) {
  434. for (let i = 0; i < this.n.length; i += 1) {
  435. insert(target, this.n[i], anchor);
  436. }
  437. this.t = target;
  438. }
  439. u(html) {
  440. this.e.innerHTML = html;
  441. this.n = Array.from(this.e.childNodes);
  442. }
  443. p(html) {
  444. this.d();
  445. this.u(html);
  446. this.m(this.t, this.a);
  447. }
  448. d() {
  449. this.n.forEach(detach);
  450. }
  451. }
  452. let stylesheet;
  453. let active = 0;
  454. let current_rules = {};
  455. // https://github.com/darkskyapp/string-hash/blob/master/index.js
  456. function hash(str) {
  457. let hash = 5381;
  458. let i = str.length;
  459. while (i--)
  460. hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
  461. return hash >>> 0;
  462. }
  463. function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
  464. const step = 16.666 / duration;
  465. let keyframes = '{\n';
  466. for (let p = 0; p <= 1; p += step) {
  467. const t = a + (b - a) * ease(p);
  468. keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
  469. }
  470. const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
  471. const name = `__svelte_${hash(rule)}_${uid}`;
  472. if (!current_rules[name]) {
  473. if (!stylesheet) {
  474. const style = element('style');
  475. document.head.appendChild(style);
  476. stylesheet = style.sheet;
  477. }
  478. current_rules[name] = true;
  479. stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
  480. }
  481. const animation = node.style.animation || '';
  482. node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;
  483. active += 1;
  484. return name;
  485. }
  486. function delete_rule(node, name) {
  487. node.style.animation = (node.style.animation || '')
  488. .split(', ')
  489. .filter(name
  490. ? anim => anim.indexOf(name) < 0 // remove specific animation
  491. : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations
  492. )
  493. .join(', ');
  494. if (name && !--active)
  495. clear_rules();
  496. }
  497. function clear_rules() {
  498. raf(() => {
  499. if (active)
  500. return;
  501. let i = stylesheet.cssRules.length;
  502. while (i--)
  503. stylesheet.deleteRule(i);
  504. current_rules = {};
  505. });
  506. }
  507. function create_animation(node, from, fn, params) {
  508. if (!from)
  509. return noop;
  510. const to = node.getBoundingClientRect();
  511. if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)
  512. return noop;
  513. const { delay = 0, duration = 300, easing = identity,
  514. // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?
  515. start: start_time = now() + delay,
  516. // @ts-ignore todo:
  517. end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);
  518. let running = true;
  519. let started = false;
  520. let name;
  521. function start() {
  522. if (css) {
  523. name = create_rule(node, 0, 1, duration, delay, easing, css);
  524. }
  525. if (!delay) {
  526. started = true;
  527. }
  528. }
  529. function stop() {
  530. if (css)
  531. delete_rule(node, name);
  532. running = false;
  533. }
  534. loop(now => {
  535. if (!started && now >= start_time) {
  536. started = true;
  537. }
  538. if (started && now >= end) {
  539. tick(1, 0);
  540. stop();
  541. }
  542. if (!running) {
  543. return false;
  544. }
  545. if (started) {
  546. const p = now - start_time;
  547. const t = 0 + 1 * easing(p / duration);
  548. tick(t, 1 - t);
  549. }
  550. return true;
  551. });
  552. start();
  553. tick(0, 1);
  554. return stop;
  555. }
  556. function fix_position(node) {
  557. const style = getComputedStyle(node);
  558. if (style.position !== 'absolute' && style.position !== 'fixed') {
  559. const { width, height } = style;
  560. const a = node.getBoundingClientRect();
  561. node.style.position = 'absolute';
  562. node.style.width = width;
  563. node.style.height = height;
  564. add_transform(node, a);
  565. }
  566. }
  567. function add_transform(node, a) {
  568. const b = node.getBoundingClientRect();
  569. if (a.left !== b.left || a.top !== b.top) {
  570. const style = getComputedStyle(node);
  571. const transform = style.transform === 'none' ? '' : style.transform;
  572. node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
  573. }
  574. }
  575. let current_component;
  576. function set_current_component(component) {
  577. current_component = component;
  578. }
  579. function get_current_component() {
  580. if (!current_component)
  581. throw new Error(`Function called outside component initialization`);
  582. return current_component;
  583. }
  584. function beforeUpdate(fn) {
  585. get_current_component().$$.before_update.push(fn);
  586. }
  587. function onMount(fn) {
  588. get_current_component().$$.on_mount.push(fn);
  589. }
  590. function afterUpdate(fn) {
  591. get_current_component().$$.after_update.push(fn);
  592. }
  593. function onDestroy(fn) {
  594. get_current_component().$$.on_destroy.push(fn);
  595. }
  596. function createEventDispatcher() {
  597. const component = get_current_component();
  598. return (type, detail) => {
  599. const callbacks = component.$$.callbacks[type];
  600. if (callbacks) {
  601. // TODO are there situations where events could be dispatched
  602. // in a server (non-DOM) environment?
  603. const event = custom_event(type, detail);
  604. callbacks.slice().forEach(fn => {
  605. fn.call(component, event);
  606. });
  607. }
  608. };
  609. }
  610. function setContext(key, context) {
  611. get_current_component().$$.context.set(key, context);
  612. }
  613. function getContext(key) {
  614. return get_current_component().$$.context.get(key);
  615. }
  616. // TODO figure out if we still want to support
  617. // shorthand events, or if we want to implement
  618. // a real bubbling mechanism
  619. function bubble(component, event) {
  620. const callbacks = component.$$.callbacks[event.type];
  621. if (callbacks) {
  622. callbacks.slice().forEach(fn => fn(event));
  623. }
  624. }
  625. const dirty_components = [];
  626. const intros = { enabled: false };
  627. const binding_callbacks = [];
  628. const render_callbacks = [];
  629. const flush_callbacks = [];
  630. const resolved_promise = Promise.resolve();
  631. let update_scheduled = false;
  632. function schedule_update() {
  633. if (!update_scheduled) {
  634. update_scheduled = true;
  635. resolved_promise.then(flush);
  636. }
  637. }
  638. function tick() {
  639. schedule_update();
  640. return resolved_promise;
  641. }
  642. function add_render_callback(fn) {
  643. render_callbacks.push(fn);
  644. }
  645. function add_flush_callback(fn) {
  646. flush_callbacks.push(fn);
  647. }
  648. let flushing = false;
  649. const seen_callbacks = new Set();
  650. function flush() {
  651. if (flushing)
  652. return;
  653. flushing = true;
  654. do {
  655. // first, call beforeUpdate functions
  656. // and update components
  657. for (let i = 0; i < dirty_components.length; i += 1) {
  658. const component = dirty_components[i];
  659. set_current_component(component);
  660. update(component.$$);
  661. }
  662. dirty_components.length = 0;
  663. while (binding_callbacks.length)
  664. binding_callbacks.pop()();
  665. // then, once components are updated, call
  666. // afterUpdate functions. This may cause
  667. // subsequent updates...
  668. for (let i = 0; i < render_callbacks.length; i += 1) {
  669. const callback = render_callbacks[i];
  670. if (!seen_callbacks.has(callback)) {
  671. // ...so guard against infinite loops
  672. seen_callbacks.add(callback);
  673. callback();
  674. }
  675. }
  676. render_callbacks.length = 0;
  677. } while (dirty_components.length);
  678. while (flush_callbacks.length) {
  679. flush_callbacks.pop()();
  680. }
  681. update_scheduled = false;
  682. flushing = false;
  683. seen_callbacks.clear();
  684. }
  685. function update($$) {
  686. if ($$.fragment !== null) {
  687. $$.update();
  688. run_all($$.before_update);
  689. const dirty = $$.dirty;
  690. $$.dirty = [-1];
  691. $$.fragment && $$.fragment.p($$.ctx, dirty);
  692. $$.after_update.forEach(add_render_callback);
  693. }
  694. }
  695. let promise;
  696. function wait() {
  697. if (!promise) {
  698. promise = Promise.resolve();
  699. promise.then(() => {
  700. promise = null;
  701. });
  702. }
  703. return promise;
  704. }
  705. function dispatch(node, direction, kind) {
  706. node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
  707. }
  708. const outroing = new Set();
  709. let outros;
  710. function group_outros() {
  711. outros = {
  712. r: 0,
  713. c: [],
  714. p: outros // parent group
  715. };
  716. }
  717. function check_outros() {
  718. if (!outros.r) {
  719. run_all(outros.c);
  720. }
  721. outros = outros.p;
  722. }
  723. function transition_in(block, local) {
  724. if (block && block.i) {
  725. outroing.delete(block);
  726. block.i(local);
  727. }
  728. }
  729. function transition_out(block, local, detach, callback) {
  730. if (block && block.o) {
  731. if (outroing.has(block))
  732. return;
  733. outroing.add(block);
  734. outros.c.push(() => {
  735. outroing.delete(block);
  736. if (callback) {
  737. if (detach)
  738. block.d(1);
  739. callback();
  740. }
  741. });
  742. block.o(local);
  743. }
  744. }
  745. const null_transition = { duration: 0 };
  746. function create_in_transition(node, fn, params) {
  747. let config = fn(node, params);
  748. let running = false;
  749. let animation_name;
  750. let task;
  751. let uid = 0;
  752. function cleanup() {
  753. if (animation_name)
  754. delete_rule(node, animation_name);
  755. }
  756. function go() {
  757. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  758. if (css)
  759. animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
  760. tick(0, 1);
  761. const start_time = now() + delay;
  762. const end_time = start_time + duration;
  763. if (task)
  764. task.abort();
  765. running = true;
  766. add_render_callback(() => dispatch(node, true, 'start'));
  767. task = loop(now => {
  768. if (running) {
  769. if (now >= end_time) {
  770. tick(1, 0);
  771. dispatch(node, true, 'end');
  772. cleanup();
  773. return running = false;
  774. }
  775. if (now >= start_time) {
  776. const t = easing((now - start_time) / duration);
  777. tick(t, 1 - t);
  778. }
  779. }
  780. return running;
  781. });
  782. }
  783. let started = false;
  784. return {
  785. start() {
  786. if (started)
  787. return;
  788. delete_rule(node);
  789. if (is_function(config)) {
  790. config = config();
  791. wait().then(go);
  792. }
  793. else {
  794. go();
  795. }
  796. },
  797. invalidate() {
  798. started = false;
  799. },
  800. end() {
  801. if (running) {
  802. cleanup();
  803. running = false;
  804. }
  805. }
  806. };
  807. }
  808. function create_out_transition(node, fn, params) {
  809. let config = fn(node, params);
  810. let running = true;
  811. let animation_name;
  812. const group = outros;
  813. group.r += 1;
  814. function go() {
  815. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  816. if (css)
  817. animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
  818. const start_time = now() + delay;
  819. const end_time = start_time + duration;
  820. add_render_callback(() => dispatch(node, false, 'start'));
  821. loop(now => {
  822. if (running) {
  823. if (now >= end_time) {
  824. tick(0, 1);
  825. dispatch(node, false, 'end');
  826. if (!--group.r) {
  827. // this will result in `end()` being called,
  828. // so we don't need to clean up here
  829. run_all(group.c);
  830. }
  831. return false;
  832. }
  833. if (now >= start_time) {
  834. const t = easing((now - start_time) / duration);
  835. tick(1 - t, t);
  836. }
  837. }
  838. return running;
  839. });
  840. }
  841. if (is_function(config)) {
  842. wait().then(() => {
  843. // @ts-ignore
  844. config = config();
  845. go();
  846. });
  847. }
  848. else {
  849. go();
  850. }
  851. return {
  852. end(reset) {
  853. if (reset && config.tick) {
  854. config.tick(1, 0);
  855. }
  856. if (running) {
  857. if (animation_name)
  858. delete_rule(node, animation_name);
  859. running = false;
  860. }
  861. }
  862. };
  863. }
  864. function create_bidirectional_transition(node, fn, params, intro) {
  865. let config = fn(node, params);
  866. let t = intro ? 0 : 1;
  867. let running_program = null;
  868. let pending_program = null;
  869. let animation_name = null;
  870. function clear_animation() {
  871. if (animation_name)
  872. delete_rule(node, animation_name);
  873. }
  874. function init(program, duration) {
  875. const d = program.b - t;
  876. duration *= Math.abs(d);
  877. return {
  878. a: t,
  879. b: program.b,
  880. d,
  881. duration,
  882. start: program.start,
  883. end: program.start + duration,
  884. group: program.group
  885. };
  886. }
  887. function go(b) {
  888. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  889. const program = {
  890. start: now() + delay,
  891. b
  892. };
  893. if (!b) {
  894. // @ts-ignore todo: improve typings
  895. program.group = outros;
  896. outros.r += 1;
  897. }
  898. if (running_program) {
  899. pending_program = program;
  900. }
  901. else {
  902. // if this is an intro, and there's a delay, we need to do
  903. // an initial tick and/or apply CSS animation immediately
  904. if (css) {
  905. clear_animation();
  906. animation_name = create_rule(node, t, b, duration, delay, easing, css);
  907. }
  908. if (b)
  909. tick(0, 1);
  910. running_program = init(program, duration);
  911. add_render_callback(() => dispatch(node, b, 'start'));
  912. loop(now => {
  913. if (pending_program && now > pending_program.start) {
  914. running_program = init(pending_program, duration);
  915. pending_program = null;
  916. dispatch(node, running_program.b, 'start');
  917. if (css) {
  918. clear_animation();
  919. animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
  920. }
  921. }
  922. if (running_program) {
  923. if (now >= running_program.end) {
  924. tick(t = running_program.b, 1 - t);
  925. dispatch(node, running_program.b, 'end');
  926. if (!pending_program) {
  927. // we're done
  928. if (running_program.b) {
  929. // intro — we can tidy up immediately
  930. clear_animation();
  931. }
  932. else {
  933. // outro — needs to be coordinated
  934. if (!--running_program.group.r)
  935. run_all(running_program.group.c);
  936. }
  937. }
  938. running_program = null;
  939. }
  940. else if (now >= running_program.start) {
  941. const p = now - running_program.start;
  942. t = running_program.a + running_program.d * easing(p / running_program.duration);
  943. tick(t, 1 - t);
  944. }
  945. }
  946. return !!(running_program || pending_program);
  947. });
  948. }
  949. }
  950. return {
  951. run(b) {
  952. if (is_function(config)) {
  953. wait().then(() => {
  954. // @ts-ignore
  955. config = config();
  956. go(b);
  957. });
  958. }
  959. else {
  960. go(b);
  961. }
  962. },
  963. end() {
  964. clear_animation();
  965. running_program = pending_program = null;
  966. }
  967. };
  968. }
  969. function handle_promise(promise, info) {
  970. const token = info.token = {};
  971. function update(type, index, key, value) {
  972. if (info.token !== token)
  973. return;
  974. info.resolved = value;
  975. let child_ctx = info.ctx;
  976. if (key !== undefined) {
  977. child_ctx = child_ctx.slice();
  978. child_ctx[key] = value;
  979. }
  980. const block = type && (info.current = type)(child_ctx);
  981. let needs_flush = false;
  982. if (info.block) {
  983. if (info.blocks) {
  984. info.blocks.forEach((block, i) => {
  985. if (i !== index && block) {
  986. group_outros();
  987. transition_out(block, 1, 1, () => {
  988. info.blocks[i] = null;
  989. });
  990. check_outros();
  991. }
  992. });
  993. }
  994. else {
  995. info.block.d(1);
  996. }
  997. block.c();
  998. transition_in(block, 1);
  999. block.m(info.mount(), info.anchor);
  1000. needs_flush = true;
  1001. }
  1002. info.block = block;
  1003. if (info.blocks)
  1004. info.blocks[index] = block;
  1005. if (needs_flush) {
  1006. flush();
  1007. }
  1008. }
  1009. if (is_promise(promise)) {
  1010. const current_component = get_current_component();
  1011. promise.then(value => {
  1012. set_current_component(current_component);
  1013. update(info.then, 1, info.value, value);
  1014. set_current_component(null);
  1015. }, error => {
  1016. set_current_component(current_component);
  1017. update(info.catch, 2, info.error, error);
  1018. set_current_component(null);
  1019. });
  1020. // if we previously had a then/catch block, destroy it
  1021. if (info.current !== info.pending) {
  1022. update(info.pending, 0);
  1023. return true;
  1024. }
  1025. }
  1026. else {
  1027. if (info.current !== info.then) {
  1028. update(info.then, 1, info.value, promise);
  1029. return true;
  1030. }
  1031. info.resolved = promise;
  1032. }
  1033. }
  1034. const globals = (typeof window !== 'undefined' ? window : global);
  1035. function destroy_block(block, lookup) {
  1036. block.d(1);
  1037. lookup.delete(block.key);
  1038. }
  1039. function outro_and_destroy_block(block, lookup) {
  1040. transition_out(block, 1, 1, () => {
  1041. lookup.delete(block.key);
  1042. });
  1043. }
  1044. function fix_and_destroy_block(block, lookup) {
  1045. block.f();
  1046. destroy_block(block, lookup);
  1047. }
  1048. function fix_and_outro_and_destroy_block(block, lookup) {
  1049. block.f();
  1050. outro_and_destroy_block(block, lookup);
  1051. }
  1052. function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
  1053. let o = old_blocks.length;
  1054. let n = list.length;
  1055. let i = o;
  1056. const old_indexes = {};
  1057. while (i--)
  1058. old_indexes[old_blocks[i].key] = i;
  1059. const new_blocks = [];
  1060. const new_lookup = new Map();
  1061. const deltas = new Map();
  1062. i = n;
  1063. while (i--) {
  1064. const child_ctx = get_context(ctx, list, i);
  1065. const key = get_key(child_ctx);
  1066. let block = lookup.get(key);
  1067. if (!block) {
  1068. block = create_each_block(key, child_ctx);
  1069. block.c();
  1070. }
  1071. else if (dynamic) {
  1072. block.p(child_ctx, dirty);
  1073. }
  1074. new_lookup.set(key, new_blocks[i] = block);
  1075. if (key in old_indexes)
  1076. deltas.set(key, Math.abs(i - old_indexes[key]));
  1077. }
  1078. const will_move = new Set();
  1079. const did_move = new Set();
  1080. function insert(block) {
  1081. transition_in(block, 1);
  1082. block.m(node, next);
  1083. lookup.set(block.key, block);
  1084. next = block.first;
  1085. n--;
  1086. }
  1087. while (o && n) {
  1088. const new_block = new_blocks[n - 1];
  1089. const old_block = old_blocks[o - 1];
  1090. const new_key = new_block.key;
  1091. const old_key = old_block.key;
  1092. if (new_block === old_block) {
  1093. // do nothing
  1094. next = new_block.first;
  1095. o--;
  1096. n--;
  1097. }
  1098. else if (!new_lookup.has(old_key)) {
  1099. // remove old block
  1100. destroy(old_block, lookup);
  1101. o--;
  1102. }
  1103. else if (!lookup.has(new_key) || will_move.has(new_key)) {
  1104. insert(new_block);
  1105. }
  1106. else if (did_move.has(old_key)) {
  1107. o--;
  1108. }
  1109. else if (deltas.get(new_key) > deltas.get(old_key)) {
  1110. did_move.add(new_key);
  1111. insert(new_block);
  1112. }
  1113. else {
  1114. will_move.add(old_key);
  1115. o--;
  1116. }
  1117. }
  1118. while (o--) {
  1119. const old_block = old_blocks[o];
  1120. if (!new_lookup.has(old_block.key))
  1121. destroy(old_block, lookup);
  1122. }
  1123. while (n)
  1124. insert(new_blocks[n - 1]);
  1125. return new_blocks;
  1126. }
  1127. function validate_each_keys(ctx, list, get_context, get_key) {
  1128. const keys = new Set();
  1129. for (let i = 0; i < list.length; i++) {
  1130. const key = get_key(get_context(ctx, list, i));
  1131. if (keys.has(key)) {
  1132. throw new Error(`Cannot have duplicate keys in a keyed each`);
  1133. }
  1134. keys.add(key);
  1135. }
  1136. }
  1137. function get_spread_update(levels, updates) {
  1138. const update = {};
  1139. const to_null_out = {};
  1140. const accounted_for = { $$scope: 1 };
  1141. let i = levels.length;
  1142. while (i--) {
  1143. const o = levels[i];
  1144. const n = updates[i];
  1145. if (n) {
  1146. for (const key in o) {
  1147. if (!(key in n))
  1148. to_null_out[key] = 1;
  1149. }
  1150. for (const key in n) {
  1151. if (!accounted_for[key]) {
  1152. update[key] = n[key];
  1153. accounted_for[key] = 1;
  1154. }
  1155. }
  1156. levels[i] = n;
  1157. }
  1158. else {
  1159. for (const key in o) {
  1160. accounted_for[key] = 1;
  1161. }
  1162. }
  1163. }
  1164. for (const key in to_null_out) {
  1165. if (!(key in update))
  1166. update[key] = undefined;
  1167. }
  1168. return update;
  1169. }
  1170. function get_spread_object(spread_props) {
  1171. return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
  1172. }
  1173. // source: https://html.spec.whatwg.org/multipage/indices.html
  1174. const boolean_attributes = new Set([
  1175. 'allowfullscreen',
  1176. 'allowpaymentrequest',
  1177. 'async',
  1178. 'autofocus',
  1179. 'autoplay',
  1180. 'checked',
  1181. 'controls',
  1182. 'default',
  1183. 'defer',
  1184. 'disabled',
  1185. 'formnovalidate',
  1186. 'hidden',
  1187. 'ismap',
  1188. 'loop',
  1189. 'multiple',
  1190. 'muted',
  1191. 'nomodule',
  1192. 'novalidate',
  1193. 'open',
  1194. 'playsinline',
  1195. 'readonly',
  1196. 'required',
  1197. 'reversed',
  1198. 'selected'
  1199. ]);
  1200. const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
  1201. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  1202. // https://infra.spec.whatwg.org/#noncharacter
  1203. function spread(args, classes_to_add) {
  1204. const attributes = Object.assign({}, ...args);
  1205. if (classes_to_add) {
  1206. if (attributes.class == null) {
  1207. attributes.class = classes_to_add;
  1208. }
  1209. else {
  1210. attributes.class += ' ' + classes_to_add;
  1211. }
  1212. }
  1213. let str = '';
  1214. Object.keys(attributes).forEach(name => {
  1215. if (invalid_attribute_name_character.test(name))
  1216. return;
  1217. const value = attributes[name];
  1218. if (value === true)
  1219. str += " " + name;
  1220. else if (boolean_attributes.has(name.toLowerCase())) {
  1221. if (value)
  1222. str += " " + name;
  1223. }
  1224. else if (value != null) {
  1225. str += ` ${name}="${String(value).replace(/"/g, '&#34;').replace(/'/g, '&#39;')}"`;
  1226. }
  1227. });
  1228. return str;
  1229. }
  1230. const escaped = {
  1231. '"': '&quot;',
  1232. "'": '&#39;',
  1233. '&': '&amp;',
  1234. '<': '&lt;',
  1235. '>': '&gt;'
  1236. };
  1237. function escape$1(html) {
  1238. return String(html).replace(/["'&<>]/g, match => escaped[match]);
  1239. }
  1240. function each(items, fn) {
  1241. let str = '';
  1242. for (let i = 0; i < items.length; i += 1) {
  1243. str += fn(items[i], i);
  1244. }
  1245. return str;
  1246. }
  1247. const missing_component = {
  1248. $$render: () => ''
  1249. };
  1250. function validate_component(component, name) {
  1251. if (!component || !component.$$render) {
  1252. if (name === 'svelte:component')
  1253. name += ' this={...}';
  1254. throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
  1255. }
  1256. return component;
  1257. }
  1258. function debug(file, line, column, values) {
  1259. console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console
  1260. console.log(values); // eslint-disable-line no-console
  1261. return '';
  1262. }
  1263. let on_destroy;
  1264. function create_ssr_component(fn) {
  1265. function $$render(result, props, bindings, slots) {
  1266. const parent_component = current_component;
  1267. const $$ = {
  1268. on_destroy,
  1269. context: new Map(parent_component ? parent_component.$$.context : []),
  1270. // these will be immediately discarded
  1271. on_mount: [],
  1272. before_update: [],
  1273. after_update: [],
  1274. callbacks: blank_object()
  1275. };
  1276. set_current_component({ $$ });
  1277. const html = fn(result, props, bindings, slots);
  1278. set_current_component(parent_component);
  1279. return html;
  1280. }
  1281. return {
  1282. render: (props = {}, options = {}) => {
  1283. on_destroy = [];
  1284. const result = { title: '', head: '', css: new Set() };
  1285. const html = $$render(result, props, {}, options);
  1286. run_all(on_destroy);
  1287. return {
  1288. html,
  1289. css: {
  1290. code: Array.from(result.css).map(css => css.code).join('\n'),
  1291. map: null // TODO
  1292. },
  1293. head: result.title + result.head
  1294. };
  1295. },
  1296. $$render
  1297. };
  1298. }
  1299. function add_attribute(name, value, boolean) {
  1300. if (value == null || (boolean && !value))
  1301. return '';
  1302. return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape$1(value)) : `"${value}"`}`}`;
  1303. }
  1304. function add_classes(classes) {
  1305. return classes ? ` class="${classes}"` : ``;
  1306. }
  1307. function bind(component, name, callback) {
  1308. const index = component.$$.props[name];
  1309. if (index !== undefined) {
  1310. component.$$.bound[index] = callback;
  1311. callback(component.$$.ctx[index]);
  1312. }
  1313. }
  1314. function create_component(block) {
  1315. block && block.c();
  1316. }
  1317. function claim_component(block, parent_nodes) {
  1318. block && block.l(parent_nodes);
  1319. }
  1320. function mount_component(component, target, anchor) {
  1321. const { fragment, on_mount, on_destroy, after_update } = component.$$;
  1322. fragment && fragment.m(target, anchor);
  1323. // onMount happens before the initial afterUpdate
  1324. add_render_callback(() => {
  1325. const new_on_destroy = on_mount.map(run).filter(is_function);
  1326. if (on_destroy) {
  1327. on_destroy.push(...new_on_destroy);
  1328. }
  1329. else {
  1330. // Edge case - component was destroyed immediately,
  1331. // most likely as a result of a binding initialising
  1332. run_all(new_on_destroy);
  1333. }
  1334. component.$$.on_mount = [];
  1335. });
  1336. after_update.forEach(add_render_callback);
  1337. }
  1338. function destroy_component(component, detaching) {
  1339. const $$ = component.$$;
  1340. if ($$.fragment !== null) {
  1341. run_all($$.on_destroy);
  1342. $$.fragment && $$.fragment.d(detaching);
  1343. // TODO null out other refs, including component.$$ (but need to
  1344. // preserve final state?)
  1345. $$.on_destroy = $$.fragment = null;
  1346. $$.ctx = [];
  1347. }
  1348. }
  1349. function make_dirty(component, i) {
  1350. if (component.$$.dirty[0] === -1) {
  1351. dirty_components.push(component);
  1352. schedule_update();
  1353. component.$$.dirty.fill(0);
  1354. }
  1355. component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
  1356. }
  1357. function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
  1358. const parent_component = current_component;
  1359. set_current_component(component);
  1360. const prop_values = options.props || {};
  1361. const $$ = component.$$ = {
  1362. fragment: null,
  1363. ctx: null,
  1364. // state
  1365. props,
  1366. update: noop,
  1367. not_equal,
  1368. bound: blank_object(),
  1369. // lifecycle
  1370. on_mount: [],
  1371. on_destroy: [],
  1372. before_update: [],
  1373. after_update: [],
  1374. context: new Map(parent_component ? parent_component.$$.context : []),
  1375. // everything else
  1376. callbacks: blank_object(),
  1377. dirty
  1378. };
  1379. let ready = false;
  1380. $$.ctx = instance
  1381. ? instance(component, prop_values, (i, ret, ...rest) => {
  1382. const value = rest.length ? rest[0] : ret;
  1383. if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
  1384. if ($$.bound[i])
  1385. $$.bound[i](value);
  1386. if (ready)
  1387. make_dirty(component, i);
  1388. }
  1389. return ret;
  1390. })
  1391. : [];
  1392. $$.update();
  1393. ready = true;
  1394. run_all($$.before_update);
  1395. // `false` as a special case of no DOM component
  1396. $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
  1397. if (options.target) {
  1398. if (options.hydrate) {
  1399. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  1400. $$.fragment && $$.fragment.l(children(options.target));
  1401. }
  1402. else {
  1403. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  1404. $$.fragment && $$.fragment.c();
  1405. }
  1406. if (options.intro)
  1407. transition_in(component.$$.fragment);
  1408. mount_component(component, options.target, options.anchor);
  1409. flush();
  1410. }
  1411. set_current_component(parent_component);
  1412. }
  1413. let SvelteElement;
  1414. if (typeof HTMLElement === 'function') {
  1415. SvelteElement = class extends HTMLElement {
  1416. constructor() {
  1417. super();
  1418. this.attachShadow({ mode: 'open' });
  1419. }
  1420. connectedCallback() {
  1421. // @ts-ignore todo: improve typings
  1422. for (const key in this.$$.slotted) {
  1423. // @ts-ignore todo: improve typings
  1424. this.appendChild(this.$$.slotted[key]);
  1425. }
  1426. }
  1427. attributeChangedCallback(attr, _oldValue, newValue) {
  1428. this[attr] = newValue;
  1429. }
  1430. $destroy() {
  1431. destroy_component(this, 1);
  1432. this.$destroy = noop;
  1433. }
  1434. $on(type, callback) {
  1435. // TODO should this delegate to addEventListener?
  1436. const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
  1437. callbacks.push(callback);
  1438. return () => {
  1439. const index = callbacks.indexOf(callback);
  1440. if (index !== -1)
  1441. callbacks.splice(index, 1);
  1442. };
  1443. }
  1444. $set() {
  1445. // overridden by instance, if it has props
  1446. }
  1447. };
  1448. }
  1449. class SvelteComponent {
  1450. $destroy() {
  1451. destroy_component(this, 1);
  1452. this.$destroy = noop;
  1453. }
  1454. $on(type, callback) {
  1455. const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
  1456. callbacks.push(callback);
  1457. return () => {
  1458. const index = callbacks.indexOf(callback);
  1459. if (index !== -1)
  1460. callbacks.splice(index, 1);
  1461. };
  1462. }
  1463. $set() {
  1464. // overridden by instance, if it has props
  1465. }
  1466. }
  1467. function dispatch_dev(type, detail) {
  1468. document.dispatchEvent(custom_event(type, Object.assign({ version: '3.19.2' }, detail)));
  1469. }
  1470. function append_dev(target, node) {
  1471. dispatch_dev("SvelteDOMInsert", { target, node });
  1472. append(target, node);
  1473. }
  1474. function insert_dev(target, node, anchor) {
  1475. dispatch_dev("SvelteDOMInsert", { target, node, anchor });
  1476. insert(target, node, anchor);
  1477. }
  1478. function detach_dev(node) {
  1479. dispatch_dev("SvelteDOMRemove", { node });
  1480. detach(node);
  1481. }
  1482. function detach_between_dev(before, after) {
  1483. while (before.nextSibling && before.nextSibling !== after) {
  1484. detach_dev(before.nextSibling);
  1485. }
  1486. }
  1487. function detach_before_dev(after) {
  1488. while (after.previousSibling) {
  1489. detach_dev(after.previousSibling);
  1490. }
  1491. }
  1492. function detach_after_dev(before) {
  1493. while (before.nextSibling) {
  1494. detach_dev(before.nextSibling);
  1495. }
  1496. }
  1497. function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
  1498. const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : [];
  1499. if (has_prevent_default)
  1500. modifiers.push('preventDefault');
  1501. if (has_stop_propagation)
  1502. modifiers.push('stopPropagation');
  1503. dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers });
  1504. const dispose = listen(node, event, handler, options);
  1505. return () => {
  1506. dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers });
  1507. dispose();
  1508. };
  1509. }
  1510. function attr_dev(node, attribute, value) {
  1511. attr(node, attribute, value);
  1512. if (value == null)
  1513. dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute });
  1514. else
  1515. dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value });
  1516. }
  1517. function prop_dev(node, property, value) {
  1518. node[property] = value;
  1519. dispatch_dev("SvelteDOMSetProperty", { node, property, value });
  1520. }
  1521. function dataset_dev(node, property, value) {
  1522. node.dataset[property] = value;
  1523. dispatch_dev("SvelteDOMSetDataset", { node, property, value });
  1524. }
  1525. function set_data_dev(text, data) {
  1526. data = '' + data;
  1527. if (text.data === data)
  1528. return;
  1529. dispatch_dev("SvelteDOMSetData", { node: text, data });
  1530. text.data = data;
  1531. }
  1532. function validate_each_argument(arg) {
  1533. if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
  1534. let msg = '{#each} only iterates over array-like objects.';
  1535. if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
  1536. msg += ' You can use a spread to convert this iterable into an array.';
  1537. }
  1538. throw new Error(msg);
  1539. }
  1540. }
  1541. function validate_slots(name, slot, keys) {
  1542. for (const slot_key of Object.keys(slot)) {
  1543. if (!~keys.indexOf(slot_key)) {
  1544. console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
  1545. }
  1546. }
  1547. }
  1548. class SvelteComponentDev extends SvelteComponent {
  1549. constructor(options) {
  1550. if (!options || (!options.target && !options.$$inline)) {
  1551. throw new Error(`'target' is a required option`);
  1552. }
  1553. super();
  1554. }
  1555. $destroy() {
  1556. super.$destroy();
  1557. this.$destroy = () => {
  1558. console.warn(`Component was already destroyed`); // eslint-disable-line no-console
  1559. };
  1560. }
  1561. $capture_state() { }
  1562. $inject_state() { }
  1563. }
  1564. function loop_guard(timeout) {
  1565. const start = Date.now();
  1566. return () => {
  1567. if (Date.now() - start > timeout) {
  1568. throw new Error(`Infinite loop detected`);
  1569. }
  1570. };
  1571. }
  1572. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  1573. function commonjsRequire () {
  1574. throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
  1575. }
  1576. function unwrapExports (x) {
  1577. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  1578. }
  1579. function createCommonjsModule(fn, module) {
  1580. return module = { exports: {} }, fn(module, module.exports), module.exports;
  1581. }
  1582. function getCjsExportFromNamespace (n) {
  1583. return n && n['default'] || n;
  1584. }
  1585. 'use strict';
  1586. var strictUriEncode = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
  1587. 'use strict';
  1588. var token = '%[a-f0-9]{2}';
  1589. var singleMatcher = new RegExp(token, 'gi');
  1590. var multiMatcher = new RegExp('(' + token + ')+', 'gi');
  1591. function decodeComponents(components, split) {
  1592. try {
  1593. // Try to decode the entire string first
  1594. return decodeURIComponent(components.join(''));
  1595. } catch (err) {
  1596. // Do nothing
  1597. }
  1598. if (components.length === 1) {
  1599. return components;
  1600. }
  1601. split = split || 1;
  1602. // Split the array in 2 parts
  1603. var left = components.slice(0, split);
  1604. var right = components.slice(split);
  1605. return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
  1606. }
  1607. function decode(input) {
  1608. try {
  1609. return decodeURIComponent(input);
  1610. } catch (err) {
  1611. var tokens = input.match(singleMatcher);
  1612. for (var i = 1; i < tokens.length; i++) {
  1613. input = decodeComponents(tokens, i).join('');
  1614. tokens = input.match(singleMatcher);
  1615. }
  1616. return input;
  1617. }
  1618. }
  1619. function customDecodeURIComponent(input) {
  1620. // Keep track of all the replacements and prefill the map with the `BOM`
  1621. var replaceMap = {
  1622. '%FE%FF': '\uFFFD\uFFFD',
  1623. '%FF%FE': '\uFFFD\uFFFD'
  1624. };
  1625. var match = multiMatcher.exec(input);
  1626. while (match) {
  1627. try {
  1628. // Decode as big chunks as possible
  1629. replaceMap[match[0]] = decodeURIComponent(match[0]);
  1630. } catch (err) {
  1631. var result = decode(match[0]);
  1632. if (result !== match[0]) {
  1633. replaceMap[match[0]] = result;
  1634. }
  1635. }
  1636. match = multiMatcher.exec(input);
  1637. }
  1638. // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
  1639. replaceMap['%C2'] = '\uFFFD';
  1640. var entries = Object.keys(replaceMap);
  1641. for (var i = 0; i < entries.length; i++) {
  1642. // Replace all decoded components
  1643. var key = entries[i];
  1644. input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
  1645. }
  1646. return input;
  1647. }
  1648. var decodeUriComponent = function (encodedURI) {
  1649. if (typeof encodedURI !== 'string') {
  1650. throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
  1651. }
  1652. try {
  1653. encodedURI = encodedURI.replace(/\+/g, ' ');
  1654. // Try the built in decoder first
  1655. return decodeURIComponent(encodedURI);
  1656. } catch (err) {
  1657. // Fallback to a more advanced decoder
  1658. return customDecodeURIComponent(encodedURI);
  1659. }
  1660. };
  1661. 'use strict';
  1662. var splitOnFirst = (string, separator) => {
  1663. if (!(typeof string === 'string' && typeof separator === 'string')) {
  1664. throw new TypeError('Expected the arguments to be of type `string`');
  1665. }
  1666. if (separator === '') {
  1667. return [string];
  1668. }
  1669. const separatorIndex = string.indexOf(separator);
  1670. if (separatorIndex === -1) {
  1671. return [string];
  1672. }
  1673. return [
  1674. string.slice(0, separatorIndex),
  1675. string.slice(separatorIndex + separator.length)
  1676. ];
  1677. };
  1678. var queryString = createCommonjsModule(function (module, exports) {
  1679. 'use strict';
  1680. function encoderForArrayFormat(options) {
  1681. switch (options.arrayFormat) {
  1682. case 'index':
  1683. return key => (result, value) => {
  1684. const index = result.length;
  1685. if (value === undefined || (options.skipNull && value === null)) {
  1686. return result;
  1687. }
  1688. if (value === null) {
  1689. return [...result, [encode(key, options), '[', index, ']'].join('')];
  1690. }
  1691. return [
  1692. ...result,
  1693. [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
  1694. ];
  1695. };
  1696. case 'bracket':
  1697. return key => (result, value) => {
  1698. if (value === undefined || (options.skipNull && value === null)) {
  1699. return result;
  1700. }
  1701. if (value === null) {
  1702. return [...result, [encode(key, options), '[]'].join('')];
  1703. }
  1704. return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
  1705. };
  1706. case 'comma':
  1707. case 'separator':
  1708. return key => (result, value) => {
  1709. if (value === null || value === undefined || value.length === 0) {
  1710. return result;
  1711. }
  1712. if (result.length === 0) {
  1713. return [[encode(key, options), '=', encode(value, options)].join('')];
  1714. }
  1715. return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
  1716. };
  1717. default:
  1718. return key => (result, value) => {
  1719. if (value === undefined || (options.skipNull && value === null)) {
  1720. return result;
  1721. }
  1722. if (value === null) {
  1723. return [...result, encode(key, options)];
  1724. }
  1725. return [...result, [encode(key, options), '=', encode(value, options)].join('')];
  1726. };
  1727. }
  1728. }
  1729. function parserForArrayFormat(options) {
  1730. let result;
  1731. switch (options.arrayFormat) {
  1732. case 'index':
  1733. return (key, value, accumulator) => {
  1734. result = /\[(\d*)\]$/.exec(key);
  1735. key = key.replace(/\[\d*\]$/, '');
  1736. if (!result) {
  1737. accumulator[key] = value;
  1738. return;
  1739. }
  1740. if (accumulator[key] === undefined) {
  1741. accumulator[key] = {};
  1742. }
  1743. accumulator[key][result[1]] = value;
  1744. };
  1745. case 'bracket':
  1746. return (key, value, accumulator) => {
  1747. result = /(\[\])$/.exec(key);
  1748. key = key.replace(/\[\]$/, '');
  1749. if (!result) {
  1750. accumulator[key] = value;
  1751. return;
  1752. }
  1753. if (accumulator[key] === undefined) {
  1754. accumulator[key] = [value];
  1755. return;
  1756. }
  1757. accumulator[key] = [].concat(accumulator[key], value);
  1758. };
  1759. case 'comma':
  1760. case 'separator':
  1761. return (key, value, accumulator) => {
  1762. const isArray = typeof value === 'string' && value.split('').indexOf(options.arrayFormatSeparator) > -1;
  1763. const newValue = isArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
  1764. accumulator[key] = newValue;
  1765. };
  1766. default:
  1767. return (key, value, accumulator) => {
  1768. if (accumulator[key] === undefined) {
  1769. accumulator[key] = value;
  1770. return;
  1771. }
  1772. accumulator[key] = [].concat(accumulator[key], value);
  1773. };
  1774. }
  1775. }
  1776. function validateArrayFormatSeparator(value) {
  1777. if (typeof value !== 'string' || value.length !== 1) {
  1778. throw new TypeError('arrayFormatSeparator must be single character string');
  1779. }
  1780. }
  1781. function encode(value, options) {
  1782. if (options.encode) {
  1783. return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
  1784. }
  1785. return value;
  1786. }
  1787. function decode(value, options) {
  1788. if (options.decode) {
  1789. return decodeUriComponent(value);
  1790. }
  1791. return value;
  1792. }
  1793. function keysSorter(input) {
  1794. if (Array.isArray(input)) {
  1795. return input.sort();
  1796. }
  1797. if (typeof input === 'object') {
  1798. return keysSorter(Object.keys(input))
  1799. .sort((a, b) => Number(a) - Number(b))
  1800. .map(key => input[key]);
  1801. }
  1802. return input;
  1803. }
  1804. function removeHash(input) {
  1805. const hashStart = input.indexOf('#');
  1806. if (hashStart !== -1) {
  1807. input = input.slice(0, hashStart);
  1808. }
  1809. return input;
  1810. }
  1811. function getHash(url) {
  1812. let hash = '';
  1813. const hashStart = url.indexOf('#');
  1814. if (hashStart !== -1) {
  1815. hash = url.slice(hashStart);
  1816. }
  1817. return hash;
  1818. }
  1819. function extract(input) {
  1820. input = removeHash(input);
  1821. const queryStart = input.indexOf('?');
  1822. if (queryStart === -1) {
  1823. return '';
  1824. }
  1825. return input.slice(queryStart + 1);
  1826. }
  1827. function parseValue(value, options) {
  1828. if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
  1829. value = Number(value);
  1830. } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
  1831. value = value.toLowerCase() === 'true';
  1832. }
  1833. return value;
  1834. }
  1835. function parse(input, options) {
  1836. options = Object.assign({
  1837. decode: true,
  1838. sort: true,
  1839. arrayFormat: 'none',
  1840. arrayFormatSeparator: ',',
  1841. parseNumbers: false,
  1842. parseBooleans: false
  1843. }, options);
  1844. validateArrayFormatSeparator(options.arrayFormatSeparator);
  1845. const formatter = parserForArrayFormat(options);
  1846. // Create an object with no prototype
  1847. const ret = Object.create(null);
  1848. if (typeof input !== 'string') {
  1849. return ret;
  1850. }
  1851. input = input.trim().replace(/^[?#&]/, '');
  1852. if (!input) {
  1853. return ret;
  1854. }
  1855. for (const param of input.split('&')) {
  1856. let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '=');
  1857. // Missing `=` should be `null`:
  1858. // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
  1859. value = value === undefined ? null : options.arrayFormat === 'comma' ? value : decode(value, options);
  1860. formatter(decode(key, options), value, ret);
  1861. }
  1862. for (const key of Object.keys(ret)) {
  1863. const value = ret[key];
  1864. if (typeof value === 'object' && value !== null) {
  1865. for (const k of Object.keys(value)) {
  1866. value[k] = parseValue(value[k], options);
  1867. }
  1868. } else {
  1869. ret[key] = parseValue(value, options);
  1870. }
  1871. }
  1872. if (options.sort === false) {
  1873. return ret;
  1874. }
  1875. return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
  1876. const value = ret[key];
  1877. if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
  1878. // Sort object keys, not values
  1879. result[key] = keysSorter(value);
  1880. } else {
  1881. result[key] = value;
  1882. }
  1883. return result;
  1884. }, Object.create(null));
  1885. }
  1886. exports.extract = extract;
  1887. exports.parse = parse;
  1888. exports.stringify = (object, options) => {
  1889. if (!object) {
  1890. return '';
  1891. }
  1892. options = Object.assign({
  1893. encode: true,
  1894. strict: true,
  1895. arrayFormat: 'none',
  1896. arrayFormatSeparator: ','
  1897. }, options);
  1898. validateArrayFormatSeparator(options.arrayFormatSeparator);
  1899. const formatter = encoderForArrayFormat(options);
  1900. const objectCopy = Object.assign({}, object);
  1901. if (options.skipNull) {
  1902. for (const key of Object.keys(objectCopy)) {
  1903. if (objectCopy[key] === undefined || objectCopy[key] === null) {
  1904. delete objectCopy[key];
  1905. }
  1906. }
  1907. }
  1908. const keys = Object.keys(objectCopy);
  1909. if (options.sort !== false) {
  1910. keys.sort(options.sort);
  1911. }
  1912. return keys.map(key => {
  1913. const value = object[key];
  1914. if (value === undefined) {
  1915. return '';
  1916. }
  1917. if (value === null) {
  1918. return encode(key, options);
  1919. }
  1920. if (Array.isArray(value)) {
  1921. return value
  1922. .reduce(formatter(key), [])
  1923. .join('&');
  1924. }
  1925. return encode(key, options) + '=' + encode(value, options);
  1926. }).filter(x => x.length > 0).join('&');
  1927. };
  1928. exports.parseUrl = (input, options) => {
  1929. return {
  1930. url: removeHash(input).split('?')[0] || '',
  1931. query: parse(extract(input), options)
  1932. };
  1933. };
  1934. exports.stringifyUrl = (input, options) => {
  1935. const url = removeHash(input.url).split('?')[0] || '';
  1936. const queryFromUrl = exports.extract(input.url);
  1937. const parsedQueryFromUrl = exports.parse(queryFromUrl);
  1938. const hash = getHash(input.url);
  1939. const query = Object.assign(parsedQueryFromUrl, input.query);
  1940. let queryString = exports.stringify(query, options);
  1941. if (queryString) {
  1942. queryString = `?${queryString}`;
  1943. }
  1944. return `${url}${queryString}${hash}`;
  1945. };
  1946. });
  1947. var queryString_1 = queryString.extract;
  1948. var queryString_2 = queryString.parse;
  1949. var queryString_3 = queryString.stringify;
  1950. var queryString_4 = queryString.parseUrl;
  1951. var queryString_5 = queryString.stringifyUrl;
  1952. var index_umd = createCommonjsModule(function (module, exports) {
  1953. (function (global, factory) {
  1954. 'object' === 'object' && 'object' !== 'undefined' ? module.exports = factory() :
  1955. typeof undefined === 'function' && undefined.amd ? undefined(factory) :
  1956. (global = global || self, global.AbstractNestedRouter = factory());
  1957. }(commonjsGlobal, function () { 'use strict';
  1958. var defaultExport = /*@__PURE__*/(function (Error) {
  1959. function defaultExport(route, path) {
  1960. var message = "Unreachable '" + route + "', segment '" + path + "' is not defined";
  1961. Error.call(this, message);
  1962. this.message = message;
  1963. }
  1964. if ( Error ) defaultExport.__proto__ = Error;
  1965. defaultExport.prototype = Object.create( Error && Error.prototype );
  1966. defaultExport.prototype.constructor = defaultExport;
  1967. return defaultExport;
  1968. }(Error));
  1969. function buildMatcher(path, parent) {
  1970. var regex;
  1971. var _isSplat;
  1972. var _priority = -100;
  1973. var keys = [];
  1974. regex = path.replace(/[-$.]/g, '\\$&').replace(/\(/g, '(?:').replace(/\)/g, ')?').replace(/([:*]\w+)(?:<([^<>]+?)>)?/g, function (_, key, expr) {
  1975. keys.push(key.substr(1));
  1976. if (key.charAt() === ':') {
  1977. _priority += 100;
  1978. return ("((?!#)" + (expr || '[^#/]+?') + ")");
  1979. }
  1980. _isSplat = true;
  1981. _priority += 500;
  1982. return ("((?!#)" + (expr || '[^#]+?') + ")");
  1983. });
  1984. try {
  1985. regex = new RegExp(("^" + regex + "$"));
  1986. } catch (e) {
  1987. throw new TypeError(("Invalid route expression, given '" + parent + "'"));
  1988. }
  1989. var _hashed = path.includes('#') ? 0.5 : 1;
  1990. var _depth = path.length * _priority * _hashed;
  1991. return {
  1992. keys: keys,
  1993. regex: regex,
  1994. _depth: _depth,
  1995. _isSplat: _isSplat
  1996. };
  1997. }
  1998. var PathMatcher = function PathMatcher(path, parent) {
  1999. var ref = buildMatcher(path, parent);
  2000. var keys = ref.keys;
  2001. var regex = ref.regex;
  2002. var _depth = ref._depth;
  2003. var _isSplat = ref._isSplat;
  2004. return {
  2005. _isSplat: _isSplat,
  2006. _depth: _depth,
  2007. match: function (value) {
  2008. var matches = value.match(regex);
  2009. if (matches) {
  2010. return keys.reduce(function (prev, cur, i) {
  2011. prev[cur] = typeof matches[i + 1] === 'string' ? decodeURIComponent(matches[i + 1]) : null;
  2012. return prev;
  2013. }, {});
  2014. }
  2015. }
  2016. };
  2017. };
  2018. PathMatcher.push = function push (key, prev, leaf, parent) {
  2019. var root = prev[key] || (prev[key] = {});
  2020. if (!root.pattern) {
  2021. root.pattern = new PathMatcher(key, parent);
  2022. root.route = (leaf || '').replace(/\/$/, '') || '/';
  2023. }
  2024. prev.keys = prev.keys || [];
  2025. if (!prev.keys.includes(key)) {
  2026. prev.keys.push(key);
  2027. PathMatcher.sort(prev);
  2028. }
  2029. return root;
  2030. };
  2031. PathMatcher.sort = function sort (root) {
  2032. root.keys.sort(function (a, b) {
  2033. return root[a].pattern._depth - root[b].pattern._depth;
  2034. });
  2035. };
  2036. function merge(path, parent) {
  2037. return ("" + (parent && parent !== '/' ? parent : '') + (path || ''));
  2038. }
  2039. function walk(path, cb) {
  2040. var matches = path.match(/<[^<>]*\/[^<>]*>/);
  2041. if (matches) {
  2042. throw new TypeError(("RegExp cannot contain slashes, given '" + matches + "'"));
  2043. }
  2044. var parts = path.split(/(?=\/|#)/);
  2045. var root = [];
  2046. if (parts[0] !== '/') {
  2047. parts.unshift('/');
  2048. }
  2049. parts.some(function (x, i) {
  2050. var parent = root.slice(1).concat(x).join('') || null;
  2051. var segment = parts.slice(i + 1).join('') || null;
  2052. var retval = cb(x, parent, segment ? ("" + (x !== '/' ? x : '') + segment) : null);
  2053. root.push(x);
  2054. return retval;
  2055. });
  2056. }
  2057. function reduce(key, root, _seen) {
  2058. var params = {};
  2059. var out = [];
  2060. var splat;
  2061. walk(key, function (x, leaf, extra) {
  2062. var found;
  2063. if (!root.keys) {
  2064. throw new defaultExport(key, x);
  2065. }
  2066. root.keys.some(function (k) {
  2067. if (_seen.includes(k)) { return false; }
  2068. var ref = root[k].pattern;
  2069. var match = ref.match;
  2070. var _isSplat = ref._isSplat;
  2071. var matches = match(_isSplat ? extra || x : x);
  2072. if (matches) {
  2073. Object.assign(params, matches);
  2074. if (root[k].route) {
  2075. var routeInfo = Object.assign({}, root[k].info); // properly handle exact-routes!
  2076. var hasMatch = false;
  2077. if (routeInfo.exact) {
  2078. hasMatch = extra === null;
  2079. } else {
  2080. hasMatch = !(x && leaf === null) || x === leaf || _isSplat || !extra;
  2081. }
  2082. routeInfo.matches = hasMatch;
  2083. routeInfo.params = Object.assign({}, params);
  2084. routeInfo.route = root[k].route;
  2085. routeInfo.path = _isSplat && extra || leaf || x;
  2086. out.push(routeInfo);
  2087. }
  2088. if (extra === null && !root[k].keys) {
  2089. return true;
  2090. }
  2091. if (k !== '/') { _seen.push(k); }
  2092. splat = _isSplat;
  2093. root = root[k];
  2094. found = true;
  2095. return true;
  2096. }
  2097. return false;
  2098. });
  2099. if (!(found || root.keys.some(function (k) { return root[k].pattern.match(x); }))) {
  2100. throw new defaultExport(key, x);
  2101. }
  2102. return splat || !found;
  2103. });
  2104. return out;
  2105. }
  2106. function find(path, routes, retries) {
  2107. var get = reduce.bind(null, path, routes);
  2108. var set = [];
  2109. while (retries > 0) {
  2110. retries -= 1;
  2111. try {
  2112. return get(set);
  2113. } catch (e) {
  2114. if (retries > 0) {
  2115. return get(set);
  2116. }
  2117. throw e;
  2118. }
  2119. }
  2120. }
  2121. function add(path, routes, parent, routeInfo) {
  2122. var fullpath = merge(path, parent);
  2123. var root = routes;
  2124. var key;
  2125. if (routeInfo && routeInfo.nested !== true) {
  2126. key = routeInfo.key;
  2127. delete routeInfo.key;
  2128. }
  2129. walk(fullpath, function (x, leaf) {
  2130. root = PathMatcher.push(x, root, leaf, fullpath);
  2131. if (x !== '/') {
  2132. root.info = root.info || Object.assign({}, routeInfo);
  2133. }
  2134. });
  2135. root.info = root.info || Object.assign({}, routeInfo);
  2136. if (key) {
  2137. root.info.key = key;
  2138. }
  2139. return fullpath;
  2140. }
  2141. function rm(path, routes, parent) {
  2142. var fullpath = merge(path, parent);
  2143. var root = routes;
  2144. var leaf = null;
  2145. var key = null;
  2146. walk(fullpath, function (x) {
  2147. if (!root) {
  2148. leaf = null;
  2149. return true;
  2150. }
  2151. if (!root.keys) {
  2152. throw new defaultExport(path, x);
  2153. }
  2154. key = x;
  2155. leaf = root;
  2156. root = root[key];
  2157. });
  2158. if (!(leaf && key)) {
  2159. throw new defaultExport(path, key);
  2160. }
  2161. if (leaf === routes) {
  2162. leaf = routes['/'];
  2163. }
  2164. if (leaf.route !== key) {
  2165. var offset = leaf.keys.indexOf(key);
  2166. if (offset === -1) {
  2167. throw new defaultExport(path, key);
  2168. }
  2169. leaf.keys.splice(offset, 1);
  2170. PathMatcher.sort(leaf);
  2171. delete leaf[key];
  2172. }
  2173. if (root.route === leaf.route) {
  2174. delete leaf.info;
  2175. }
  2176. }
  2177. var Router = function Router() {
  2178. var routes = {};
  2179. var stack = [];
  2180. return {
  2181. resolve: function (path, cb) {
  2182. var url = path.split('?')[0];
  2183. var seen = [];
  2184. walk(url, function (x, leaf, extra) {
  2185. try {
  2186. cb(null, find(leaf, routes, 1).filter(function (r) {
  2187. if (!seen.includes(r.route)) {
  2188. seen.push(r.route);
  2189. return true;
  2190. }
  2191. return false;
  2192. }));
  2193. } catch (e) {
  2194. cb(e, []);
  2195. }
  2196. });
  2197. },
  2198. mount: function (path, cb) {
  2199. if (path !== '/') {
  2200. stack.push(path);
  2201. }
  2202. cb();
  2203. stack.pop();
  2204. },
  2205. find: function (path, retries) { return find(path, routes, retries === true ? 2 : retries || 1); },
  2206. add: function (path, routeInfo) { return add(path, routes, stack.join(''), routeInfo); },
  2207. rm: function (path) { return rm(path, routes, stack.join('')); }
  2208. };
  2209. };
  2210. Router.matches = function matches (uri, path) {
  2211. return buildMatcher(uri, path).regex.test(path);
  2212. };
  2213. return Router;
  2214. }));
  2215. });
  2216. const subscriber_queue = [];
  2217. /**
  2218. * Creates a `Readable` store that allows reading by subscription.
  2219. * @param value initial value
  2220. * @param {StartStopNotifier}start start and stop notifications for subscriptions
  2221. */
  2222. function readable(value, start) {
  2223. return {
  2224. subscribe: writable(value, start).subscribe,
  2225. };
  2226. }
  2227. /**
  2228. * Create a `Writable` store that allows both updating and reading by subscription.
  2229. * @param {*=}value initial value
  2230. * @param {StartStopNotifier=}start start and stop notifications for subscriptions
  2231. */
  2232. function writable(value, start = noop) {
  2233. let stop;
  2234. const subscribers = [];
  2235. function set(new_value) {
  2236. if (safe_not_equal(value, new_value)) {
  2237. value = new_value;
  2238. if (stop) { // store is ready
  2239. const run_queue = !subscriber_queue.length;
  2240. for (let i = 0; i < subscribers.length; i += 1) {
  2241. const s = subscribers[i];
  2242. s[1]();
  2243. subscriber_queue.push(s, value);
  2244. }
  2245. if (run_queue) {
  2246. for (let i = 0; i < subscriber_queue.length; i += 2) {
  2247. subscriber_queue[i][0](subscriber_queue[i + 1]);
  2248. }
  2249. subscriber_queue.length = 0;
  2250. }
  2251. }
  2252. }
  2253. }
  2254. function update(fn) {
  2255. set(fn(value));
  2256. }
  2257. function subscribe(run, invalidate = noop) {
  2258. const subscriber = [run, invalidate];
  2259. subscribers.push(subscriber);
  2260. if (subscribers.length === 1) {
  2261. stop = start(set) || noop;
  2262. }
  2263. run(value);
  2264. return () => {
  2265. const index = subscribers.indexOf(subscriber);
  2266. if (index !== -1) {
  2267. subscribers.splice(index, 1);
  2268. }
  2269. if (subscribers.length === 0) {
  2270. stop();
  2271. stop = null;
  2272. }
  2273. };
  2274. }
  2275. return { set, update, subscribe };
  2276. }
  2277. function derived(stores, fn, initial_value) {
  2278. const single = !Array.isArray(stores);
  2279. const stores_array = single
  2280. ? [stores]
  2281. : stores;
  2282. const auto = fn.length < 2;
  2283. return readable(initial_value, (set) => {
  2284. let inited = false;
  2285. const values = [];
  2286. let pending = 0;
  2287. let cleanup = noop;
  2288. const sync = () => {
  2289. if (pending) {
  2290. return;
  2291. }
  2292. cleanup();
  2293. const result = fn(single ? values[0] : values, set);
  2294. if (auto) {
  2295. set(result);
  2296. }
  2297. else {
  2298. cleanup = is_function(result) ? result : noop;
  2299. }
  2300. };
  2301. const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {
  2302. values[i] = value;
  2303. pending &= ~(1 << i);
  2304. if (inited) {
  2305. sync();
  2306. }
  2307. }, () => {
  2308. pending |= (1 << i);
  2309. }));
  2310. inited = true;
  2311. sync();
  2312. return function stop() {
  2313. run_all(unsubscribers);
  2314. cleanup();
  2315. };
  2316. });
  2317. }
  2318. const cache = {};
  2319. const baseTag = document.getElementsByTagName('base');
  2320. const basePrefix = (baseTag[0] && baseTag[0].href.replace(/\/$/, '')) || '/';
  2321. const ROOT_URL = basePrefix.replace(window.location.origin, '');
  2322. const router = writable({
  2323. path: '/',
  2324. query: {},
  2325. params: {},
  2326. });
  2327. const CTX_ROUTER = {};
  2328. const CTX_ROUTE = {};
  2329. // use location.hash on embedded pages, e.g. Svelte REPL
  2330. let HASHCHANGE = window.location.origin === 'null';
  2331. function hashchangeEnable(value) {
  2332. if (typeof value === 'boolean') {
  2333. HASHCHANGE = !!value;
  2334. }
  2335. return HASHCHANGE;
  2336. }
  2337. function fixedLocation(path, callback) {
  2338. const baseUri = hashchangeEnable() ? window.location.hash.replace('#', '') : window.location.pathname;
  2339. // this will rebase anchors to avoid location changes
  2340. if (path.charAt() !== '/') {
  2341. path = baseUri + path;
  2342. }
  2343. const currentURL = baseUri + window.location.hash + window.location.search;
  2344. // do not change location et all...
  2345. if (currentURL !== path) {
  2346. callback(path);
  2347. }
  2348. }
  2349. function navigateTo(path, options) {
  2350. const {
  2351. reload, replace,
  2352. params, queryParams,
  2353. } = options || {};
  2354. // If path empty or no string, throws error
  2355. if (!path || typeof path !== 'string' || (path[0] !== '/' && path[0] !== '#')) {
  2356. throw new Error(`Expecting '/${path}' or '#${path}', given '${path}'`);
  2357. }
  2358. if (params) {
  2359. path = path.replace(/:([a-zA-Z][a-zA-Z0-9_-]*)/g, (_, key) => params[key]);
  2360. }
  2361. // rebase active URL
  2362. if (ROOT_URL !== '/' && path.indexOf(ROOT_URL) !== 0) {
  2363. path = ROOT_URL + path;
  2364. }
  2365. if (queryParams) {
  2366. const qs = queryString.stringify(queryParams);
  2367. if (qs) {
  2368. path += `?${qs}`;
  2369. }
  2370. }
  2371. if (hashchangeEnable()) {
  2372. window.location.hash = path.replace(/^#/, '');
  2373. return;
  2374. }
  2375. // If no History API support, fallbacks to URL redirect
  2376. if (reload || !window.history.pushState || !window.dispatchEvent) {
  2377. window.location.href = path;
  2378. return;
  2379. }
  2380. // If has History API support, uses it
  2381. fixedLocation(path, nextURL => {
  2382. window.history[replace ? 'replaceState' : 'pushState'](null, '', nextURL);
  2383. window.dispatchEvent(new Event('popstate'));
  2384. });
  2385. }
  2386. function getProps(given, required) {
  2387. const { props: sub, ...others } = given;
  2388. // prune all declared props from this component
  2389. required = !Array.isArray(required)
  2390. ? Object.keys(required)
  2391. : required;
  2392. required.forEach(k => {
  2393. delete others[k];
  2394. });
  2395. return {
  2396. ...sub,
  2397. ...others,
  2398. };
  2399. }
  2400. function isActive(uri, path, exact) {
  2401. if (!cache[[uri, path, exact]]) {
  2402. if (exact !== true && path.indexOf(uri) === 0) {
  2403. cache[[uri, path, exact]] = /^[#/?]?$/.test(path.substr(uri.length, 1));
  2404. } else if (uri.includes('*') || uri.includes(':')) {
  2405. cache[[uri, path, exact]] = index_umd.matches(uri, path);
  2406. } else {
  2407. cache[[uri, path, exact]] = path === uri;
  2408. }
  2409. }
  2410. return cache[[uri, path, exact]];
  2411. }
  2412. const baseRouter = new index_umd();
  2413. const routeInfo = writable({});
  2414. // private registries
  2415. const onError = {};
  2416. const shared = {};
  2417. let errors = [];
  2418. let routers = 0;
  2419. let interval;
  2420. // take snapshot from current state...
  2421. router.subscribe(value => { shared.router = value; });
  2422. routeInfo.subscribe(value => { shared.routeInfo = value; });
  2423. function doFallback(failure, fallback) {
  2424. routeInfo.update(defaults => ({
  2425. ...defaults,
  2426. [fallback]: {
  2427. ...shared.router,
  2428. failure,
  2429. },
  2430. }));
  2431. }
  2432. function handleRoutes(map, params) {
  2433. const keys = [];
  2434. map.some(x => {
  2435. if (x.key && x.matches && !x.fallback && !shared.routeInfo[x.key]) {
  2436. if (x.redirect && (x.condition === null || x.condition(shared.router) !== true)) {
  2437. if (x.exact && shared.router.path !== x.path) return false;
  2438. navigateTo(x.redirect);
  2439. return true;
  2440. }
  2441. if (x.exact) {
  2442. keys.push(x.key);
  2443. }
  2444. // extend shared params...
  2445. Object.assign(params, x.params);
  2446. // upgrade matching routes!
  2447. routeInfo.update(defaults => ({
  2448. ...defaults,
  2449. [x.key]: {
  2450. ...shared.router,
  2451. ...x,
  2452. },
  2453. }));
  2454. }
  2455. return false;
  2456. });
  2457. return keys;
  2458. }
  2459. function evtHandler() {
  2460. let baseUri = !hashchangeEnable() ? window.location.href.replace(window.location.origin, '') : window.location.hash || '/';
  2461. let failure;
  2462. // unprefix active URL
  2463. if (ROOT_URL !== '/') {
  2464. baseUri = baseUri.replace(ROOT_URL, '');
  2465. }
  2466. const [fullpath, qs] = baseUri.replace('/#', '#').replace(/^#\//, '/').split('?');
  2467. const query = queryString.parse(qs);
  2468. const params = {};
  2469. const keys = [];
  2470. // reset current state
  2471. routeInfo.set({});
  2472. router.set({
  2473. query,
  2474. params,
  2475. path: fullpath,
  2476. });
  2477. // load all matching routes...
  2478. baseRouter.resolve(fullpath, (err, result) => {
  2479. if (err) {
  2480. failure = err;
  2481. return;
  2482. }
  2483. // save exact-keys for deletion after failures!
  2484. keys.push(...handleRoutes(result, params));
  2485. });
  2486. const toDelete = {};
  2487. if (failure) {
  2488. keys.reduce((prev, cur) => {
  2489. prev[cur] = null;
  2490. return prev;
  2491. }, toDelete);
  2492. }
  2493. // clear previously failed handlers
  2494. errors.forEach(cb => cb());
  2495. errors = [];
  2496. try {
  2497. // clear routes that not longer matches!
  2498. baseRouter.find(fullpath).forEach(sub => {
  2499. if (sub.exact && !sub.matches) {
  2500. toDelete[sub.key] = null;
  2501. }
  2502. });
  2503. } catch (e) {
  2504. // this is fine
  2505. }
  2506. // drop unwanted routes...
  2507. routeInfo.update(defaults => ({
  2508. ...defaults,
  2509. ...toDelete,
  2510. }));
  2511. let fallback;
  2512. // invoke error-handlers to clear out previous state!
  2513. Object.keys(onError).forEach(root => {
  2514. if (isActive(root, fullpath, false)) {
  2515. const fn = onError[root].callback;
  2516. fn(failure);
  2517. errors.push(fn);
  2518. }
  2519. if (!fallback && onError[root].fallback) {
  2520. fallback = onError[root].fallback;
  2521. }
  2522. });
  2523. // handle unmatched fallbacks
  2524. if (failure && fallback) {
  2525. doFallback(failure, fallback);
  2526. }
  2527. }
  2528. function findRoutes() {
  2529. clearTimeout(interval);
  2530. interval = setTimeout(evtHandler);
  2531. }
  2532. function addRouter(root, fallback, callback) {
  2533. if (!routers) {
  2534. window.addEventListener('popstate', findRoutes, false);
  2535. }
  2536. // register error-handlers
  2537. onError[root] = { fallback, callback };
  2538. routers += 1;
  2539. return () => {
  2540. delete onError[root];
  2541. routers -= 1;
  2542. if (!routers) {
  2543. window.removeEventListener('popstate', findRoutes, false);
  2544. }
  2545. };
  2546. }
  2547. /* usr/local/lib/node_modules/snowboard/node_modules/yrv/src/Router.svelte generated by Svelte v3.19.2 */
  2548. function add_css() {
  2549. var style = element("style");
  2550. style.id = "svelte-kx2cky-style";
  2551. style.textContent = "[data-failure].svelte-kx2cky{border:1px dashed silver}";
  2552. append(document.head, style);
  2553. }
  2554. // (99:0) {#if !disabled}
  2555. function create_if_block_1(ctx) {
  2556. let current;
  2557. const default_slot_template = /*$$slots*/ ctx[15].default;
  2558. const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[14], null);
  2559. return {
  2560. c() {
  2561. if (default_slot) default_slot.c();
  2562. },
  2563. m(target, anchor) {
  2564. if (default_slot) {
  2565. default_slot.m(target, anchor);
  2566. }
  2567. current = true;
  2568. },
  2569. p(ctx, dirty) {
  2570. if (default_slot && default_slot.p && dirty & /*$$scope*/ 16384) {
  2571. default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[14], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[14], dirty, null));
  2572. }
  2573. },
  2574. i(local) {
  2575. if (current) return;
  2576. transition_in(default_slot, local);
  2577. current = true;
  2578. },
  2579. o(local) {
  2580. transition_out(default_slot, local);
  2581. current = false;
  2582. },
  2583. d(detaching) {
  2584. if (default_slot) default_slot.d(detaching);
  2585. }
  2586. };
  2587. }
  2588. // (103:0) {#if failure && !fallback && !nofallback}
  2589. function create_if_block(ctx) {
  2590. let fieldset;
  2591. let legend;
  2592. let t0;
  2593. let t1;
  2594. let t2;
  2595. let pre;
  2596. let t3;
  2597. return {
  2598. c() {
  2599. fieldset = element("fieldset");
  2600. legend = element("legend");
  2601. t0 = text("Router failure: ");
  2602. t1 = text(/*path*/ ctx[1]);
  2603. t2 = space();
  2604. pre = element("pre");
  2605. t3 = text(/*failure*/ ctx[3]);
  2606. attr(fieldset, "data-failure", "");
  2607. attr(fieldset, "class", "svelte-kx2cky");
  2608. },
  2609. m(target, anchor) {
  2610. insert(target, fieldset, anchor);
  2611. append(fieldset, legend);
  2612. append(legend, t0);
  2613. append(legend, t1);
  2614. append(fieldset, t2);
  2615. append(fieldset, pre);
  2616. append(pre, t3);
  2617. },
  2618. p(ctx, dirty) {
  2619. if (dirty & /*path*/ 2) set_data(t1, /*path*/ ctx[1]);
  2620. if (dirty & /*failure*/ 8) set_data(t3, /*failure*/ ctx[3]);
  2621. },
  2622. d(detaching) {
  2623. if (detaching) detach(fieldset);
  2624. }
  2625. };
  2626. }
  2627. function create_fragment(ctx) {
  2628. let t;
  2629. let if_block1_anchor;
  2630. let current;
  2631. let if_block0 = !/*disabled*/ ctx[0] && create_if_block_1(ctx);
  2632. let if_block1 = /*failure*/ ctx[3] && !/*fallback*/ ctx[4] && !/*nofallback*/ ctx[2] && create_if_block(ctx);
  2633. return {
  2634. c() {
  2635. if (if_block0) if_block0.c();
  2636. t = space();
  2637. if (if_block1) if_block1.c();
  2638. if_block1_anchor = empty();
  2639. },
  2640. m(target, anchor) {
  2641. if (if_block0) if_block0.m(target, anchor);
  2642. insert(target, t, anchor);
  2643. if (if_block1) if_block1.m(target, anchor);
  2644. insert(target, if_block1_anchor, anchor);
  2645. current = true;
  2646. },
  2647. p(ctx, [dirty]) {
  2648. if (!/*disabled*/ ctx[0]) {
  2649. if (if_block0) {
  2650. if_block0.p(ctx, dirty);
  2651. transition_in(if_block0, 1);
  2652. } else {
  2653. if_block0 = create_if_block_1(ctx);
  2654. if_block0.c();
  2655. transition_in(if_block0, 1);
  2656. if_block0.m(t.parentNode, t);
  2657. }
  2658. } else if (if_block0) {
  2659. group_outros();
  2660. transition_out(if_block0, 1, 1, () => {
  2661. if_block0 = null;
  2662. });
  2663. check_outros();
  2664. }
  2665. if (/*failure*/ ctx[3] && !/*fallback*/ ctx[4] && !/*nofallback*/ ctx[2]) {
  2666. if (if_block1) {
  2667. if_block1.p(ctx, dirty);
  2668. } else {
  2669. if_block1 = create_if_block(ctx);
  2670. if_block1.c();
  2671. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  2672. }
  2673. } else if (if_block1) {
  2674. if_block1.d(1);
  2675. if_block1 = null;
  2676. }
  2677. },
  2678. i(local) {
  2679. if (current) return;
  2680. transition_in(if_block0);
  2681. current = true;
  2682. },
  2683. o(local) {
  2684. transition_out(if_block0);
  2685. current = false;
  2686. },
  2687. d(detaching) {
  2688. if (if_block0) if_block0.d(detaching);
  2689. if (detaching) detach(t);
  2690. if (if_block1) if_block1.d(detaching);
  2691. if (detaching) detach(if_block1_anchor);
  2692. }
  2693. };
  2694. }
  2695. function unassignRoute(route) {
  2696. baseRouter.rm(route);
  2697. findRoutes();
  2698. }
  2699. function instance($$self, $$props, $$invalidate) {
  2700. let $basePath;
  2701. let $router;
  2702. component_subscribe($$self, router, $$value => $$invalidate(9, $router = $$value));
  2703. let cleanup;
  2704. let failure;
  2705. let fallback;
  2706. let { path = "/" } = $$props;
  2707. let { disabled = false } = $$props;
  2708. let { condition = null } = $$props;
  2709. let { nofallback = false } = $$props;
  2710. const routerContext = getContext(CTX_ROUTER);
  2711. const basePath = routerContext ? routerContext.basePath : writable(path);
  2712. component_subscribe($$self, basePath, value => $$invalidate(8, $basePath = value));
  2713. const fixedRoot = $basePath !== path && $basePath !== "/"
  2714. ? `${$basePath}${path !== "/" ? path : ""}`
  2715. : path;
  2716. try {
  2717. if (condition !== null && typeof condition !== "function") {
  2718. throw new TypeError(`Expecting condition to be a function, given '${condition}'`);
  2719. }
  2720. if (path.charAt() !== "#" && path.charAt() !== "/") {
  2721. throw new TypeError(`Expecting a leading slash or hash, given '${path}'`);
  2722. }
  2723. } catch(e) {
  2724. failure = e;
  2725. }
  2726. function assignRoute(key, route, detail) {
  2727. key = key || Math.random().toString(36).substr(2);
  2728. // consider as nested routes if they does not have any segment
  2729. const nested = !route.substr(1).includes("/");
  2730. const handler = { key, nested, ...detail };
  2731. let fullpath;
  2732. baseRouter.mount(fixedRoot, () => {
  2733. fullpath = baseRouter.add(route, handler);
  2734. $$invalidate(4, fallback = handler.fallback && key || fallback);
  2735. });
  2736. findRoutes();
  2737. return [key, fullpath];
  2738. }
  2739. function onError(err) {
  2740. $$invalidate(3, failure = err);
  2741. if (failure && fallback) {
  2742. doFallback(failure, fallback);
  2743. }
  2744. }
  2745. onMount(() => {
  2746. cleanup = addRouter(fixedRoot, fallback, onError);
  2747. });
  2748. onDestroy(() => {
  2749. if (cleanup) cleanup();
  2750. });
  2751. setContext(CTX_ROUTER, { basePath, assignRoute, unassignRoute });
  2752. let { $$slots = {}, $$scope } = $$props;
  2753. $$self.$set = $$props => {
  2754. if ("path" in $$props) $$invalidate(1, path = $$props.path);
  2755. if ("disabled" in $$props) $$invalidate(0, disabled = $$props.disabled);
  2756. if ("condition" in $$props) $$invalidate(6, condition = $$props.condition);
  2757. if ("nofallback" in $$props) $$invalidate(2, nofallback = $$props.nofallback);
  2758. if ("$$scope" in $$props) $$invalidate(14, $$scope = $$props.$$scope);
  2759. };
  2760. $$self.$$.update = () => {
  2761. if ($$self.$$.dirty & /*condition, $router*/ 576) {
  2762. if (condition) {
  2763. $$invalidate(0, disabled = !condition($router));
  2764. }
  2765. }
  2766. };
  2767. return [
  2768. disabled,
  2769. path,
  2770. nofallback,
  2771. failure,
  2772. fallback,
  2773. basePath,
  2774. condition,
  2775. cleanup,
  2776. $basePath,
  2777. $router,
  2778. routerContext,
  2779. fixedRoot,
  2780. assignRoute,
  2781. onError,
  2782. $$scope,
  2783. $$slots
  2784. ];
  2785. }
  2786. class Router extends SvelteComponent {
  2787. constructor(options) {
  2788. super();
  2789. if (!document.getElementById("svelte-kx2cky-style")) add_css();
  2790. init(this, options, instance, create_fragment, safe_not_equal, {
  2791. path: 1,
  2792. disabled: 0,
  2793. condition: 6,
  2794. nofallback: 2
  2795. });
  2796. }
  2797. }
  2798. /* usr/local/lib/node_modules/snowboard/node_modules/yrv/src/Route.svelte generated by Svelte v3.19.2 */
  2799. function add_css$1() {
  2800. var style = element("style");
  2801. style.id = "svelte-7lze0z-style";
  2802. style.textContent = "[data-failure].svelte-7lze0z{color:red}";
  2803. append(document.head, style);
  2804. }
  2805. const get_default_slot_changes = dirty => ({
  2806. router: dirty & /*activeRouter*/ 2,
  2807. props: dirty & /*activeProps*/ 4
  2808. });
  2809. const get_default_slot_context = ctx => ({
  2810. router: /*activeRouter*/ ctx[1],
  2811. props: /*activeProps*/ ctx[2]
  2812. });
  2813. // (82:0) {#if failure}
  2814. function create_if_block_2(ctx) {
  2815. let p;
  2816. let t;
  2817. return {
  2818. c() {
  2819. p = element("p");
  2820. t = text(/*failure*/ ctx[3]);
  2821. attr(p, "data-failure", "");
  2822. attr(p, "class", "svelte-7lze0z");
  2823. },
  2824. m(target, anchor) {
  2825. insert(target, p, anchor);
  2826. append(p, t);
  2827. },
  2828. p(ctx, dirty) {
  2829. if (dirty & /*failure*/ 8) set_data(t, /*failure*/ ctx[3]);
  2830. },
  2831. d(detaching) {
  2832. if (detaching) detach(p);
  2833. }
  2834. };
  2835. }
  2836. // (86:0) {#if activeRouter}
  2837. function create_if_block$1(ctx) {
  2838. let current_block_type_index;
  2839. let if_block;
  2840. let if_block_anchor;
  2841. let current;
  2842. const if_block_creators = [create_if_block_1$1, create_else_block];
  2843. const if_blocks = [];
  2844. function select_block_type(ctx, dirty) {
  2845. if (/*component*/ ctx[0]) return 0;
  2846. return 1;
  2847. }
  2848. current_block_type_index = select_block_type(ctx, -1);
  2849. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  2850. return {
  2851. c() {
  2852. if_block.c();
  2853. if_block_anchor = empty();
  2854. },
  2855. m(target, anchor) {
  2856. if_blocks[current_block_type_index].m(target, anchor);
  2857. insert(target, if_block_anchor, anchor);
  2858. current = true;
  2859. },
  2860. p(ctx, dirty) {
  2861. let previous_block_index = current_block_type_index;
  2862. current_block_type_index = select_block_type(ctx, dirty);
  2863. if (current_block_type_index === previous_block_index) {
  2864. if_blocks[current_block_type_index].p(ctx, dirty);
  2865. } else {
  2866. group_outros();
  2867. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  2868. if_blocks[previous_block_index] = null;
  2869. });
  2870. check_outros();
  2871. if_block = if_blocks[current_block_type_index];
  2872. if (!if_block) {
  2873. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  2874. if_block.c();
  2875. }
  2876. transition_in(if_block, 1);
  2877. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  2878. }
  2879. },
  2880. i(local) {
  2881. if (current) return;
  2882. transition_in(if_block);
  2883. current = true;
  2884. },
  2885. o(local) {
  2886. transition_out(if_block);
  2887. current = false;
  2888. },
  2889. d(detaching) {
  2890. if_blocks[current_block_type_index].d(detaching);
  2891. if (detaching) detach(if_block_anchor);
  2892. }
  2893. };
  2894. }
  2895. // (89:2) {:else}
  2896. function create_else_block(ctx) {
  2897. let current;
  2898. const default_slot_template = /*$$slots*/ ctx[22].default;
  2899. const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[21], get_default_slot_context);
  2900. return {
  2901. c() {
  2902. if (default_slot) default_slot.c();
  2903. },
  2904. m(target, anchor) {
  2905. if (default_slot) {
  2906. default_slot.m(target, anchor);
  2907. }
  2908. current = true;
  2909. },
  2910. p(ctx, dirty) {
  2911. if (default_slot && default_slot.p && dirty & /*$$scope, activeRouter, activeProps*/ 2097158) {
  2912. default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[21], get_default_slot_context), get_slot_changes(default_slot_template, /*$$scope*/ ctx[21], dirty, get_default_slot_changes));
  2913. }
  2914. },
  2915. i(local) {
  2916. if (current) return;
  2917. transition_in(default_slot, local);
  2918. current = true;
  2919. },
  2920. o(local) {
  2921. transition_out(default_slot, local);
  2922. current = false;
  2923. },
  2924. d(detaching) {
  2925. if (default_slot) default_slot.d(detaching);
  2926. }
  2927. };
  2928. }
  2929. // (87:2) {#if component}
  2930. function create_if_block_1$1(ctx) {
  2931. let switch_instance_anchor;
  2932. let current;
  2933. const switch_instance_spread_levels = [{ router: /*activeRouter*/ ctx[1] }, /*activeProps*/ ctx[2]];
  2934. var switch_value = /*component*/ ctx[0];
  2935. function switch_props(ctx) {
  2936. let switch_instance_props = {};
  2937. for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
  2938. switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
  2939. }
  2940. return { props: switch_instance_props };
  2941. }
  2942. if (switch_value) {
  2943. var switch_instance = new switch_value(switch_props(ctx));
  2944. }
  2945. return {
  2946. c() {
  2947. if (switch_instance) create_component(switch_instance.$$.fragment);
  2948. switch_instance_anchor = empty();
  2949. },
  2950. m(target, anchor) {
  2951. if (switch_instance) {
  2952. mount_component(switch_instance, target, anchor);
  2953. }
  2954. insert(target, switch_instance_anchor, anchor);
  2955. current = true;
  2956. },
  2957. p(ctx, dirty) {
  2958. const switch_instance_changes = (dirty & /*activeRouter, activeProps*/ 6)
  2959. ? get_spread_update(switch_instance_spread_levels, [
  2960. dirty & /*activeRouter*/ 2 && { router: /*activeRouter*/ ctx[1] },
  2961. dirty & /*activeProps*/ 4 && get_spread_object(/*activeProps*/ ctx[2])
  2962. ])
  2963. : {};
  2964. if (switch_value !== (switch_value = /*component*/ ctx[0])) {
  2965. if (switch_instance) {
  2966. group_outros();
  2967. const old_component = switch_instance;
  2968. transition_out(old_component.$$.fragment, 1, 0, () => {
  2969. destroy_component(old_component, 1);
  2970. });
  2971. check_outros();
  2972. }
  2973. if (switch_value) {
  2974. switch_instance = new switch_value(switch_props(ctx));
  2975. create_component(switch_instance.$$.fragment);
  2976. transition_in(switch_instance.$$.fragment, 1);
  2977. mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
  2978. } else {
  2979. switch_instance = null;
  2980. }
  2981. } else if (switch_value) {
  2982. switch_instance.$set(switch_instance_changes);
  2983. }
  2984. },
  2985. i(local) {
  2986. if (current) return;
  2987. if (switch_instance) transition_in(switch_instance.$$.fragment, local);
  2988. current = true;
  2989. },
  2990. o(local) {
  2991. if (switch_instance) transition_out(switch_instance.$$.fragment, local);
  2992. current = false;
  2993. },
  2994. d(detaching) {
  2995. if (detaching) detach(switch_instance_anchor);
  2996. if (switch_instance) destroy_component(switch_instance, detaching);
  2997. }
  2998. };
  2999. }
  3000. function create_fragment$1(ctx) {
  3001. let t;
  3002. let if_block1_anchor;
  3003. let current;
  3004. let if_block0 = /*failure*/ ctx[3] && create_if_block_2(ctx);
  3005. let if_block1 = /*activeRouter*/ ctx[1] && create_if_block$1(ctx);
  3006. return {
  3007. c() {
  3008. if (if_block0) if_block0.c();
  3009. t = space();
  3010. if (if_block1) if_block1.c();
  3011. if_block1_anchor = empty();
  3012. },
  3013. m(target, anchor) {
  3014. if (if_block0) if_block0.m(target, anchor);
  3015. insert(target, t, anchor);
  3016. if (if_block1) if_block1.m(target, anchor);
  3017. insert(target, if_block1_anchor, anchor);
  3018. current = true;
  3019. },
  3020. p(ctx, [dirty]) {
  3021. if (/*failure*/ ctx[3]) {
  3022. if (if_block0) {
  3023. if_block0.p(ctx, dirty);
  3024. } else {
  3025. if_block0 = create_if_block_2(ctx);
  3026. if_block0.c();
  3027. if_block0.m(t.parentNode, t);
  3028. }
  3029. } else if (if_block0) {
  3030. if_block0.d(1);
  3031. if_block0 = null;
  3032. }
  3033. if (/*activeRouter*/ ctx[1]) {
  3034. if (if_block1) {
  3035. if_block1.p(ctx, dirty);
  3036. transition_in(if_block1, 1);
  3037. } else {
  3038. if_block1 = create_if_block$1(ctx);
  3039. if_block1.c();
  3040. transition_in(if_block1, 1);
  3041. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  3042. }
  3043. } else if (if_block1) {
  3044. group_outros();
  3045. transition_out(if_block1, 1, 1, () => {
  3046. if_block1 = null;
  3047. });
  3048. check_outros();
  3049. }
  3050. },
  3051. i(local) {
  3052. if (current) return;
  3053. transition_in(if_block1);
  3054. current = true;
  3055. },
  3056. o(local) {
  3057. transition_out(if_block1);
  3058. current = false;
  3059. },
  3060. d(detaching) {
  3061. if (if_block0) if_block0.d(detaching);
  3062. if (detaching) detach(t);
  3063. if (if_block1) if_block1.d(detaching);
  3064. if (detaching) detach(if_block1_anchor);
  3065. }
  3066. };
  3067. }
  3068. function instance$1($$self, $$props, $$invalidate) {
  3069. let $routePath;
  3070. let $routeInfo;
  3071. component_subscribe($$self, routeInfo, $$value => $$invalidate(14, $routeInfo = $$value));
  3072. let { key = null } = $$props;
  3073. let { path = "/" } = $$props;
  3074. let { exact = null } = $$props;
  3075. let { disabled = false } = $$props;
  3076. let { fallback = null } = $$props;
  3077. let { component = null } = $$props;
  3078. let { condition = null } = $$props;
  3079. let { redirect = null } = $$props;
  3080. const routeContext = getContext(CTX_ROUTE);
  3081. const routerContext = getContext(CTX_ROUTER);
  3082. const { assignRoute, unassignRoute } = routerContext || {};
  3083. const routePath = routeContext ? routeContext.routePath : writable(path);
  3084. component_subscribe($$self, routePath, value => $$invalidate(13, $routePath = value));
  3085. let activeRouter = null;
  3086. let activeProps = {};
  3087. let fullpath;
  3088. let failure;
  3089. const fixedRoot = $routePath !== path && $routePath !== "/"
  3090. ? `${$routePath}${path !== "/" ? path : ""}`
  3091. : path;
  3092. try {
  3093. if (redirect !== null && !(/^(?:\w+:\/\/|\/)/).test(redirect)) {
  3094. throw new TypeError(`Expecting valid URL to redirect, given '${redirect}'`);
  3095. }
  3096. if (condition !== null && typeof condition !== "function") {
  3097. throw new TypeError(`Expecting condition to be a function, given '${condition}'`);
  3098. }
  3099. if (path.charAt() !== "#" && path.charAt() !== "/") {
  3100. throw new TypeError(`Expecting a leading slash or hash, given '${path}'`);
  3101. }
  3102. if (!assignRoute) {
  3103. throw new TypeError(`Missing top-level <Router>, given route: ${path}`);
  3104. }
  3105. [key, fullpath] = assignRoute(key, fixedRoot, { condition, redirect, fallback, exact });
  3106. } catch(e) {
  3107. failure = e;
  3108. }
  3109. onDestroy(() => {
  3110. if (unassignRoute) {
  3111. unassignRoute(fullpath);
  3112. }
  3113. });
  3114. setContext(CTX_ROUTE, { routePath });
  3115. let { $$slots = {}, $$scope } = $$props;
  3116. $$self.$set = $$new_props => {
  3117. $$invalidate(20, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
  3118. if ("key" in $$new_props) $$invalidate(5, key = $$new_props.key);
  3119. if ("path" in $$new_props) $$invalidate(6, path = $$new_props.path);
  3120. if ("exact" in $$new_props) $$invalidate(7, exact = $$new_props.exact);
  3121. if ("disabled" in $$new_props) $$invalidate(8, disabled = $$new_props.disabled);
  3122. if ("fallback" in $$new_props) $$invalidate(9, fallback = $$new_props.fallback);
  3123. if ("component" in $$new_props) $$invalidate(0, component = $$new_props.component);
  3124. if ("condition" in $$new_props) $$invalidate(10, condition = $$new_props.condition);
  3125. if ("redirect" in $$new_props) $$invalidate(11, redirect = $$new_props.redirect);
  3126. if ("$$scope" in $$new_props) $$invalidate(21, $$scope = $$new_props.$$scope);
  3127. };
  3128. $$self.$$.update = () => {
  3129. if (key) {
  3130. /* global arguments */
  3131. $$invalidate(1, activeRouter = !disabled && $routeInfo[key]);
  3132. $$invalidate(2, activeProps = getProps($$props, arguments[0].$$.props));
  3133. }
  3134. };
  3135. $$props = exclude_internal_props($$props);
  3136. return [
  3137. component,
  3138. activeRouter,
  3139. activeProps,
  3140. failure,
  3141. routePath,
  3142. key,
  3143. path,
  3144. exact,
  3145. disabled,
  3146. fallback,
  3147. condition,
  3148. redirect,
  3149. fullpath,
  3150. $routePath,
  3151. $routeInfo,
  3152. routeContext,
  3153. routerContext,
  3154. assignRoute,
  3155. unassignRoute,
  3156. fixedRoot,
  3157. $$props,
  3158. $$scope,
  3159. $$slots
  3160. ];
  3161. }
  3162. class Route extends SvelteComponent {
  3163. constructor(options) {
  3164. super();
  3165. if (!document.getElementById("svelte-7lze0z-style")) add_css$1();
  3166. init(this, options, instance$1, create_fragment$1, safe_not_equal, {
  3167. key: 5,
  3168. path: 6,
  3169. exact: 7,
  3170. disabled: 8,
  3171. fallback: 9,
  3172. component: 0,
  3173. condition: 10,
  3174. redirect: 11
  3175. });
  3176. }
  3177. }
  3178. /* usr/local/lib/node_modules/snowboard/node_modules/yrv/src/Link.svelte generated by Svelte v3.19.2 */
  3179. function create_else_block$1(ctx) {
  3180. let a;
  3181. let current;
  3182. let dispose;
  3183. const default_slot_template = /*$$slots*/ ctx[18].default;
  3184. const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[17], null);
  3185. let a_levels = [
  3186. /*fixedProps*/ ctx[5],
  3187. { href: /*fixedHref*/ ctx[4] },
  3188. { class: /*className*/ ctx[0] },
  3189. { title: /*title*/ ctx[1] }
  3190. ];
  3191. let a_data = {};
  3192. for (let i = 0; i < a_levels.length; i += 1) {
  3193. a_data = assign(a_data, a_levels[i]);
  3194. }
  3195. return {
  3196. c() {
  3197. a = element("a");
  3198. if (default_slot) default_slot.c();
  3199. set_attributes(a, a_data);
  3200. },
  3201. m(target, anchor) {
  3202. insert(target, a, anchor);
  3203. if (default_slot) {
  3204. default_slot.m(a, null);
  3205. }
  3206. /*a_binding*/ ctx[20](a);
  3207. current = true;
  3208. dispose = listen(a, "click", prevent_default(/*onClick*/ ctx[6]));
  3209. },
  3210. p(ctx, dirty) {
  3211. if (default_slot && default_slot.p && dirty & /*$$scope*/ 131072) {
  3212. default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[17], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[17], dirty, null));
  3213. }
  3214. set_attributes(a, get_spread_update(a_levels, [
  3215. dirty & /*fixedProps*/ 32 && /*fixedProps*/ ctx[5],
  3216. dirty & /*fixedHref*/ 16 && { href: /*fixedHref*/ ctx[4] },
  3217. dirty & /*className*/ 1 && { class: /*className*/ ctx[0] },
  3218. dirty & /*title*/ 2 && { title: /*title*/ ctx[1] }
  3219. ]));
  3220. },
  3221. i(local) {
  3222. if (current) return;
  3223. transition_in(default_slot, local);
  3224. current = true;
  3225. },
  3226. o(local) {
  3227. transition_out(default_slot, local);
  3228. current = false;
  3229. },
  3230. d(detaching) {
  3231. if (detaching) detach(a);
  3232. if (default_slot) default_slot.d(detaching);
  3233. /*a_binding*/ ctx[20](null);
  3234. dispose();
  3235. }
  3236. };
  3237. }
  3238. // (73:0) {#if button}
  3239. function create_if_block$2(ctx) {
  3240. let button_1;
  3241. let current;
  3242. let dispose;
  3243. const default_slot_template = /*$$slots*/ ctx[18].default;
  3244. const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[17], null);
  3245. let button_1_levels = [
  3246. /*fixedProps*/ ctx[5],
  3247. { class: /*className*/ ctx[0] },
  3248. { title: /*title*/ ctx[1] }
  3249. ];
  3250. let button_1_data = {};
  3251. for (let i = 0; i < button_1_levels.length; i += 1) {
  3252. button_1_data = assign(button_1_data, button_1_levels[i]);
  3253. }
  3254. return {
  3255. c() {
  3256. button_1 = element("button");
  3257. if (default_slot) default_slot.c();
  3258. set_attributes(button_1, button_1_data);
  3259. },
  3260. m(target, anchor) {
  3261. insert(target, button_1, anchor);
  3262. if (default_slot) {
  3263. default_slot.m(button_1, null);
  3264. }
  3265. /*button_1_binding*/ ctx[19](button_1);
  3266. current = true;
  3267. dispose = listen(button_1, "click", prevent_default(/*onClick*/ ctx[6]));
  3268. },
  3269. p(ctx, dirty) {
  3270. if (default_slot && default_slot.p && dirty & /*$$scope*/ 131072) {
  3271. default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[17], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[17], dirty, null));
  3272. }
  3273. set_attributes(button_1, get_spread_update(button_1_levels, [
  3274. dirty & /*fixedProps*/ 32 && /*fixedProps*/ ctx[5],
  3275. dirty & /*className*/ 1 && { class: /*className*/ ctx[0] },
  3276. dirty & /*title*/ 2 && { title: /*title*/ ctx[1] }
  3277. ]));
  3278. },
  3279. i(local) {
  3280. if (current) return;
  3281. transition_in(default_slot, local);
  3282. current = true;
  3283. },
  3284. o(local) {
  3285. transition_out(default_slot, local);
  3286. current = false;
  3287. },
  3288. d(detaching) {
  3289. if (detaching) detach(button_1);
  3290. if (default_slot) default_slot.d(detaching);
  3291. /*button_1_binding*/ ctx[19](null);
  3292. dispose();
  3293. }
  3294. };
  3295. }
  3296. function create_fragment$2(ctx) {
  3297. let current_block_type_index;
  3298. let if_block;
  3299. let if_block_anchor;
  3300. let current;
  3301. const if_block_creators = [create_if_block$2, create_else_block$1];
  3302. const if_blocks = [];
  3303. function select_block_type(ctx, dirty) {
  3304. if (/*button*/ ctx[2]) return 0;
  3305. return 1;
  3306. }
  3307. current_block_type_index = select_block_type(ctx, -1);
  3308. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  3309. return {
  3310. c() {
  3311. if_block.c();
  3312. if_block_anchor = empty();
  3313. },
  3314. m(target, anchor) {
  3315. if_blocks[current_block_type_index].m(target, anchor);
  3316. insert(target, if_block_anchor, anchor);
  3317. current = true;
  3318. },
  3319. p(ctx, [dirty]) {
  3320. let previous_block_index = current_block_type_index;
  3321. current_block_type_index = select_block_type(ctx, dirty);
  3322. if (current_block_type_index === previous_block_index) {
  3323. if_blocks[current_block_type_index].p(ctx, dirty);
  3324. } else {
  3325. group_outros();
  3326. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  3327. if_blocks[previous_block_index] = null;
  3328. });
  3329. check_outros();
  3330. if_block = if_blocks[current_block_type_index];
  3331. if (!if_block) {
  3332. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  3333. if_block.c();
  3334. }
  3335. transition_in(if_block, 1);
  3336. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  3337. }
  3338. },
  3339. i(local) {
  3340. if (current) return;
  3341. transition_in(if_block);
  3342. current = true;
  3343. },
  3344. o(local) {
  3345. transition_out(if_block);
  3346. current = false;
  3347. },
  3348. d(detaching) {
  3349. if_blocks[current_block_type_index].d(detaching);
  3350. if (detaching) detach(if_block_anchor);
  3351. }
  3352. };
  3353. }
  3354. function instance$2($$self, $$props, $$invalidate) {
  3355. let $router;
  3356. component_subscribe($$self, router, $$value => $$invalidate(14, $router = $$value));
  3357. let ref;
  3358. let active;
  3359. let { class: cssClass = "" } = $$props;
  3360. let fixedHref = null;
  3361. let { go = null } = $$props;
  3362. let { href = "/" } = $$props;
  3363. let { title = "" } = $$props;
  3364. let { button = false } = $$props;
  3365. let { exact = false } = $$props;
  3366. let { reload = false } = $$props;
  3367. let { replace = false } = $$props;
  3368. let { className = "" } = $$props;
  3369. onMount(() => {
  3370. $$invalidate(0, className = className || cssClass);
  3371. });
  3372. const dispatch = createEventDispatcher();
  3373. // this will enable `<Link on:click={...} />` calls
  3374. function onClick(e) {
  3375. if (typeof go === "string" && window.history.length > 1) {
  3376. if (go === "back") window.history.back(); else if (go === "fwd") window.history.forward(); else window.history.go(parseInt(go, 10));
  3377. return;
  3378. }
  3379. fixedLocation(href, nextURL => {
  3380. navigateTo(nextURL, { reload, replace });
  3381. dispatch("click", e);
  3382. });
  3383. }
  3384. let { $$slots = {}, $$scope } = $$props;
  3385. function button_1_binding($$value) {
  3386. binding_callbacks[$$value ? "unshift" : "push"](() => {
  3387. $$invalidate(3, ref = $$value);
  3388. });
  3389. }
  3390. function a_binding($$value) {
  3391. binding_callbacks[$$value ? "unshift" : "push"](() => {
  3392. $$invalidate(3, ref = $$value);
  3393. });
  3394. }
  3395. $$self.$set = $$new_props => {
  3396. $$invalidate(16, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
  3397. if ("class" in $$new_props) $$invalidate(7, cssClass = $$new_props.class);
  3398. if ("go" in $$new_props) $$invalidate(8, go = $$new_props.go);
  3399. if ("href" in $$new_props) $$invalidate(9, href = $$new_props.href);
  3400. if ("title" in $$new_props) $$invalidate(1, title = $$new_props.title);
  3401. if ("button" in $$new_props) $$invalidate(2, button = $$new_props.button);
  3402. if ("exact" in $$new_props) $$invalidate(10, exact = $$new_props.exact);
  3403. if ("reload" in $$new_props) $$invalidate(11, reload = $$new_props.reload);
  3404. if ("replace" in $$new_props) $$invalidate(12, replace = $$new_props.replace);
  3405. if ("className" in $$new_props) $$invalidate(0, className = $$new_props.className);
  3406. if ("$$scope" in $$new_props) $$invalidate(17, $$scope = $$new_props.$$scope);
  3407. };
  3408. let fixedProps;
  3409. $$self.$$.update = () => {
  3410. if ($$self.$$.dirty & /*href*/ 512) {
  3411. // rebase active URL
  3412. if (ROOT_URL !== "/") {
  3413. $$invalidate(4, fixedHref = ROOT_URL + href);
  3414. } else {
  3415. $$invalidate(4, fixedHref = href);
  3416. }
  3417. }
  3418. if ($$self.$$.dirty & /*ref, $router, href, exact, active, button*/ 26124) {
  3419. if (ref && $router.path) {
  3420. if (isActive(href, $router.path, exact)) {
  3421. if (!active) {
  3422. $$invalidate(13, active = true);
  3423. ref.setAttribute("aria-current", "page");
  3424. if (button) {
  3425. ref.setAttribute("disabled", true);
  3426. }
  3427. }
  3428. } else if (active) {
  3429. $$invalidate(13, active = false);
  3430. ref.removeAttribute("disabled");
  3431. ref.removeAttribute("aria-current");
  3432. }
  3433. }
  3434. }
  3435. // extract additional props
  3436. /* global arguments */
  3437. $$invalidate(5, fixedProps = getProps($$props, arguments[0].$$.props));
  3438. };
  3439. $$props = exclude_internal_props($$props);
  3440. return [
  3441. className,
  3442. title,
  3443. button,
  3444. ref,
  3445. fixedHref,
  3446. fixedProps,
  3447. onClick,
  3448. cssClass,
  3449. go,
  3450. href,
  3451. exact,
  3452. reload,
  3453. replace,
  3454. active,
  3455. $router,
  3456. dispatch,
  3457. $$props,
  3458. $$scope,
  3459. $$slots,
  3460. button_1_binding,
  3461. a_binding
  3462. ];
  3463. }
  3464. class Link extends SvelteComponent {
  3465. constructor(options) {
  3466. super();
  3467. init(this, options, instance$2, create_fragment$2, safe_not_equal, {
  3468. class: 7,
  3469. go: 8,
  3470. href: 9,
  3471. title: 1,
  3472. button: 2,
  3473. exact: 10,
  3474. reload: 11,
  3475. replace: 12,
  3476. className: 0
  3477. });
  3478. }
  3479. }
  3480. Object.defineProperty(Router, 'hashchange', {
  3481. set: value => hashchangeEnable(value),
  3482. get: () => hashchangeEnable(),
  3483. configurable: false,
  3484. enumerable: false,
  3485. });
  3486. 'use strict';
  3487. var has = Object.prototype.hasOwnProperty
  3488. , undef;
  3489. /**
  3490. * Decode a URI encoded string.
  3491. *
  3492. * @param {String} input The URI encoded string.
  3493. * @returns {String|Null} The decoded string.
  3494. * @api private
  3495. */
  3496. function decode$1(input) {
  3497. try {
  3498. return decodeURIComponent(input.replace(/\+/g, ' '));
  3499. } catch (e) {
  3500. return null;
  3501. }
  3502. }
  3503. /**
  3504. * Attempts to encode a given input.
  3505. *
  3506. * @param {String} input The string that needs to be encoded.
  3507. * @returns {String|Null} The encoded string.
  3508. * @api private
  3509. */
  3510. function encode(input) {
  3511. try {
  3512. return encodeURIComponent(input);
  3513. } catch (e) {
  3514. return null;
  3515. }
  3516. }
  3517. /**
  3518. * Simple query string parser.
  3519. *
  3520. * @param {String} query The query string that needs to be parsed.
  3521. * @returns {Object}
  3522. * @api public
  3523. */
  3524. function querystring(query) {
  3525. var parser = /([^=?&]+)=?([^&]*)/g
  3526. , result = {}
  3527. , part;
  3528. while (part = parser.exec(query)) {
  3529. var key = decode$1(part[1])
  3530. , value = decode$1(part[2]);
  3531. //
  3532. // Prevent overriding of existing properties. This ensures that build-in
  3533. // methods like `toString` or __proto__ are not overriden by malicious
  3534. // querystrings.
  3535. //
  3536. // In the case if failed decoding, we want to omit the key/value pairs
  3537. // from the result.
  3538. //
  3539. if (key === null || value === null || key in result) continue;
  3540. result[key] = value;
  3541. }
  3542. return result;
  3543. }
  3544. /**
  3545. * Transform a query string to an object.
  3546. *
  3547. * @param {Object} obj Object that should be transformed.
  3548. * @param {String} prefix Optional prefix.
  3549. * @returns {String}
  3550. * @api public
  3551. */
  3552. function querystringify(obj, prefix) {
  3553. prefix = prefix || '';
  3554. var pairs = []
  3555. , value
  3556. , key;
  3557. //
  3558. // Optionally prefix with a '?' if needed
  3559. //
  3560. if ('string' !== typeof prefix) prefix = '?';
  3561. for (key in obj) {
  3562. if (has.call(obj, key)) {
  3563. value = obj[key];
  3564. //
  3565. // Edge cases where we actually want to encode the value to an empty
  3566. // string instead of the stringified value.
  3567. //
  3568. if (!value && (value === null || value === undef || isNaN(value))) {
  3569. value = '';
  3570. }
  3571. key = encodeURIComponent(key);
  3572. value = encodeURIComponent(value);
  3573. //
  3574. // If we failed to encode the strings, we should bail out as we don't
  3575. // want to add invalid strings to the query.
  3576. //
  3577. if (key === null || value === null) continue;
  3578. pairs.push(key +'='+ value);
  3579. }
  3580. }
  3581. return pairs.length ? prefix + pairs.join('&') : '';
  3582. }
  3583. //
  3584. // Expose the module.
  3585. //
  3586. var stringify = querystringify;
  3587. var parse = querystring;
  3588. var querystringify_1 = {
  3589. stringify: stringify,
  3590. parse: parse
  3591. };
  3592. var prism = createCommonjsModule(function (module) {
  3593. /* **********************************************
  3594. Begin prism-core.js
  3595. ********************************************** */
  3596. var _self = (typeof window !== 'undefined')
  3597. ? window // if in browser
  3598. : (
  3599. (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
  3600. ? self // if in worker
  3601. : {} // if in node js
  3602. );
  3603. /**
  3604. * Prism: Lightweight, robust, elegant syntax highlighting
  3605. * MIT license http://www.opensource.org/licenses/mit-license.php/
  3606. * @author Lea Verou http://lea.verou.me
  3607. */
  3608. var Prism = (function (_self){
  3609. // Private helper vars
  3610. var lang = /\blang(?:uage)?-([\w-]+)\b/i;
  3611. var uniqueId = 0;
  3612. var _ = {
  3613. manual: _self.Prism && _self.Prism.manual,
  3614. disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
  3615. util: {
  3616. encode: function (tokens) {
  3617. if (tokens instanceof Token) {
  3618. return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
  3619. } else if (Array.isArray(tokens)) {
  3620. return tokens.map(_.util.encode);
  3621. } else {
  3622. return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
  3623. }
  3624. },
  3625. type: function (o) {
  3626. return Object.prototype.toString.call(o).slice(8, -1);
  3627. },
  3628. objId: function (obj) {
  3629. if (!obj['__id']) {
  3630. Object.defineProperty(obj, '__id', { value: ++uniqueId });
  3631. }
  3632. return obj['__id'];
  3633. },
  3634. // Deep clone a language definition (e.g. to extend it)
  3635. clone: function deepClone(o, visited) {
  3636. var clone, id, type = _.util.type(o);
  3637. visited = visited || {};
  3638. switch (type) {
  3639. case 'Object':
  3640. id = _.util.objId(o);
  3641. if (visited[id]) {
  3642. return visited[id];
  3643. }
  3644. clone = {};
  3645. visited[id] = clone;
  3646. for (var key in o) {
  3647. if (o.hasOwnProperty(key)) {
  3648. clone[key] = deepClone(o[key], visited);
  3649. }
  3650. }
  3651. return clone;
  3652. case 'Array':
  3653. id = _.util.objId(o);
  3654. if (visited[id]) {
  3655. return visited[id];
  3656. }
  3657. clone = [];
  3658. visited[id] = clone;
  3659. o.forEach(function (v, i) {
  3660. clone[i] = deepClone(v, visited);
  3661. });
  3662. return clone;
  3663. default:
  3664. return o;
  3665. }
  3666. },
  3667. /**
  3668. * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
  3669. *
  3670. * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
  3671. *
  3672. * @param {Element} element
  3673. * @returns {string}
  3674. */
  3675. getLanguage: function (element) {
  3676. while (element && !lang.test(element.className)) {
  3677. element = element.parentElement;
  3678. }
  3679. if (element) {
  3680. return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
  3681. }
  3682. return 'none';
  3683. },
  3684. /**
  3685. * Returns the script element that is currently executing.
  3686. *
  3687. * This does __not__ work for line script element.
  3688. *
  3689. * @returns {HTMLScriptElement | null}
  3690. */
  3691. currentScript: function () {
  3692. if (typeof document === 'undefined') {
  3693. return null;
  3694. }
  3695. if ('currentScript' in document) {
  3696. return document.currentScript;
  3697. }
  3698. // IE11 workaround
  3699. // we'll get the src of the current script by parsing IE11's error stack trace
  3700. // this will not work for inline scripts
  3701. try {
  3702. throw new Error();
  3703. } catch (err) {
  3704. // Get file src url from stack. Specifically works with the format of stack traces in IE.
  3705. // A stack will look like this:
  3706. //
  3707. // Error
  3708. // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
  3709. // at Global code (http://localhost/components/prism-core.js:606:1)
  3710. var src = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(err.stack) || [])[1];
  3711. if (src) {
  3712. var scripts = document.getElementsByTagName('script');
  3713. for (var i in scripts) {
  3714. if (scripts[i].src == src) {
  3715. return scripts[i];
  3716. }
  3717. }
  3718. }
  3719. return null;
  3720. }
  3721. }
  3722. },
  3723. languages: {
  3724. extend: function (id, redef) {
  3725. var lang = _.util.clone(_.languages[id]);
  3726. for (var key in redef) {
  3727. lang[key] = redef[key];
  3728. }
  3729. return lang;
  3730. },
  3731. /**
  3732. * Insert a token before another token in a language literal
  3733. * As this needs to recreate the object (we cannot actually insert before keys in object literals),
  3734. * we cannot just provide an object, we need an object and a key.
  3735. * @param inside The key (or language id) of the parent
  3736. * @param before The key to insert before.
  3737. * @param insert Object with the key/value pairs to insert
  3738. * @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
  3739. */
  3740. insertBefore: function (inside, before, insert, root) {
  3741. root = root || _.languages;
  3742. var grammar = root[inside];
  3743. var ret = {};
  3744. for (var token in grammar) {
  3745. if (grammar.hasOwnProperty(token)) {
  3746. if (token == before) {
  3747. for (var newToken in insert) {
  3748. if (insert.hasOwnProperty(newToken)) {
  3749. ret[newToken] = insert[newToken];
  3750. }
  3751. }
  3752. }
  3753. // Do not insert token which also occur in insert. See #1525
  3754. if (!insert.hasOwnProperty(token)) {
  3755. ret[token] = grammar[token];
  3756. }
  3757. }
  3758. }
  3759. var old = root[inside];
  3760. root[inside] = ret;
  3761. // Update references in other language definitions
  3762. _.languages.DFS(_.languages, function(key, value) {
  3763. if (value === old && key != inside) {
  3764. this[key] = ret;
  3765. }
  3766. });
  3767. return ret;
  3768. },
  3769. // Traverse a language definition with Depth First Search
  3770. DFS: function DFS(o, callback, type, visited) {
  3771. visited = visited || {};
  3772. var objId = _.util.objId;
  3773. for (var i in o) {
  3774. if (o.hasOwnProperty(i)) {
  3775. callback.call(o, i, o[i], type || i);
  3776. var property = o[i],
  3777. propertyType = _.util.type(property);
  3778. if (propertyType === 'Object' && !visited[objId(property)]) {
  3779. visited[objId(property)] = true;
  3780. DFS(property, callback, null, visited);
  3781. }
  3782. else if (propertyType === 'Array' && !visited[objId(property)]) {
  3783. visited[objId(property)] = true;
  3784. DFS(property, callback, i, visited);
  3785. }
  3786. }
  3787. }
  3788. }
  3789. },
  3790. plugins: {},
  3791. highlightAll: function(async, callback) {
  3792. _.highlightAllUnder(document, async, callback);
  3793. },
  3794. highlightAllUnder: function(container, async, callback) {
  3795. var env = {
  3796. callback: callback,
  3797. container: container,
  3798. selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
  3799. };
  3800. _.hooks.run('before-highlightall', env);
  3801. env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
  3802. _.hooks.run('before-all-elements-highlight', env);
  3803. for (var i = 0, element; element = env.elements[i++];) {
  3804. _.highlightElement(element, async === true, env.callback);
  3805. }
  3806. },
  3807. highlightElement: function(element, async, callback) {
  3808. // Find language
  3809. var language = _.util.getLanguage(element);
  3810. var grammar = _.languages[language];
  3811. // Set language on the element, if not present
  3812. element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
  3813. // Set language on the parent, for styling
  3814. var parent = element.parentNode;
  3815. if (parent && parent.nodeName.toLowerCase() === 'pre') {
  3816. parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
  3817. }
  3818. var code = element.textContent;
  3819. var env = {
  3820. element: element,
  3821. language: language,
  3822. grammar: grammar,
  3823. code: code
  3824. };
  3825. function insertHighlightedCode(highlightedCode) {
  3826. env.highlightedCode = highlightedCode;
  3827. _.hooks.run('before-insert', env);
  3828. env.element.innerHTML = env.highlightedCode;
  3829. _.hooks.run('after-highlight', env);
  3830. _.hooks.run('complete', env);
  3831. callback && callback.call(env.element);
  3832. }
  3833. _.hooks.run('before-sanity-check', env);
  3834. if (!env.code) {
  3835. _.hooks.run('complete', env);
  3836. callback && callback.call(env.element);
  3837. return;
  3838. }
  3839. _.hooks.run('before-highlight', env);
  3840. if (!env.grammar) {
  3841. insertHighlightedCode(_.util.encode(env.code));
  3842. return;
  3843. }
  3844. if (async && _self.Worker) {
  3845. var worker = new Worker(_.filename);
  3846. worker.onmessage = function(evt) {
  3847. insertHighlightedCode(evt.data);
  3848. };
  3849. worker.postMessage(JSON.stringify({
  3850. language: env.language,
  3851. code: env.code,
  3852. immediateClose: true
  3853. }));
  3854. }
  3855. else {
  3856. insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
  3857. }
  3858. },
  3859. highlight: function (text, grammar, language) {
  3860. var env = {
  3861. code: text,
  3862. grammar: grammar,
  3863. language: language
  3864. };
  3865. _.hooks.run('before-tokenize', env);
  3866. env.tokens = _.tokenize(env.code, env.grammar);
  3867. _.hooks.run('after-tokenize', env);
  3868. return Token.stringify(_.util.encode(env.tokens), env.language);
  3869. },
  3870. matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {
  3871. for (var token in grammar) {
  3872. if (!grammar.hasOwnProperty(token) || !grammar[token]) {
  3873. continue;
  3874. }
  3875. var patterns = grammar[token];
  3876. patterns = Array.isArray(patterns) ? patterns : [patterns];
  3877. for (var j = 0; j < patterns.length; ++j) {
  3878. if (target && target == token + ',' + j) {
  3879. return;
  3880. }
  3881. var pattern = patterns[j],
  3882. inside = pattern.inside,
  3883. lookbehind = !!pattern.lookbehind,
  3884. greedy = !!pattern.greedy,
  3885. lookbehindLength = 0,
  3886. alias = pattern.alias;
  3887. if (greedy && !pattern.pattern.global) {
  3888. // Without the global flag, lastIndex won't work
  3889. var flags = pattern.pattern.toString().match(/[imsuy]*$/)[0];
  3890. pattern.pattern = RegExp(pattern.pattern.source, flags + 'g');
  3891. }
  3892. pattern = pattern.pattern || pattern;
  3893. // Don’t cache length as it changes during the loop
  3894. for (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {
  3895. var str = strarr[i];
  3896. if (strarr.length > text.length) {
  3897. // Something went terribly wrong, ABORT, ABORT!
  3898. return;
  3899. }
  3900. if (str instanceof Token) {
  3901. continue;
  3902. }
  3903. if (greedy && i != strarr.length - 1) {
  3904. pattern.lastIndex = pos;
  3905. var match = pattern.exec(text);
  3906. if (!match) {
  3907. break;
  3908. }
  3909. var from = match.index + (lookbehind && match[1] ? match[1].length : 0),
  3910. to = match.index + match[0].length,
  3911. k = i,
  3912. p = pos;
  3913. for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
  3914. p += strarr[k].length;
  3915. // Move the index i to the element in strarr that is closest to from
  3916. if (from >= p) {
  3917. ++i;
  3918. pos = p;
  3919. }
  3920. }
  3921. // If strarr[i] is a Token, then the match starts inside another Token, which is invalid
  3922. if (strarr[i] instanceof Token) {
  3923. continue;
  3924. }
  3925. // Number of tokens to delete and replace with the new match
  3926. delNum = k - i;
  3927. str = text.slice(pos, p);
  3928. match.index -= pos;
  3929. } else {
  3930. pattern.lastIndex = 0;
  3931. var match = pattern.exec(str),
  3932. delNum = 1;
  3933. }
  3934. if (!match) {
  3935. if (oneshot) {
  3936. break;
  3937. }
  3938. continue;
  3939. }
  3940. if(lookbehind) {
  3941. lookbehindLength = match[1] ? match[1].length : 0;
  3942. }
  3943. var from = match.index + lookbehindLength,
  3944. match = match[0].slice(lookbehindLength),
  3945. to = from + match.length,
  3946. before = str.slice(0, from),
  3947. after = str.slice(to);
  3948. var args = [i, delNum];
  3949. if (before) {
  3950. ++i;
  3951. pos += before.length;
  3952. args.push(before);
  3953. }
  3954. var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
  3955. args.push(wrapped);
  3956. if (after) {
  3957. args.push(after);
  3958. }
  3959. Array.prototype.splice.apply(strarr, args);
  3960. if (delNum != 1)
  3961. _.matchGrammar(text, strarr, grammar, i, pos, true, token + ',' + j);
  3962. if (oneshot)
  3963. break;
  3964. }
  3965. }
  3966. }
  3967. },
  3968. tokenize: function(text, grammar) {
  3969. var strarr = [text];
  3970. var rest = grammar.rest;
  3971. if (rest) {
  3972. for (var token in rest) {
  3973. grammar[token] = rest[token];
  3974. }
  3975. delete grammar.rest;
  3976. }
  3977. _.matchGrammar(text, strarr, grammar, 0, 0, false);
  3978. return strarr;
  3979. },
  3980. hooks: {
  3981. all: {},
  3982. add: function (name, callback) {
  3983. var hooks = _.hooks.all;
  3984. hooks[name] = hooks[name] || [];
  3985. hooks[name].push(callback);
  3986. },
  3987. run: function (name, env) {
  3988. var callbacks = _.hooks.all[name];
  3989. if (!callbacks || !callbacks.length) {
  3990. return;
  3991. }
  3992. for (var i=0, callback; callback = callbacks[i++];) {
  3993. callback(env);
  3994. }
  3995. }
  3996. },
  3997. Token: Token
  3998. };
  3999. _self.Prism = _;
  4000. function Token(type, content, alias, matchedStr, greedy) {
  4001. this.type = type;
  4002. this.content = content;
  4003. this.alias = alias;
  4004. // Copy of the full string this token was created from
  4005. this.length = (matchedStr || '').length|0;
  4006. this.greedy = !!greedy;
  4007. }
  4008. Token.stringify = function(o, language) {
  4009. if (typeof o == 'string') {
  4010. return o;
  4011. }
  4012. if (Array.isArray(o)) {
  4013. return o.map(function(element) {
  4014. return Token.stringify(element, language);
  4015. }).join('');
  4016. }
  4017. var env = {
  4018. type: o.type,
  4019. content: Token.stringify(o.content, language),
  4020. tag: 'span',
  4021. classes: ['token', o.type],
  4022. attributes: {},
  4023. language: language
  4024. };
  4025. if (o.alias) {
  4026. var aliases = Array.isArray(o.alias) ? o.alias : [o.alias];
  4027. Array.prototype.push.apply(env.classes, aliases);
  4028. }
  4029. _.hooks.run('wrap', env);
  4030. var attributes = Object.keys(env.attributes).map(function(name) {
  4031. return name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
  4032. }).join(' ');
  4033. return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
  4034. };
  4035. if (!_self.document) {
  4036. if (!_self.addEventListener) {
  4037. // in Node.js
  4038. return _;
  4039. }
  4040. if (!_.disableWorkerMessageHandler) {
  4041. // In worker
  4042. _self.addEventListener('message', function (evt) {
  4043. var message = JSON.parse(evt.data),
  4044. lang = message.language,
  4045. code = message.code,
  4046. immediateClose = message.immediateClose;
  4047. _self.postMessage(_.highlight(code, _.languages[lang], lang));
  4048. if (immediateClose) {
  4049. _self.close();
  4050. }
  4051. }, false);
  4052. }
  4053. return _;
  4054. }
  4055. //Get current script and highlight
  4056. var script = _.util.currentScript();
  4057. if (script) {
  4058. _.filename = script.src;
  4059. if (script.hasAttribute('data-manual')) {
  4060. _.manual = true;
  4061. }
  4062. }
  4063. if (!_.manual) {
  4064. function highlightAutomaticallyCallback() {
  4065. if (!_.manual) {
  4066. _.highlightAll();
  4067. }
  4068. }
  4069. // If the document state is "loading", then we'll use DOMContentLoaded.
  4070. // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
  4071. // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
  4072. // might take longer one animation frame to execute which can create a race condition where only some plugins have
  4073. // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
  4074. // See https://github.com/PrismJS/prism/issues/2102
  4075. var readyState = document.readyState;
  4076. if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
  4077. document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
  4078. } else {
  4079. if (window.requestAnimationFrame) {
  4080. window.requestAnimationFrame(highlightAutomaticallyCallback);
  4081. } else {
  4082. window.setTimeout(highlightAutomaticallyCallback, 16);
  4083. }
  4084. }
  4085. }
  4086. return _;
  4087. })(_self);
  4088. if ('object' !== 'undefined' && module.exports) {
  4089. module.exports = Prism;
  4090. }
  4091. // hack for components to work correctly in node.js
  4092. if (typeof commonjsGlobal !== 'undefined') {
  4093. commonjsGlobal.Prism = Prism;
  4094. }
  4095. /* **********************************************
  4096. Begin prism-markup.js
  4097. ********************************************** */
  4098. Prism.languages.markup = {
  4099. 'comment': /<!--[\s\S]*?-->/,
  4100. 'prolog': /<\?[\s\S]+?\?>/,
  4101. 'doctype': {
  4102. pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!<!--)[^"'\]]|"[^"]*"|'[^']*'|<!--[\s\S]*?-->)*\]\s*)?>/i,
  4103. greedy: true
  4104. },
  4105. 'cdata': /<!\[CDATA\[[\s\S]*?]]>/i,
  4106. 'tag': {
  4107. pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,
  4108. greedy: true,
  4109. inside: {
  4110. 'tag': {
  4111. pattern: /^<\/?[^\s>\/]+/i,
  4112. inside: {
  4113. 'punctuation': /^<\/?/,
  4114. 'namespace': /^[^\s>\/:]+:/
  4115. }
  4116. },
  4117. 'attr-value': {
  4118. pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,
  4119. inside: {
  4120. 'punctuation': [
  4121. /^=/,
  4122. {
  4123. pattern: /^(\s*)["']|["']$/,
  4124. lookbehind: true
  4125. }
  4126. ]
  4127. }
  4128. },
  4129. 'punctuation': /\/?>/,
  4130. 'attr-name': {
  4131. pattern: /[^\s>\/]+/,
  4132. inside: {
  4133. 'namespace': /^[^\s>\/:]+:/
  4134. }
  4135. }
  4136. }
  4137. },
  4138. 'entity': /&#?[\da-z]{1,8};/i
  4139. };
  4140. Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
  4141. Prism.languages.markup['entity'];
  4142. // Plugin to make entity title show the real entity, idea by Roman Komarov
  4143. Prism.hooks.add('wrap', function(env) {
  4144. if (env.type === 'entity') {
  4145. env.attributes['title'] = env.content.replace(/&amp;/, '&');
  4146. }
  4147. });
  4148. Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
  4149. /**
  4150. * Adds an inlined language to markup.
  4151. *
  4152. * An example of an inlined language is CSS with `<style>` tags.
  4153. *
  4154. * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
  4155. * case insensitive.
  4156. * @param {string} lang The language key.
  4157. * @example
  4158. * addInlined('style', 'css');
  4159. */
  4160. value: function addInlined(tagName, lang) {
  4161. var includedCdataInside = {};
  4162. includedCdataInside['language-' + lang] = {
  4163. pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
  4164. lookbehind: true,
  4165. inside: Prism.languages[lang]
  4166. };
  4167. includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
  4168. var inside = {
  4169. 'included-cdata': {
  4170. pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
  4171. inside: includedCdataInside
  4172. }
  4173. };
  4174. inside['language-' + lang] = {
  4175. pattern: /[\s\S]+/,
  4176. inside: Prism.languages[lang]
  4177. };
  4178. var def = {};
  4179. def[tagName] = {
  4180. pattern: RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[[\s\S]*?\]\]>\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, tagName), 'i'),
  4181. lookbehind: true,
  4182. greedy: true,
  4183. inside: inside
  4184. };
  4185. Prism.languages.insertBefore('markup', 'cdata', def);
  4186. }
  4187. });
  4188. Prism.languages.xml = Prism.languages.extend('markup', {});
  4189. Prism.languages.html = Prism.languages.markup;
  4190. Prism.languages.mathml = Prism.languages.markup;
  4191. Prism.languages.svg = Prism.languages.markup;
  4192. /* **********************************************
  4193. Begin prism-css.js
  4194. ********************************************** */
  4195. (function (Prism) {
  4196. var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
  4197. Prism.languages.css = {
  4198. 'comment': /\/\*[\s\S]*?\*\//,
  4199. 'atrule': {
  4200. pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,
  4201. inside: {
  4202. 'rule': /@[\w-]+/
  4203. // See rest below
  4204. }
  4205. },
  4206. 'url': {
  4207. pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'),
  4208. inside: {
  4209. 'function': /^url/i,
  4210. 'punctuation': /^\(|\)$/
  4211. }
  4212. },
  4213. 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'),
  4214. 'string': {
  4215. pattern: string,
  4216. greedy: true
  4217. },
  4218. 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
  4219. 'important': /!important\b/i,
  4220. 'function': /[-a-z0-9]+(?=\()/i,
  4221. 'punctuation': /[(){};:,]/
  4222. };
  4223. Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
  4224. var markup = Prism.languages.markup;
  4225. if (markup) {
  4226. markup.tag.addInlined('style', 'css');
  4227. Prism.languages.insertBefore('inside', 'attr-value', {
  4228. 'style-attr': {
  4229. pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
  4230. inside: {
  4231. 'attr-name': {
  4232. pattern: /^\s*style/i,
  4233. inside: markup.tag.inside
  4234. },
  4235. 'punctuation': /^\s*=\s*['"]|['"]\s*$/,
  4236. 'attr-value': {
  4237. pattern: /.+/i,
  4238. inside: Prism.languages.css
  4239. }
  4240. },
  4241. alias: 'language-css'
  4242. }
  4243. }, markup.tag);
  4244. }
  4245. }(Prism));
  4246. /* **********************************************
  4247. Begin prism-clike.js
  4248. ********************************************** */
  4249. Prism.languages.clike = {
  4250. 'comment': [
  4251. {
  4252. pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
  4253. lookbehind: true
  4254. },
  4255. {
  4256. pattern: /(^|[^\\:])\/\/.*/,
  4257. lookbehind: true,
  4258. greedy: true
  4259. }
  4260. ],
  4261. 'string': {
  4262. pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
  4263. greedy: true
  4264. },
  4265. 'class-name': {
  4266. pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
  4267. lookbehind: true,
  4268. inside: {
  4269. 'punctuation': /[.\\]/
  4270. }
  4271. },
  4272. 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
  4273. 'boolean': /\b(?:true|false)\b/,
  4274. 'function': /\w+(?=\()/,
  4275. 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
  4276. 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
  4277. 'punctuation': /[{}[\];(),.:]/
  4278. };
  4279. /* **********************************************
  4280. Begin prism-javascript.js
  4281. ********************************************** */
  4282. Prism.languages.javascript = Prism.languages.extend('clike', {
  4283. 'class-name': [
  4284. Prism.languages.clike['class-name'],
  4285. {
  4286. pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,
  4287. lookbehind: true
  4288. }
  4289. ],
  4290. 'keyword': [
  4291. {
  4292. pattern: /((?:^|})\s*)(?:catch|finally)\b/,
  4293. lookbehind: true
  4294. },
  4295. {
  4296. pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
  4297. lookbehind: true
  4298. },
  4299. ],
  4300. 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
  4301. // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
  4302. 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
  4303. 'operator': /--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/
  4304. });
  4305. Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
  4306. Prism.languages.insertBefore('javascript', 'keyword', {
  4307. 'regex': {
  4308. pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
  4309. lookbehind: true,
  4310. greedy: true
  4311. },
  4312. // This must be declared before keyword because we use "function" inside the look-forward
  4313. 'function-variable': {
  4314. pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,
  4315. alias: 'function'
  4316. },
  4317. 'parameter': [
  4318. {
  4319. pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,
  4320. lookbehind: true,
  4321. inside: Prism.languages.javascript
  4322. },
  4323. {
  4324. pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,
  4325. inside: Prism.languages.javascript
  4326. },
  4327. {
  4328. pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,
  4329. lookbehind: true,
  4330. inside: Prism.languages.javascript
  4331. },
  4332. {
  4333. pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
  4334. lookbehind: true,
  4335. inside: Prism.languages.javascript
  4336. }
  4337. ],
  4338. 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  4339. });
  4340. Prism.languages.insertBefore('javascript', 'string', {
  4341. 'template-string': {
  4342. pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,
  4343. greedy: true,
  4344. inside: {
  4345. 'template-punctuation': {
  4346. pattern: /^`|`$/,
  4347. alias: 'string'
  4348. },
  4349. 'interpolation': {
  4350. pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
  4351. lookbehind: true,
  4352. inside: {
  4353. 'interpolation-punctuation': {
  4354. pattern: /^\${|}$/,
  4355. alias: 'punctuation'
  4356. },
  4357. rest: Prism.languages.javascript
  4358. }
  4359. },
  4360. 'string': /[\s\S]+/
  4361. }
  4362. }
  4363. });
  4364. if (Prism.languages.markup) {
  4365. Prism.languages.markup.tag.addInlined('script', 'javascript');
  4366. }
  4367. Prism.languages.js = Prism.languages.javascript;
  4368. /* **********************************************
  4369. Begin prism-file-highlight.js
  4370. ********************************************** */
  4371. (function () {
  4372. if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {
  4373. return;
  4374. }
  4375. /**
  4376. * @param {Element} [container=document]
  4377. */
  4378. self.Prism.fileHighlight = function(container) {
  4379. container = container || document;
  4380. var Extensions = {
  4381. 'js': 'javascript',
  4382. 'py': 'python',
  4383. 'rb': 'ruby',
  4384. 'ps1': 'powershell',
  4385. 'psm1': 'powershell',
  4386. 'sh': 'bash',
  4387. 'bat': 'batch',
  4388. 'h': 'c',
  4389. 'tex': 'latex'
  4390. };
  4391. Array.prototype.slice.call(container.querySelectorAll('pre[data-src]')).forEach(function (pre) {
  4392. // ignore if already loaded
  4393. if (pre.hasAttribute('data-src-loaded')) {
  4394. return;
  4395. }
  4396. // load current
  4397. var src = pre.getAttribute('data-src');
  4398. var language, parent = pre;
  4399. var lang = /\blang(?:uage)?-([\w-]+)\b/i;
  4400. while (parent && !lang.test(parent.className)) {
  4401. parent = parent.parentNode;
  4402. }
  4403. if (parent) {
  4404. language = (pre.className.match(lang) || [, ''])[1];
  4405. }
  4406. if (!language) {
  4407. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  4408. language = Extensions[extension] || extension;
  4409. }
  4410. var code = document.createElement('code');
  4411. code.className = 'language-' + language;
  4412. pre.textContent = '';
  4413. code.textContent = 'Loading…';
  4414. pre.appendChild(code);
  4415. var xhr = new XMLHttpRequest();
  4416. xhr.open('GET', src, true);
  4417. xhr.onreadystatechange = function () {
  4418. if (xhr.readyState == 4) {
  4419. if (xhr.status < 400 && xhr.responseText) {
  4420. code.textContent = xhr.responseText;
  4421. Prism.highlightElement(code);
  4422. // mark as loaded
  4423. pre.setAttribute('data-src-loaded', '');
  4424. }
  4425. else if (xhr.status >= 400) {
  4426. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  4427. }
  4428. else {
  4429. code.textContent = '✖ Error: File does not exist or is empty';
  4430. }
  4431. }
  4432. };
  4433. xhr.send(null);
  4434. });
  4435. };
  4436. document.addEventListener('DOMContentLoaded', function () {
  4437. // execute inside handler, for dropping Event as argument
  4438. self.Prism.fileHighlight();
  4439. });
  4440. })();
  4441. });
  4442. var marked = createCommonjsModule(function (module, exports) {
  4443. /**
  4444. * marked - a markdown parser
  4445. * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed)
  4446. * https://github.com/markedjs/marked
  4447. */
  4448. ;(function(root) {
  4449. 'use strict';
  4450. /**
  4451. * Block-Level Grammar
  4452. */
  4453. var block = {
  4454. newline: /^\n+/,
  4455. code: /^( {4}[^\n]+\n*)+/,
  4456. fences: /^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
  4457. hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
  4458. heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
  4459. blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
  4460. list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
  4461. html: '^ {0,3}(?:' // optional indentation
  4462. + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
  4463. + '|comment[^\\n]*(\\n+|$)' // (2)
  4464. + '|<\\?[\\s\\S]*?\\?>\\n*' // (3)
  4465. + '|<![A-Z][\\s\\S]*?>\\n*' // (4)
  4466. + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*' // (5)
  4467. + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
  4468. + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
  4469. + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
  4470. + ')',
  4471. def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
  4472. nptable: noop,
  4473. table: noop,
  4474. lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
  4475. // regex template, placeholders will be replaced according to different paragraph
  4476. // interruption rules of commonmark and the original markdown spec:
  4477. _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
  4478. text: /^[^\n]+/
  4479. };
  4480. block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
  4481. block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
  4482. block.def = edit(block.def)
  4483. .replace('label', block._label)
  4484. .replace('title', block._title)
  4485. .getRegex();
  4486. block.bullet = /(?:[*+-]|\d{1,9}\.)/;
  4487. block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/;
  4488. block.item = edit(block.item, 'gm')
  4489. .replace(/bull/g, block.bullet)
  4490. .getRegex();
  4491. block.list = edit(block.list)
  4492. .replace(/bull/g, block.bullet)
  4493. .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
  4494. .replace('def', '\\n+(?=' + block.def.source + ')')
  4495. .getRegex();
  4496. block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
  4497. + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
  4498. + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
  4499. + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
  4500. + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
  4501. + '|track|ul';
  4502. block._comment = /<!--(?!-?>)[\s\S]*?-->/;
  4503. block.html = edit(block.html, 'i')
  4504. .replace('comment', block._comment)
  4505. .replace('tag', block._tag)
  4506. .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
  4507. .getRegex();
  4508. block.paragraph = edit(block._paragraph)
  4509. .replace('hr', block.hr)
  4510. .replace('heading', ' {0,3}#{1,6} +')
  4511. .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
  4512. .replace('blockquote', ' {0,3}>')
  4513. .replace('fences', ' {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n')
  4514. .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
  4515. .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
  4516. .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
  4517. .getRegex();
  4518. block.blockquote = edit(block.blockquote)
  4519. .replace('paragraph', block.paragraph)
  4520. .getRegex();
  4521. /**
  4522. * Normal Block Grammar
  4523. */
  4524. block.normal = merge({}, block);
  4525. /**
  4526. * GFM Block Grammar
  4527. */
  4528. block.gfm = merge({}, block.normal, {
  4529. nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,
  4530. table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
  4531. });
  4532. /**
  4533. * Pedantic grammar (original John Gruber's loose markdown specification)
  4534. */
  4535. block.pedantic = merge({}, block.normal, {
  4536. html: edit(
  4537. '^ *(?:comment *(?:\\n|\\s*$)'
  4538. + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
  4539. + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
  4540. .replace('comment', block._comment)
  4541. .replace(/tag/g, '(?!(?:'
  4542. + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
  4543. + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
  4544. + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
  4545. .getRegex(),
  4546. def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  4547. heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
  4548. fences: noop, // fences not supported
  4549. paragraph: edit(block.normal._paragraph)
  4550. .replace('hr', block.hr)
  4551. .replace('heading', ' *#{1,6} *[^\n]')
  4552. .replace('lheading', block.lheading)
  4553. .replace('blockquote', ' {0,3}>')
  4554. .replace('|fences', '')
  4555. .replace('|list', '')
  4556. .replace('|html', '')
  4557. .getRegex()
  4558. });
  4559. /**
  4560. * Block Lexer
  4561. */
  4562. function Lexer(options) {
  4563. this.tokens = [];
  4564. this.tokens.links = Object.create(null);
  4565. this.options = options || marked.defaults;
  4566. this.rules = block.normal;
  4567. if (this.options.pedantic) {
  4568. this.rules = block.pedantic;
  4569. } else if (this.options.gfm) {
  4570. this.rules = block.gfm;
  4571. }
  4572. }
  4573. /**
  4574. * Expose Block Rules
  4575. */
  4576. Lexer.rules = block;
  4577. /**
  4578. * Static Lex Method
  4579. */
  4580. Lexer.lex = function(src, options) {
  4581. var lexer = new Lexer(options);
  4582. return lexer.lex(src);
  4583. };
  4584. /**
  4585. * Preprocessing
  4586. */
  4587. Lexer.prototype.lex = function(src) {
  4588. src = src
  4589. .replace(/\r\n|\r/g, '\n')
  4590. .replace(/\t/g, ' ')
  4591. .replace(/\u00a0/g, ' ')
  4592. .replace(/\u2424/g, '\n');
  4593. return this.token(src, true);
  4594. };
  4595. /**
  4596. * Lexing
  4597. */
  4598. Lexer.prototype.token = function(src, top) {
  4599. src = src.replace(/^ +$/gm, '');
  4600. var next,
  4601. loose,
  4602. cap,
  4603. bull,
  4604. b,
  4605. item,
  4606. listStart,
  4607. listItems,
  4608. t,
  4609. space,
  4610. i,
  4611. tag,
  4612. l,
  4613. isordered,
  4614. istask,
  4615. ischecked;
  4616. while (src) {
  4617. // newline
  4618. if (cap = this.rules.newline.exec(src)) {
  4619. src = src.substring(cap[0].length);
  4620. if (cap[0].length > 1) {
  4621. this.tokens.push({
  4622. type: 'space'
  4623. });
  4624. }
  4625. }
  4626. // code
  4627. if (cap = this.rules.code.exec(src)) {
  4628. var lastToken = this.tokens[this.tokens.length - 1];
  4629. src = src.substring(cap[0].length);
  4630. // An indented code block cannot interrupt a paragraph.
  4631. if (lastToken && lastToken.type === 'paragraph') {
  4632. lastToken.text += '\n' + cap[0].trimRight();
  4633. } else {
  4634. cap = cap[0].replace(/^ {4}/gm, '');
  4635. this.tokens.push({
  4636. type: 'code',
  4637. codeBlockStyle: 'indented',
  4638. text: !this.options.pedantic
  4639. ? rtrim(cap, '\n')
  4640. : cap
  4641. });
  4642. }
  4643. continue;
  4644. }
  4645. // fences
  4646. if (cap = this.rules.fences.exec(src)) {
  4647. src = src.substring(cap[0].length);
  4648. this.tokens.push({
  4649. type: 'code',
  4650. lang: cap[2] ? cap[2].trim() : cap[2],
  4651. text: cap[3] || ''
  4652. });
  4653. continue;
  4654. }
  4655. // heading
  4656. if (cap = this.rules.heading.exec(src)) {
  4657. src = src.substring(cap[0].length);
  4658. this.tokens.push({
  4659. type: 'heading',
  4660. depth: cap[1].length,
  4661. text: cap[2]
  4662. });
  4663. continue;
  4664. }
  4665. // table no leading pipe (gfm)
  4666. if (cap = this.rules.nptable.exec(src)) {
  4667. item = {
  4668. type: 'table',
  4669. header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
  4670. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  4671. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  4672. };
  4673. if (item.header.length === item.align.length) {
  4674. src = src.substring(cap[0].length);
  4675. for (i = 0; i < item.align.length; i++) {
  4676. if (/^ *-+: *$/.test(item.align[i])) {
  4677. item.align[i] = 'right';
  4678. } else if (/^ *:-+: *$/.test(item.align[i])) {
  4679. item.align[i] = 'center';
  4680. } else if (/^ *:-+ *$/.test(item.align[i])) {
  4681. item.align[i] = 'left';
  4682. } else {
  4683. item.align[i] = null;
  4684. }
  4685. }
  4686. for (i = 0; i < item.cells.length; i++) {
  4687. item.cells[i] = splitCells(item.cells[i], item.header.length);
  4688. }
  4689. this.tokens.push(item);
  4690. continue;
  4691. }
  4692. }
  4693. // hr
  4694. if (cap = this.rules.hr.exec(src)) {
  4695. src = src.substring(cap[0].length);
  4696. this.tokens.push({
  4697. type: 'hr'
  4698. });
  4699. continue;
  4700. }
  4701. // blockquote
  4702. if (cap = this.rules.blockquote.exec(src)) {
  4703. src = src.substring(cap[0].length);
  4704. this.tokens.push({
  4705. type: 'blockquote_start'
  4706. });
  4707. cap = cap[0].replace(/^ *> ?/gm, '');
  4708. // Pass `top` to keep the current
  4709. // "toplevel" state. This is exactly
  4710. // how markdown.pl works.
  4711. this.token(cap, top);
  4712. this.tokens.push({
  4713. type: 'blockquote_end'
  4714. });
  4715. continue;
  4716. }
  4717. // list
  4718. if (cap = this.rules.list.exec(src)) {
  4719. src = src.substring(cap[0].length);
  4720. bull = cap[2];
  4721. isordered = bull.length > 1;
  4722. listStart = {
  4723. type: 'list_start',
  4724. ordered: isordered,
  4725. start: isordered ? +bull : '',
  4726. loose: false
  4727. };
  4728. this.tokens.push(listStart);
  4729. // Get each top-level item.
  4730. cap = cap[0].match(this.rules.item);
  4731. listItems = [];
  4732. next = false;
  4733. l = cap.length;
  4734. i = 0;
  4735. for (; i < l; i++) {
  4736. item = cap[i];
  4737. // Remove the list item's bullet
  4738. // so it is seen as the next token.
  4739. space = item.length;
  4740. item = item.replace(/^ *([*+-]|\d+\.) */, '');
  4741. // Outdent whatever the
  4742. // list item contains. Hacky.
  4743. if (~item.indexOf('\n ')) {
  4744. space -= item.length;
  4745. item = !this.options.pedantic
  4746. ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
  4747. : item.replace(/^ {1,4}/gm, '');
  4748. }
  4749. // Determine whether the next list item belongs here.
  4750. // Backpedal if it does not belong in this list.
  4751. if (i !== l - 1) {
  4752. b = block.bullet.exec(cap[i + 1])[0];
  4753. if (bull.length > 1 ? b.length === 1
  4754. : (b.length > 1 || (this.options.smartLists && b !== bull))) {
  4755. src = cap.slice(i + 1).join('\n') + src;
  4756. i = l - 1;
  4757. }
  4758. }
  4759. // Determine whether item is loose or not.
  4760. // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
  4761. // for discount behavior.
  4762. loose = next || /\n\n(?!\s*$)/.test(item);
  4763. if (i !== l - 1) {
  4764. next = item.charAt(item.length - 1) === '\n';
  4765. if (!loose) loose = next;
  4766. }
  4767. if (loose) {
  4768. listStart.loose = true;
  4769. }
  4770. // Check for task list items
  4771. istask = /^\[[ xX]\] /.test(item);
  4772. ischecked = undefined;
  4773. if (istask) {
  4774. ischecked = item[1] !== ' ';
  4775. item = item.replace(/^\[[ xX]\] +/, '');
  4776. }
  4777. t = {
  4778. type: 'list_item_start',
  4779. task: istask,
  4780. checked: ischecked,
  4781. loose: loose
  4782. };
  4783. listItems.push(t);
  4784. this.tokens.push(t);
  4785. // Recurse.
  4786. this.token(item, false);
  4787. this.tokens.push({
  4788. type: 'list_item_end'
  4789. });
  4790. }
  4791. if (listStart.loose) {
  4792. l = listItems.length;
  4793. i = 0;
  4794. for (; i < l; i++) {
  4795. listItems[i].loose = true;
  4796. }
  4797. }
  4798. this.tokens.push({
  4799. type: 'list_end'
  4800. });
  4801. continue;
  4802. }
  4803. // html
  4804. if (cap = this.rules.html.exec(src)) {
  4805. src = src.substring(cap[0].length);
  4806. this.tokens.push({
  4807. type: this.options.sanitize
  4808. ? 'paragraph'
  4809. : 'html',
  4810. pre: !this.options.sanitizer
  4811. && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
  4812. text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]
  4813. });
  4814. continue;
  4815. }
  4816. // def
  4817. if (top && (cap = this.rules.def.exec(src))) {
  4818. src = src.substring(cap[0].length);
  4819. if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
  4820. tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
  4821. if (!this.tokens.links[tag]) {
  4822. this.tokens.links[tag] = {
  4823. href: cap[2],
  4824. title: cap[3]
  4825. };
  4826. }
  4827. continue;
  4828. }
  4829. // table (gfm)
  4830. if (cap = this.rules.table.exec(src)) {
  4831. item = {
  4832. type: 'table',
  4833. header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
  4834. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  4835. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  4836. };
  4837. if (item.header.length === item.align.length) {
  4838. src = src.substring(cap[0].length);
  4839. for (i = 0; i < item.align.length; i++) {
  4840. if (/^ *-+: *$/.test(item.align[i])) {
  4841. item.align[i] = 'right';
  4842. } else if (/^ *:-+: *$/.test(item.align[i])) {
  4843. item.align[i] = 'center';
  4844. } else if (/^ *:-+ *$/.test(item.align[i])) {
  4845. item.align[i] = 'left';
  4846. } else {
  4847. item.align[i] = null;
  4848. }
  4849. }
  4850. for (i = 0; i < item.cells.length; i++) {
  4851. item.cells[i] = splitCells(
  4852. item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
  4853. item.header.length);
  4854. }
  4855. this.tokens.push(item);
  4856. continue;
  4857. }
  4858. }
  4859. // lheading
  4860. if (cap = this.rules.lheading.exec(src)) {
  4861. src = src.substring(cap[0].length);
  4862. this.tokens.push({
  4863. type: 'heading',
  4864. depth: cap[2].charAt(0) === '=' ? 1 : 2,
  4865. text: cap[1]
  4866. });
  4867. continue;
  4868. }
  4869. // top-level paragraph
  4870. if (top && (cap = this.rules.paragraph.exec(src))) {
  4871. src = src.substring(cap[0].length);
  4872. this.tokens.push({
  4873. type: 'paragraph',
  4874. text: cap[1].charAt(cap[1].length - 1) === '\n'
  4875. ? cap[1].slice(0, -1)
  4876. : cap[1]
  4877. });
  4878. continue;
  4879. }
  4880. // text
  4881. if (cap = this.rules.text.exec(src)) {
  4882. // Top-level should never reach here.
  4883. src = src.substring(cap[0].length);
  4884. this.tokens.push({
  4885. type: 'text',
  4886. text: cap[0]
  4887. });
  4888. continue;
  4889. }
  4890. if (src) {
  4891. throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
  4892. }
  4893. }
  4894. return this.tokens;
  4895. };
  4896. /**
  4897. * Inline-Level Grammar
  4898. */
  4899. var inline = {
  4900. escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  4901. autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
  4902. url: noop,
  4903. tag: '^comment'
  4904. + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
  4905. + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
  4906. + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
  4907. + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
  4908. + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
  4909. link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
  4910. reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
  4911. nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
  4912. strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,
  4913. em: /^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,
  4914. code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
  4915. br: /^( {2,}|\\)\n(?!\s*$)/,
  4916. del: noop,
  4917. text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/
  4918. };
  4919. // list of punctuation marks from common mark spec
  4920. // without ` and ] to workaround Rule 17 (inline code blocks/links)
  4921. inline._punctuation = '!"#$%&\'()*+,\\-./:;<=>?@\\[^_{|}~';
  4922. inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex();
  4923. inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
  4924. inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
  4925. inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
  4926. inline.autolink = edit(inline.autolink)
  4927. .replace('scheme', inline._scheme)
  4928. .replace('email', inline._email)
  4929. .getRegex();
  4930. inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
  4931. inline.tag = edit(inline.tag)
  4932. .replace('comment', block._comment)
  4933. .replace('attribute', inline._attribute)
  4934. .getRegex();
  4935. inline._label = /(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
  4936. inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;
  4937. inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
  4938. inline.link = edit(inline.link)
  4939. .replace('label', inline._label)
  4940. .replace('href', inline._href)
  4941. .replace('title', inline._title)
  4942. .getRegex();
  4943. inline.reflink = edit(inline.reflink)
  4944. .replace('label', inline._label)
  4945. .getRegex();
  4946. /**
  4947. * Normal Inline Grammar
  4948. */
  4949. inline.normal = merge({}, inline);
  4950. /**
  4951. * Pedantic Inline Grammar
  4952. */
  4953. inline.pedantic = merge({}, inline.normal, {
  4954. strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
  4955. em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,
  4956. link: edit(/^!?\[(label)\]\((.*?)\)/)
  4957. .replace('label', inline._label)
  4958. .getRegex(),
  4959. reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
  4960. .replace('label', inline._label)
  4961. .getRegex()
  4962. });
  4963. /**
  4964. * GFM Inline Grammar
  4965. */
  4966. inline.gfm = merge({}, inline.normal, {
  4967. escape: edit(inline.escape).replace('])', '~|])').getRegex(),
  4968. _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
  4969. url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
  4970. _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
  4971. del: /^~+(?=\S)([\s\S]*?\S)~+/,
  4972. text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/
  4973. });
  4974. inline.gfm.url = edit(inline.gfm.url, 'i')
  4975. .replace('email', inline.gfm._extended_email)
  4976. .getRegex();
  4977. /**
  4978. * GFM + Line Breaks Inline Grammar
  4979. */
  4980. inline.breaks = merge({}, inline.gfm, {
  4981. br: edit(inline.br).replace('{2,}', '*').getRegex(),
  4982. text: edit(inline.gfm.text)
  4983. .replace('\\b_', '\\b_| {2,}\\n')
  4984. .replace(/\{2,\}/g, '*')
  4985. .getRegex()
  4986. });
  4987. /**
  4988. * Inline Lexer & Compiler
  4989. */
  4990. function InlineLexer(links, options) {
  4991. this.options = options || marked.defaults;
  4992. this.links = links;
  4993. this.rules = inline.normal;
  4994. this.renderer = this.options.renderer || new Renderer();
  4995. this.renderer.options = this.options;
  4996. if (!this.links) {
  4997. throw new Error('Tokens array requires a `links` property.');
  4998. }
  4999. if (this.options.pedantic) {
  5000. this.rules = inline.pedantic;
  5001. } else if (this.options.gfm) {
  5002. if (this.options.breaks) {
  5003. this.rules = inline.breaks;
  5004. } else {
  5005. this.rules = inline.gfm;
  5006. }
  5007. }
  5008. }
  5009. /**
  5010. * Expose Inline Rules
  5011. */
  5012. InlineLexer.rules = inline;
  5013. /**
  5014. * Static Lexing/Compiling Method
  5015. */
  5016. InlineLexer.output = function(src, links, options) {
  5017. var inline = new InlineLexer(links, options);
  5018. return inline.output(src);
  5019. };
  5020. /**
  5021. * Lexing/Compiling
  5022. */
  5023. InlineLexer.prototype.output = function(src) {
  5024. var out = '',
  5025. link,
  5026. text,
  5027. href,
  5028. title,
  5029. cap,
  5030. prevCapZero;
  5031. while (src) {
  5032. // escape
  5033. if (cap = this.rules.escape.exec(src)) {
  5034. src = src.substring(cap[0].length);
  5035. out += escape(cap[1]);
  5036. continue;
  5037. }
  5038. // tag
  5039. if (cap = this.rules.tag.exec(src)) {
  5040. if (!this.inLink && /^<a /i.test(cap[0])) {
  5041. this.inLink = true;
  5042. } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
  5043. this.inLink = false;
  5044. }
  5045. if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  5046. this.inRawBlock = true;
  5047. } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  5048. this.inRawBlock = false;
  5049. }
  5050. src = src.substring(cap[0].length);
  5051. out += this.options.sanitize
  5052. ? this.options.sanitizer
  5053. ? this.options.sanitizer(cap[0])
  5054. : escape(cap[0])
  5055. : cap[0];
  5056. continue;
  5057. }
  5058. // link
  5059. if (cap = this.rules.link.exec(src)) {
  5060. var lastParenIndex = findClosingBracket(cap[2], '()');
  5061. if (lastParenIndex > -1) {
  5062. var linkLen = 4 + cap[1].length + lastParenIndex;
  5063. cap[2] = cap[2].substring(0, lastParenIndex);
  5064. cap[0] = cap[0].substring(0, linkLen).trim();
  5065. cap[3] = '';
  5066. }
  5067. src = src.substring(cap[0].length);
  5068. this.inLink = true;
  5069. href = cap[2];
  5070. if (this.options.pedantic) {
  5071. link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
  5072. if (link) {
  5073. href = link[1];
  5074. title = link[3];
  5075. } else {
  5076. title = '';
  5077. }
  5078. } else {
  5079. title = cap[3] ? cap[3].slice(1, -1) : '';
  5080. }
  5081. href = href.trim().replace(/^<([\s\S]*)>$/, '$1');
  5082. out += this.outputLink(cap, {
  5083. href: InlineLexer.escapes(href),
  5084. title: InlineLexer.escapes(title)
  5085. });
  5086. this.inLink = false;
  5087. continue;
  5088. }
  5089. // reflink, nolink
  5090. if ((cap = this.rules.reflink.exec(src))
  5091. || (cap = this.rules.nolink.exec(src))) {
  5092. src = src.substring(cap[0].length);
  5093. link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
  5094. link = this.links[link.toLowerCase()];
  5095. if (!link || !link.href) {
  5096. out += cap[0].charAt(0);
  5097. src = cap[0].substring(1) + src;
  5098. continue;
  5099. }
  5100. this.inLink = true;
  5101. out += this.outputLink(cap, link);
  5102. this.inLink = false;
  5103. continue;
  5104. }
  5105. // strong
  5106. if (cap = this.rules.strong.exec(src)) {
  5107. src = src.substring(cap[0].length);
  5108. out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));
  5109. continue;
  5110. }
  5111. // em
  5112. if (cap = this.rules.em.exec(src)) {
  5113. src = src.substring(cap[0].length);
  5114. out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));
  5115. continue;
  5116. }
  5117. // code
  5118. if (cap = this.rules.code.exec(src)) {
  5119. src = src.substring(cap[0].length);
  5120. out += this.renderer.codespan(escape(cap[2].trim(), true));
  5121. continue;
  5122. }
  5123. // br
  5124. if (cap = this.rules.br.exec(src)) {
  5125. src = src.substring(cap[0].length);
  5126. out += this.renderer.br();
  5127. continue;
  5128. }
  5129. // del (gfm)
  5130. if (cap = this.rules.del.exec(src)) {
  5131. src = src.substring(cap[0].length);
  5132. out += this.renderer.del(this.output(cap[1]));
  5133. continue;
  5134. }
  5135. // autolink
  5136. if (cap = this.rules.autolink.exec(src)) {
  5137. src = src.substring(cap[0].length);
  5138. if (cap[2] === '@') {
  5139. text = escape(this.mangle(cap[1]));
  5140. href = 'mailto:' + text;
  5141. } else {
  5142. text = escape(cap[1]);
  5143. href = text;
  5144. }
  5145. out += this.renderer.link(href, null, text);
  5146. continue;
  5147. }
  5148. // url (gfm)
  5149. if (!this.inLink && (cap = this.rules.url.exec(src))) {
  5150. if (cap[2] === '@') {
  5151. text = escape(cap[0]);
  5152. href = 'mailto:' + text;
  5153. } else {
  5154. // do extended autolink path validation
  5155. do {
  5156. prevCapZero = cap[0];
  5157. cap[0] = this.rules._backpedal.exec(cap[0])[0];
  5158. } while (prevCapZero !== cap[0]);
  5159. text = escape(cap[0]);
  5160. if (cap[1] === 'www.') {
  5161. href = 'http://' + text;
  5162. } else {
  5163. href = text;
  5164. }
  5165. }
  5166. src = src.substring(cap[0].length);
  5167. out += this.renderer.link(href, null, text);
  5168. continue;
  5169. }
  5170. // text
  5171. if (cap = this.rules.text.exec(src)) {
  5172. src = src.substring(cap[0].length);
  5173. if (this.inRawBlock) {
  5174. out += this.renderer.text(this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]);
  5175. } else {
  5176. out += this.renderer.text(escape(this.smartypants(cap[0])));
  5177. }
  5178. continue;
  5179. }
  5180. if (src) {
  5181. throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
  5182. }
  5183. }
  5184. return out;
  5185. };
  5186. InlineLexer.escapes = function(text) {
  5187. return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;
  5188. };
  5189. /**
  5190. * Compile Link
  5191. */
  5192. InlineLexer.prototype.outputLink = function(cap, link) {
  5193. var href = link.href,
  5194. title = link.title ? escape(link.title) : null;
  5195. return cap[0].charAt(0) !== '!'
  5196. ? this.renderer.link(href, title, this.output(cap[1]))
  5197. : this.renderer.image(href, title, escape(cap[1]));
  5198. };
  5199. /**
  5200. * Smartypants Transformations
  5201. */
  5202. InlineLexer.prototype.smartypants = function(text) {
  5203. if (!this.options.smartypants) return text;
  5204. return text
  5205. // em-dashes
  5206. .replace(/---/g, '\u2014')
  5207. // en-dashes
  5208. .replace(/--/g, '\u2013')
  5209. // opening singles
  5210. .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
  5211. // closing singles & apostrophes
  5212. .replace(/'/g, '\u2019')
  5213. // opening doubles
  5214. .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
  5215. // closing doubles
  5216. .replace(/"/g, '\u201d')
  5217. // ellipses
  5218. .replace(/\.{3}/g, '\u2026');
  5219. };
  5220. /**
  5221. * Mangle Links
  5222. */
  5223. InlineLexer.prototype.mangle = function(text) {
  5224. if (!this.options.mangle) return text;
  5225. var out = '',
  5226. l = text.length,
  5227. i = 0,
  5228. ch;
  5229. for (; i < l; i++) {
  5230. ch = text.charCodeAt(i);
  5231. if (Math.random() > 0.5) {
  5232. ch = 'x' + ch.toString(16);
  5233. }
  5234. out += '&#' + ch + ';';
  5235. }
  5236. return out;
  5237. };
  5238. /**
  5239. * Renderer
  5240. */
  5241. function Renderer(options) {
  5242. this.options = options || marked.defaults;
  5243. }
  5244. Renderer.prototype.code = function(code, infostring, escaped) {
  5245. var lang = (infostring || '').match(/\S*/)[0];
  5246. if (this.options.highlight) {
  5247. var out = this.options.highlight(code, lang);
  5248. if (out != null && out !== code) {
  5249. escaped = true;
  5250. code = out;
  5251. }
  5252. }
  5253. if (!lang) {
  5254. return '<pre><code>'
  5255. + (escaped ? code : escape(code, true))
  5256. + '</code></pre>';
  5257. }
  5258. return '<pre><code class="'
  5259. + this.options.langPrefix
  5260. + escape(lang, true)
  5261. + '">'
  5262. + (escaped ? code : escape(code, true))
  5263. + '</code></pre>\n';
  5264. };
  5265. Renderer.prototype.blockquote = function(quote) {
  5266. return '<blockquote>\n' + quote + '</blockquote>\n';
  5267. };
  5268. Renderer.prototype.html = function(html) {
  5269. return html;
  5270. };
  5271. Renderer.prototype.heading = function(text, level, raw, slugger) {
  5272. if (this.options.headerIds) {
  5273. return '<h'
  5274. + level
  5275. + ' id="'
  5276. + this.options.headerPrefix
  5277. + slugger.slug(raw)
  5278. + '">'
  5279. + text
  5280. + '</h'
  5281. + level
  5282. + '>\n';
  5283. }
  5284. // ignore IDs
  5285. return '<h' + level + '>' + text + '</h' + level + '>\n';
  5286. };
  5287. Renderer.prototype.hr = function() {
  5288. return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
  5289. };
  5290. Renderer.prototype.list = function(body, ordered, start) {
  5291. var type = ordered ? 'ol' : 'ul',
  5292. startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
  5293. return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
  5294. };
  5295. Renderer.prototype.listitem = function(text) {
  5296. return '<li>' + text + '</li>\n';
  5297. };
  5298. Renderer.prototype.checkbox = function(checked) {
  5299. return '<input '
  5300. + (checked ? 'checked="" ' : '')
  5301. + 'disabled="" type="checkbox"'
  5302. + (this.options.xhtml ? ' /' : '')
  5303. + '> ';
  5304. };
  5305. Renderer.prototype.paragraph = function(text) {
  5306. return '<p>' + text + '</p>\n';
  5307. };
  5308. Renderer.prototype.table = function(header, body) {
  5309. if (body) body = '<tbody>' + body + '</tbody>';
  5310. return '<table>\n'
  5311. + '<thead>\n'
  5312. + header
  5313. + '</thead>\n'
  5314. + body
  5315. + '</table>\n';
  5316. };
  5317. Renderer.prototype.tablerow = function(content) {
  5318. return '<tr>\n' + content + '</tr>\n';
  5319. };
  5320. Renderer.prototype.tablecell = function(content, flags) {
  5321. var type = flags.header ? 'th' : 'td';
  5322. var tag = flags.align
  5323. ? '<' + type + ' align="' + flags.align + '">'
  5324. : '<' + type + '>';
  5325. return tag + content + '</' + type + '>\n';
  5326. };
  5327. // span level renderer
  5328. Renderer.prototype.strong = function(text) {
  5329. return '<strong>' + text + '</strong>';
  5330. };
  5331. Renderer.prototype.em = function(text) {
  5332. return '<em>' + text + '</em>';
  5333. };
  5334. Renderer.prototype.codespan = function(text) {
  5335. return '<code>' + text + '</code>';
  5336. };
  5337. Renderer.prototype.br = function() {
  5338. return this.options.xhtml ? '<br/>' : '<br>';
  5339. };
  5340. Renderer.prototype.del = function(text) {
  5341. return '<del>' + text + '</del>';
  5342. };
  5343. Renderer.prototype.link = function(href, title, text) {
  5344. href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
  5345. if (href === null) {
  5346. return text;
  5347. }
  5348. var out = '<a href="' + escape(href) + '"';
  5349. if (title) {
  5350. out += ' title="' + title + '"';
  5351. }
  5352. out += '>' + text + '</a>';
  5353. return out;
  5354. };
  5355. Renderer.prototype.image = function(href, title, text) {
  5356. href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
  5357. if (href === null) {
  5358. return text;
  5359. }
  5360. var out = '<img src="' + href + '" alt="' + text + '"';
  5361. if (title) {
  5362. out += ' title="' + title + '"';
  5363. }
  5364. out += this.options.xhtml ? '/>' : '>';
  5365. return out;
  5366. };
  5367. Renderer.prototype.text = function(text) {
  5368. return text;
  5369. };
  5370. /**
  5371. * TextRenderer
  5372. * returns only the textual part of the token
  5373. */
  5374. function TextRenderer() {}
  5375. // no need for block level renderers
  5376. TextRenderer.prototype.strong =
  5377. TextRenderer.prototype.em =
  5378. TextRenderer.prototype.codespan =
  5379. TextRenderer.prototype.del =
  5380. TextRenderer.prototype.text = function(text) {
  5381. return text;
  5382. };
  5383. TextRenderer.prototype.link =
  5384. TextRenderer.prototype.image = function(href, title, text) {
  5385. return '' + text;
  5386. };
  5387. TextRenderer.prototype.br = function() {
  5388. return '';
  5389. };
  5390. /**
  5391. * Parsing & Compiling
  5392. */
  5393. function Parser(options) {
  5394. this.tokens = [];
  5395. this.token = null;
  5396. this.options = options || marked.defaults;
  5397. this.options.renderer = this.options.renderer || new Renderer();
  5398. this.renderer = this.options.renderer;
  5399. this.renderer.options = this.options;
  5400. this.slugger = new Slugger();
  5401. }
  5402. /**
  5403. * Static Parse Method
  5404. */
  5405. Parser.parse = function(src, options) {
  5406. var parser = new Parser(options);
  5407. return parser.parse(src);
  5408. };
  5409. /**
  5410. * Parse Loop
  5411. */
  5412. Parser.prototype.parse = function(src) {
  5413. this.inline = new InlineLexer(src.links, this.options);
  5414. // use an InlineLexer with a TextRenderer to extract pure text
  5415. this.inlineText = new InlineLexer(
  5416. src.links,
  5417. merge({}, this.options, { renderer: new TextRenderer() })
  5418. );
  5419. this.tokens = src.reverse();
  5420. var out = '';
  5421. while (this.next()) {
  5422. out += this.tok();
  5423. }
  5424. return out;
  5425. };
  5426. /**
  5427. * Next Token
  5428. */
  5429. Parser.prototype.next = function() {
  5430. this.token = this.tokens.pop();
  5431. return this.token;
  5432. };
  5433. /**
  5434. * Preview Next Token
  5435. */
  5436. Parser.prototype.peek = function() {
  5437. return this.tokens[this.tokens.length - 1] || 0;
  5438. };
  5439. /**
  5440. * Parse Text Tokens
  5441. */
  5442. Parser.prototype.parseText = function() {
  5443. var body = this.token.text;
  5444. while (this.peek().type === 'text') {
  5445. body += '\n' + this.next().text;
  5446. }
  5447. return this.inline.output(body);
  5448. };
  5449. /**
  5450. * Parse Current Token
  5451. */
  5452. Parser.prototype.tok = function() {
  5453. switch (this.token.type) {
  5454. case 'space': {
  5455. return '';
  5456. }
  5457. case 'hr': {
  5458. return this.renderer.hr();
  5459. }
  5460. case 'heading': {
  5461. return this.renderer.heading(
  5462. this.inline.output(this.token.text),
  5463. this.token.depth,
  5464. unescape(this.inlineText.output(this.token.text)),
  5465. this.slugger);
  5466. }
  5467. case 'code': {
  5468. return this.renderer.code(this.token.text,
  5469. this.token.lang,
  5470. this.token.escaped);
  5471. }
  5472. case 'table': {
  5473. var header = '',
  5474. body = '',
  5475. i,
  5476. row,
  5477. cell,
  5478. j;
  5479. // header
  5480. cell = '';
  5481. for (i = 0; i < this.token.header.length; i++) {
  5482. cell += this.renderer.tablecell(
  5483. this.inline.output(this.token.header[i]),
  5484. { header: true, align: this.token.align[i] }
  5485. );
  5486. }
  5487. header += this.renderer.tablerow(cell);
  5488. for (i = 0; i < this.token.cells.length; i++) {
  5489. row = this.token.cells[i];
  5490. cell = '';
  5491. for (j = 0; j < row.length; j++) {
  5492. cell += this.renderer.tablecell(
  5493. this.inline.output(row[j]),
  5494. { header: false, align: this.token.align[j] }
  5495. );
  5496. }
  5497. body += this.renderer.tablerow(cell);
  5498. }
  5499. return this.renderer.table(header, body);
  5500. }
  5501. case 'blockquote_start': {
  5502. body = '';
  5503. while (this.next().type !== 'blockquote_end') {
  5504. body += this.tok();
  5505. }
  5506. return this.renderer.blockquote(body);
  5507. }
  5508. case 'list_start': {
  5509. body = '';
  5510. var ordered = this.token.ordered,
  5511. start = this.token.start;
  5512. while (this.next().type !== 'list_end') {
  5513. body += this.tok();
  5514. }
  5515. return this.renderer.list(body, ordered, start);
  5516. }
  5517. case 'list_item_start': {
  5518. body = '';
  5519. var loose = this.token.loose;
  5520. var checked = this.token.checked;
  5521. var task = this.token.task;
  5522. if (this.token.task) {
  5523. body += this.renderer.checkbox(checked);
  5524. }
  5525. while (this.next().type !== 'list_item_end') {
  5526. body += !loose && this.token.type === 'text'
  5527. ? this.parseText()
  5528. : this.tok();
  5529. }
  5530. return this.renderer.listitem(body, task, checked);
  5531. }
  5532. case 'html': {
  5533. // TODO parse inline content if parameter markdown=1
  5534. return this.renderer.html(this.token.text);
  5535. }
  5536. case 'paragraph': {
  5537. return this.renderer.paragraph(this.inline.output(this.token.text));
  5538. }
  5539. case 'text': {
  5540. return this.renderer.paragraph(this.parseText());
  5541. }
  5542. default: {
  5543. var errMsg = 'Token with "' + this.token.type + '" type was not found.';
  5544. if (this.options.silent) {
  5545. console.log(errMsg);
  5546. } else {
  5547. throw new Error(errMsg);
  5548. }
  5549. }
  5550. }
  5551. };
  5552. /**
  5553. * Slugger generates header id
  5554. */
  5555. function Slugger() {
  5556. this.seen = {};
  5557. }
  5558. /**
  5559. * Convert string to unique id
  5560. */
  5561. Slugger.prototype.slug = function(value) {
  5562. var slug = value
  5563. .toLowerCase()
  5564. .trim()
  5565. .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
  5566. .replace(/\s/g, '-');
  5567. if (this.seen.hasOwnProperty(slug)) {
  5568. var originalSlug = slug;
  5569. do {
  5570. this.seen[originalSlug]++;
  5571. slug = originalSlug + '-' + this.seen[originalSlug];
  5572. } while (this.seen.hasOwnProperty(slug));
  5573. }
  5574. this.seen[slug] = 0;
  5575. return slug;
  5576. };
  5577. /**
  5578. * Helpers
  5579. */
  5580. function escape(html, encode) {
  5581. if (encode) {
  5582. if (escape.escapeTest.test(html)) {
  5583. return html.replace(escape.escapeReplace, function(ch) { return escape.replacements[ch]; });
  5584. }
  5585. } else {
  5586. if (escape.escapeTestNoEncode.test(html)) {
  5587. return html.replace(escape.escapeReplaceNoEncode, function(ch) { return escape.replacements[ch]; });
  5588. }
  5589. }
  5590. return html;
  5591. }
  5592. escape.escapeTest = /[&<>"']/;
  5593. escape.escapeReplace = /[&<>"']/g;
  5594. escape.replacements = {
  5595. '&': '&amp;',
  5596. '<': '&lt;',
  5597. '>': '&gt;',
  5598. '"': '&quot;',
  5599. "'": '&#39;'
  5600. };
  5601. escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
  5602. escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
  5603. function unescape(html) {
  5604. // explicitly match decimal, hex, and named HTML entities
  5605. return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) {
  5606. n = n.toLowerCase();
  5607. if (n === 'colon') return ':';
  5608. if (n.charAt(0) === '#') {
  5609. return n.charAt(1) === 'x'
  5610. ? String.fromCharCode(parseInt(n.substring(2), 16))
  5611. : String.fromCharCode(+n.substring(1));
  5612. }
  5613. return '';
  5614. });
  5615. }
  5616. function edit(regex, opt) {
  5617. regex = regex.source || regex;
  5618. opt = opt || '';
  5619. return {
  5620. replace: function(name, val) {
  5621. val = val.source || val;
  5622. val = val.replace(/(^|[^\[])\^/g, '$1');
  5623. regex = regex.replace(name, val);
  5624. return this;
  5625. },
  5626. getRegex: function() {
  5627. return new RegExp(regex, opt);
  5628. }
  5629. };
  5630. }
  5631. function cleanUrl(sanitize, base, href) {
  5632. if (sanitize) {
  5633. try {
  5634. var prot = decodeURIComponent(unescape(href))
  5635. .replace(/[^\w:]/g, '')
  5636. .toLowerCase();
  5637. } catch (e) {
  5638. return null;
  5639. }
  5640. if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
  5641. return null;
  5642. }
  5643. }
  5644. if (base && !originIndependentUrl.test(href)) {
  5645. href = resolveUrl(base, href);
  5646. }
  5647. try {
  5648. href = encodeURI(href).replace(/%25/g, '%');
  5649. } catch (e) {
  5650. return null;
  5651. }
  5652. return href;
  5653. }
  5654. function resolveUrl(base, href) {
  5655. if (!baseUrls[' ' + base]) {
  5656. // we can ignore everything in base after the last slash of its path component,
  5657. // but we might need to add _that_
  5658. // https://tools.ietf.org/html/rfc3986#section-3
  5659. if (/^[^:]+:\/*[^/]*$/.test(base)) {
  5660. baseUrls[' ' + base] = base + '/';
  5661. } else {
  5662. baseUrls[' ' + base] = rtrim(base, '/', true);
  5663. }
  5664. }
  5665. base = baseUrls[' ' + base];
  5666. if (href.slice(0, 2) === '//') {
  5667. return base.replace(/:[\s\S]*/, ':') + href;
  5668. } else if (href.charAt(0) === '/') {
  5669. return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
  5670. } else {
  5671. return base + href;
  5672. }
  5673. }
  5674. var baseUrls = {};
  5675. var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
  5676. function noop() {}
  5677. noop.exec = noop;
  5678. function merge(obj) {
  5679. var i = 1,
  5680. target,
  5681. key;
  5682. for (; i < arguments.length; i++) {
  5683. target = arguments[i];
  5684. for (key in target) {
  5685. if (Object.prototype.hasOwnProperty.call(target, key)) {
  5686. obj[key] = target[key];
  5687. }
  5688. }
  5689. }
  5690. return obj;
  5691. }
  5692. function splitCells(tableRow, count) {
  5693. // ensure that every cell-delimiting pipe has a space
  5694. // before it to distinguish it from an escaped pipe
  5695. var row = tableRow.replace(/\|/g, function(match, offset, str) {
  5696. var escaped = false,
  5697. curr = offset;
  5698. while (--curr >= 0 && str[curr] === '\\') escaped = !escaped;
  5699. if (escaped) {
  5700. // odd number of slashes means | is escaped
  5701. // so we leave it alone
  5702. return '|';
  5703. } else {
  5704. // add space before unescaped |
  5705. return ' |';
  5706. }
  5707. }),
  5708. cells = row.split(/ \|/),
  5709. i = 0;
  5710. if (cells.length > count) {
  5711. cells.splice(count);
  5712. } else {
  5713. while (cells.length < count) cells.push('');
  5714. }
  5715. for (; i < cells.length; i++) {
  5716. // leading or trailing whitespace is ignored per the gfm spec
  5717. cells[i] = cells[i].trim().replace(/\\\|/g, '|');
  5718. }
  5719. return cells;
  5720. }
  5721. // Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
  5722. // /c*$/ is vulnerable to REDOS.
  5723. // invert: Remove suffix of non-c chars instead. Default falsey.
  5724. function rtrim(str, c, invert) {
  5725. if (str.length === 0) {
  5726. return '';
  5727. }
  5728. // Length of suffix matching the invert condition.
  5729. var suffLen = 0;
  5730. // Step left until we fail to match the invert condition.
  5731. while (suffLen < str.length) {
  5732. var currChar = str.charAt(str.length - suffLen - 1);
  5733. if (currChar === c && !invert) {
  5734. suffLen++;
  5735. } else if (currChar !== c && invert) {
  5736. suffLen++;
  5737. } else {
  5738. break;
  5739. }
  5740. }
  5741. return str.substr(0, str.length - suffLen);
  5742. }
  5743. function findClosingBracket(str, b) {
  5744. if (str.indexOf(b[1]) === -1) {
  5745. return -1;
  5746. }
  5747. var level = 0;
  5748. for (var i = 0; i < str.length; i++) {
  5749. if (str[i] === '\\') {
  5750. i++;
  5751. } else if (str[i] === b[0]) {
  5752. level++;
  5753. } else if (str[i] === b[1]) {
  5754. level--;
  5755. if (level < 0) {
  5756. return i;
  5757. }
  5758. }
  5759. }
  5760. return -1;
  5761. }
  5762. function checkSanitizeDeprecation(opt) {
  5763. if (opt && opt.sanitize && !opt.silent) {
  5764. console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
  5765. }
  5766. }
  5767. /**
  5768. * Marked
  5769. */
  5770. function marked(src, opt, callback) {
  5771. // throw error in case of non string input
  5772. if (typeof src === 'undefined' || src === null) {
  5773. throw new Error('marked(): input parameter is undefined or null');
  5774. }
  5775. if (typeof src !== 'string') {
  5776. throw new Error('marked(): input parameter is of type '
  5777. + Object.prototype.toString.call(src) + ', string expected');
  5778. }
  5779. if (callback || typeof opt === 'function') {
  5780. if (!callback) {
  5781. callback = opt;
  5782. opt = null;
  5783. }
  5784. opt = merge({}, marked.defaults, opt || {});
  5785. checkSanitizeDeprecation(opt);
  5786. var highlight = opt.highlight,
  5787. tokens,
  5788. pending,
  5789. i = 0;
  5790. try {
  5791. tokens = Lexer.lex(src, opt);
  5792. } catch (e) {
  5793. return callback(e);
  5794. }
  5795. pending = tokens.length;
  5796. var done = function(err) {
  5797. if (err) {
  5798. opt.highlight = highlight;
  5799. return callback(err);
  5800. }
  5801. var out;
  5802. try {
  5803. out = Parser.parse(tokens, opt);
  5804. } catch (e) {
  5805. err = e;
  5806. }
  5807. opt.highlight = highlight;
  5808. return err
  5809. ? callback(err)
  5810. : callback(null, out);
  5811. };
  5812. if (!highlight || highlight.length < 3) {
  5813. return done();
  5814. }
  5815. delete opt.highlight;
  5816. if (!pending) return done();
  5817. for (; i < tokens.length; i++) {
  5818. (function(token) {
  5819. if (token.type !== 'code') {
  5820. return --pending || done();
  5821. }
  5822. return highlight(token.text, token.lang, function(err, code) {
  5823. if (err) return done(err);
  5824. if (code == null || code === token.text) {
  5825. return --pending || done();
  5826. }
  5827. token.text = code;
  5828. token.escaped = true;
  5829. --pending || done();
  5830. });
  5831. })(tokens[i]);
  5832. }
  5833. return;
  5834. }
  5835. try {
  5836. if (opt) opt = merge({}, marked.defaults, opt);
  5837. checkSanitizeDeprecation(opt);
  5838. return Parser.parse(Lexer.lex(src, opt), opt);
  5839. } catch (e) {
  5840. e.message += '\nPlease report this to https://github.com/markedjs/marked.';
  5841. if ((opt || marked.defaults).silent) {
  5842. return '<p>An error occurred:</p><pre>'
  5843. + escape(e.message + '', true)
  5844. + '</pre>';
  5845. }
  5846. throw e;
  5847. }
  5848. }
  5849. /**
  5850. * Options
  5851. */
  5852. marked.options =
  5853. marked.setOptions = function(opt) {
  5854. merge(marked.defaults, opt);
  5855. return marked;
  5856. };
  5857. marked.getDefaults = function() {
  5858. return {
  5859. baseUrl: null,
  5860. breaks: false,
  5861. gfm: true,
  5862. headerIds: true,
  5863. headerPrefix: '',
  5864. highlight: null,
  5865. langPrefix: 'language-',
  5866. mangle: true,
  5867. pedantic: false,
  5868. renderer: new Renderer(),
  5869. sanitize: false,
  5870. sanitizer: null,
  5871. silent: false,
  5872. smartLists: false,
  5873. smartypants: false,
  5874. xhtml: false
  5875. };
  5876. };
  5877. marked.defaults = marked.getDefaults();
  5878. /**
  5879. * Expose
  5880. */
  5881. marked.Parser = Parser;
  5882. marked.parser = Parser.parse;
  5883. marked.Renderer = Renderer;
  5884. marked.TextRenderer = TextRenderer;
  5885. marked.Lexer = Lexer;
  5886. marked.lexer = Lexer.lex;
  5887. marked.InlineLexer = InlineLexer;
  5888. marked.inlineLexer = InlineLexer.output;
  5889. marked.Slugger = Slugger;
  5890. marked.parse = marked;
  5891. if ('object' !== 'undefined' && 'object' === 'object') {
  5892. module.exports = marked;
  5893. } else if (typeof undefined === 'function' && undefined.amd) {
  5894. undefined(function() { return marked; });
  5895. } else {
  5896. root.marked = marked;
  5897. }
  5898. })(commonjsGlobal || (typeof window !== 'undefined' ? window : commonjsGlobal));
  5899. });
  5900. var speakingurl = createCommonjsModule(function (module) {
  5901. (function (root) {
  5902. 'use strict';
  5903. /**
  5904. * charMap
  5905. * @type {Object}
  5906. */
  5907. var charMap = {
  5908. // latin
  5909. 'À': 'A',
  5910. 'Á': 'A',
  5911. 'Â': 'A',
  5912. 'Ã': 'A',
  5913. 'Ä': 'Ae',
  5914. 'Å': 'A',
  5915. 'Æ': 'AE',
  5916. 'Ç': 'C',
  5917. 'È': 'E',
  5918. 'É': 'E',
  5919. 'Ê': 'E',
  5920. 'Ë': 'E',
  5921. 'Ì': 'I',
  5922. 'Í': 'I',
  5923. 'Î': 'I',
  5924. 'Ï': 'I',
  5925. 'Ð': 'D',
  5926. 'Ñ': 'N',
  5927. 'Ò': 'O',
  5928. 'Ó': 'O',
  5929. 'Ô': 'O',
  5930. 'Õ': 'O',
  5931. 'Ö': 'Oe',
  5932. 'Ő': 'O',
  5933. 'Ø': 'O',
  5934. 'Ù': 'U',
  5935. 'Ú': 'U',
  5936. 'Û': 'U',
  5937. 'Ü': 'Ue',
  5938. 'Ű': 'U',
  5939. 'Ý': 'Y',
  5940. 'Þ': 'TH',
  5941. 'ß': 'ss',
  5942. 'à': 'a',
  5943. 'á': 'a',
  5944. 'â': 'a',
  5945. 'ã': 'a',
  5946. 'ä': 'ae',
  5947. 'å': 'a',
  5948. 'æ': 'ae',
  5949. 'ç': 'c',
  5950. 'è': 'e',
  5951. 'é': 'e',
  5952. 'ê': 'e',
  5953. 'ë': 'e',
  5954. 'ì': 'i',
  5955. 'í': 'i',
  5956. 'î': 'i',
  5957. 'ï': 'i',
  5958. 'ð': 'd',
  5959. 'ñ': 'n',
  5960. 'ò': 'o',
  5961. 'ó': 'o',
  5962. 'ô': 'o',
  5963. 'õ': 'o',
  5964. 'ö': 'oe',
  5965. 'ő': 'o',
  5966. 'ø': 'o',
  5967. 'ù': 'u',
  5968. 'ú': 'u',
  5969. 'û': 'u',
  5970. 'ü': 'ue',
  5971. 'ű': 'u',
  5972. 'ý': 'y',
  5973. 'þ': 'th',
  5974. 'ÿ': 'y',
  5975. 'ẞ': 'SS',
  5976. // language specific
  5977. // Arabic
  5978. 'ا': 'a',
  5979. 'أ': 'a',
  5980. 'إ': 'i',
  5981. 'آ': 'aa',
  5982. 'ؤ': 'u',
  5983. 'ئ': 'e',
  5984. 'ء': 'a',
  5985. 'ب': 'b',
  5986. 'ت': 't',
  5987. 'ث': 'th',
  5988. 'ج': 'j',
  5989. 'ح': 'h',
  5990. 'خ': 'kh',
  5991. 'د': 'd',
  5992. 'ذ': 'th',
  5993. 'ر': 'r',
  5994. 'ز': 'z',
  5995. 'س': 's',
  5996. 'ش': 'sh',
  5997. 'ص': 's',
  5998. 'ض': 'dh',
  5999. 'ط': 't',
  6000. 'ظ': 'z',
  6001. 'ع': 'a',
  6002. 'غ': 'gh',
  6003. 'ف': 'f',
  6004. 'ق': 'q',
  6005. 'ك': 'k',
  6006. 'ل': 'l',
  6007. 'م': 'm',
  6008. 'ن': 'n',
  6009. 'ه': 'h',
  6010. 'و': 'w',
  6011. 'ي': 'y',
  6012. 'ى': 'a',
  6013. 'ة': 'h',
  6014. 'ﻻ': 'la',
  6015. 'ﻷ': 'laa',
  6016. 'ﻹ': 'lai',
  6017. 'ﻵ': 'laa',
  6018. // Persian additional characters than Arabic
  6019. 'گ': 'g',
  6020. 'چ': 'ch',
  6021. 'پ': 'p',
  6022. 'ژ': 'zh',
  6023. 'ک': 'k',
  6024. 'ی': 'y',
  6025. // Arabic diactrics
  6026. 'َ': 'a',
  6027. 'ً': 'an',
  6028. 'ِ': 'e',
  6029. 'ٍ': 'en',
  6030. 'ُ': 'u',
  6031. 'ٌ': 'on',
  6032. 'ْ': '',
  6033. // Arabic numbers
  6034. '٠': '0',
  6035. '١': '1',
  6036. '٢': '2',
  6037. '٣': '3',
  6038. '٤': '4',
  6039. '٥': '5',
  6040. '٦': '6',
  6041. '٧': '7',
  6042. '٨': '8',
  6043. '٩': '9',
  6044. // Persian numbers
  6045. '۰': '0',
  6046. '۱': '1',
  6047. '۲': '2',
  6048. '۳': '3',
  6049. '۴': '4',
  6050. '۵': '5',
  6051. '۶': '6',
  6052. '۷': '7',
  6053. '۸': '8',
  6054. '۹': '9',
  6055. // Burmese consonants
  6056. 'က': 'k',
  6057. 'ခ': 'kh',
  6058. 'ဂ': 'g',
  6059. 'ဃ': 'ga',
  6060. 'င': 'ng',
  6061. 'စ': 's',
  6062. 'ဆ': 'sa',
  6063. 'ဇ': 'z',
  6064. 'စျ': 'za',
  6065. 'ည': 'ny',
  6066. 'ဋ': 't',
  6067. 'ဌ': 'ta',
  6068. 'ဍ': 'd',
  6069. 'ဎ': 'da',
  6070. 'ဏ': 'na',
  6071. 'တ': 't',
  6072. 'ထ': 'ta',
  6073. 'ဒ': 'd',
  6074. 'ဓ': 'da',
  6075. 'န': 'n',
  6076. 'ပ': 'p',
  6077. 'ဖ': 'pa',
  6078. 'ဗ': 'b',
  6079. 'ဘ': 'ba',
  6080. 'မ': 'm',
  6081. 'ယ': 'y',
  6082. 'ရ': 'ya',
  6083. 'လ': 'l',
  6084. 'ဝ': 'w',
  6085. 'သ': 'th',
  6086. 'ဟ': 'h',
  6087. 'ဠ': 'la',
  6088. 'အ': 'a',
  6089. // consonant character combos
  6090. 'ြ': 'y',
  6091. 'ျ': 'ya',
  6092. 'ွ': 'w',
  6093. 'ြွ': 'yw',
  6094. 'ျွ': 'ywa',
  6095. 'ှ': 'h',
  6096. // independent vowels
  6097. 'ဧ': 'e',
  6098. '၏': '-e',
  6099. 'ဣ': 'i',
  6100. 'ဤ': '-i',
  6101. 'ဉ': 'u',
  6102. 'ဦ': '-u',
  6103. 'ဩ': 'aw',
  6104. 'သြော': 'aw',
  6105. 'ဪ': 'aw',
  6106. // numbers
  6107. '၀': '0',
  6108. '၁': '1',
  6109. '၂': '2',
  6110. '၃': '3',
  6111. '၄': '4',
  6112. '၅': '5',
  6113. '၆': '6',
  6114. '၇': '7',
  6115. '၈': '8',
  6116. '၉': '9',
  6117. // virama and tone marks which are silent in transliteration
  6118. '္': '',
  6119. '့': '',
  6120. 'း': '',
  6121. // Czech
  6122. 'č': 'c',
  6123. 'ď': 'd',
  6124. 'ě': 'e',
  6125. 'ň': 'n',
  6126. 'ř': 'r',
  6127. 'š': 's',
  6128. 'ť': 't',
  6129. 'ů': 'u',
  6130. 'ž': 'z',
  6131. 'Č': 'C',
  6132. 'Ď': 'D',
  6133. 'Ě': 'E',
  6134. 'Ň': 'N',
  6135. 'Ř': 'R',
  6136. 'Š': 'S',
  6137. 'Ť': 'T',
  6138. 'Ů': 'U',
  6139. 'Ž': 'Z',
  6140. // Dhivehi
  6141. 'ހ': 'h',
  6142. 'ށ': 'sh',
  6143. 'ނ': 'n',
  6144. 'ރ': 'r',
  6145. 'ބ': 'b',
  6146. 'ޅ': 'lh',
  6147. 'ކ': 'k',
  6148. 'އ': 'a',
  6149. 'ވ': 'v',
  6150. 'މ': 'm',
  6151. 'ފ': 'f',
  6152. 'ދ': 'dh',
  6153. 'ތ': 'th',
  6154. 'ލ': 'l',
  6155. 'ގ': 'g',
  6156. 'ޏ': 'gn',
  6157. 'ސ': 's',
  6158. 'ޑ': 'd',
  6159. 'ޒ': 'z',
  6160. 'ޓ': 't',
  6161. 'ޔ': 'y',
  6162. 'ޕ': 'p',
  6163. 'ޖ': 'j',
  6164. 'ޗ': 'ch',
  6165. 'ޘ': 'tt',
  6166. 'ޙ': 'hh',
  6167. 'ޚ': 'kh',
  6168. 'ޛ': 'th',
  6169. 'ޜ': 'z',
  6170. 'ޝ': 'sh',
  6171. 'ޞ': 's',
  6172. 'ޟ': 'd',
  6173. 'ޠ': 't',
  6174. 'ޡ': 'z',
  6175. 'ޢ': 'a',
  6176. 'ޣ': 'gh',
  6177. 'ޤ': 'q',
  6178. 'ޥ': 'w',
  6179. 'ަ': 'a',
  6180. 'ާ': 'aa',
  6181. 'ި': 'i',
  6182. 'ީ': 'ee',
  6183. 'ު': 'u',
  6184. 'ޫ': 'oo',
  6185. 'ެ': 'e',
  6186. 'ޭ': 'ey',
  6187. 'ޮ': 'o',
  6188. 'ޯ': 'oa',
  6189. 'ް': '',
  6190. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  6191. // National system (2002)
  6192. 'ა': 'a',
  6193. 'ბ': 'b',
  6194. 'გ': 'g',
  6195. 'დ': 'd',
  6196. 'ე': 'e',
  6197. 'ვ': 'v',
  6198. 'ზ': 'z',
  6199. 'თ': 't',
  6200. 'ი': 'i',
  6201. 'კ': 'k',
  6202. 'ლ': 'l',
  6203. 'მ': 'm',
  6204. 'ნ': 'n',
  6205. 'ო': 'o',
  6206. 'პ': 'p',
  6207. 'ჟ': 'zh',
  6208. 'რ': 'r',
  6209. 'ს': 's',
  6210. 'ტ': 't',
  6211. 'უ': 'u',
  6212. 'ფ': 'p',
  6213. 'ქ': 'k',
  6214. 'ღ': 'gh',
  6215. 'ყ': 'q',
  6216. 'შ': 'sh',
  6217. 'ჩ': 'ch',
  6218. 'ც': 'ts',
  6219. 'ძ': 'dz',
  6220. 'წ': 'ts',
  6221. 'ჭ': 'ch',
  6222. 'ხ': 'kh',
  6223. 'ჯ': 'j',
  6224. 'ჰ': 'h',
  6225. // Greek
  6226. 'α': 'a',
  6227. 'β': 'v',
  6228. 'γ': 'g',
  6229. 'δ': 'd',
  6230. 'ε': 'e',
  6231. 'ζ': 'z',
  6232. 'η': 'i',
  6233. 'θ': 'th',
  6234. 'ι': 'i',
  6235. 'κ': 'k',
  6236. 'λ': 'l',
  6237. 'μ': 'm',
  6238. 'ν': 'n',
  6239. 'ξ': 'ks',
  6240. 'ο': 'o',
  6241. 'π': 'p',
  6242. 'ρ': 'r',
  6243. 'σ': 's',
  6244. 'τ': 't',
  6245. 'υ': 'y',
  6246. 'φ': 'f',
  6247. 'χ': 'x',
  6248. 'ψ': 'ps',
  6249. 'ω': 'o',
  6250. 'ά': 'a',
  6251. 'έ': 'e',
  6252. 'ί': 'i',
  6253. 'ό': 'o',
  6254. 'ύ': 'y',
  6255. 'ή': 'i',
  6256. 'ώ': 'o',
  6257. 'ς': 's',
  6258. 'ϊ': 'i',
  6259. 'ΰ': 'y',
  6260. 'ϋ': 'y',
  6261. 'ΐ': 'i',
  6262. 'Α': 'A',
  6263. 'Β': 'B',
  6264. 'Γ': 'G',
  6265. 'Δ': 'D',
  6266. 'Ε': 'E',
  6267. 'Ζ': 'Z',
  6268. 'Η': 'I',
  6269. 'Θ': 'TH',
  6270. 'Ι': 'I',
  6271. 'Κ': 'K',
  6272. 'Λ': 'L',
  6273. 'Μ': 'M',
  6274. 'Ν': 'N',
  6275. 'Ξ': 'KS',
  6276. 'Ο': 'O',
  6277. 'Π': 'P',
  6278. 'Ρ': 'R',
  6279. 'Σ': 'S',
  6280. 'Τ': 'T',
  6281. 'Υ': 'Y',
  6282. 'Φ': 'F',
  6283. 'Χ': 'X',
  6284. 'Ψ': 'PS',
  6285. 'Ω': 'O',
  6286. 'Ά': 'A',
  6287. 'Έ': 'E',
  6288. 'Ί': 'I',
  6289. 'Ό': 'O',
  6290. 'Ύ': 'Y',
  6291. 'Ή': 'I',
  6292. 'Ώ': 'O',
  6293. 'Ϊ': 'I',
  6294. 'Ϋ': 'Y',
  6295. // Latvian
  6296. 'ā': 'a',
  6297. // 'č': 'c', // duplicate
  6298. 'ē': 'e',
  6299. 'ģ': 'g',
  6300. 'ī': 'i',
  6301. 'ķ': 'k',
  6302. 'ļ': 'l',
  6303. 'ņ': 'n',
  6304. // 'š': 's', // duplicate
  6305. 'ū': 'u',
  6306. // 'ž': 'z', // duplicate
  6307. 'Ā': 'A',
  6308. // 'Č': 'C', // duplicate
  6309. 'Ē': 'E',
  6310. 'Ģ': 'G',
  6311. 'Ī': 'I',
  6312. 'Ķ': 'k',
  6313. 'Ļ': 'L',
  6314. 'Ņ': 'N',
  6315. // 'Š': 'S', // duplicate
  6316. 'Ū': 'U',
  6317. // 'Ž': 'Z', // duplicate
  6318. // Macedonian
  6319. 'Ќ': 'Kj',
  6320. 'ќ': 'kj',
  6321. 'Љ': 'Lj',
  6322. 'љ': 'lj',
  6323. 'Њ': 'Nj',
  6324. 'њ': 'nj',
  6325. 'Тс': 'Ts',
  6326. 'тс': 'ts',
  6327. // Polish
  6328. 'ą': 'a',
  6329. 'ć': 'c',
  6330. 'ę': 'e',
  6331. 'ł': 'l',
  6332. 'ń': 'n',
  6333. // 'ó': 'o', // duplicate
  6334. 'ś': 's',
  6335. 'ź': 'z',
  6336. 'ż': 'z',
  6337. 'Ą': 'A',
  6338. 'Ć': 'C',
  6339. 'Ę': 'E',
  6340. 'Ł': 'L',
  6341. 'Ń': 'N',
  6342. 'Ś': 'S',
  6343. 'Ź': 'Z',
  6344. 'Ż': 'Z',
  6345. // Ukranian
  6346. 'Є': 'Ye',
  6347. 'І': 'I',
  6348. 'Ї': 'Yi',
  6349. 'Ґ': 'G',
  6350. 'є': 'ye',
  6351. 'і': 'i',
  6352. 'ї': 'yi',
  6353. 'ґ': 'g',
  6354. // Romanian
  6355. 'ă': 'a',
  6356. 'Ă': 'A',
  6357. 'ș': 's',
  6358. 'Ș': 'S',
  6359. // 'ş': 's', // duplicate
  6360. // 'Ş': 'S', // duplicate
  6361. 'ț': 't',
  6362. 'Ț': 'T',
  6363. 'ţ': 't',
  6364. 'Ţ': 'T',
  6365. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  6366. // ICAO
  6367. 'а': 'a',
  6368. 'б': 'b',
  6369. 'в': 'v',
  6370. 'г': 'g',
  6371. 'д': 'd',
  6372. 'е': 'e',
  6373. 'ё': 'yo',
  6374. 'ж': 'zh',
  6375. 'з': 'z',
  6376. 'и': 'i',
  6377. 'й': 'i',
  6378. 'к': 'k',
  6379. 'л': 'l',
  6380. 'м': 'm',
  6381. 'н': 'n',
  6382. 'о': 'o',
  6383. 'п': 'p',
  6384. 'р': 'r',
  6385. 'с': 's',
  6386. 'т': 't',
  6387. 'у': 'u',
  6388. 'ф': 'f',
  6389. 'х': 'kh',
  6390. 'ц': 'c',
  6391. 'ч': 'ch',
  6392. 'ш': 'sh',
  6393. 'щ': 'sh',
  6394. 'ъ': '',
  6395. 'ы': 'y',
  6396. 'ь': '',
  6397. 'э': 'e',
  6398. 'ю': 'yu',
  6399. 'я': 'ya',
  6400. 'А': 'A',
  6401. 'Б': 'B',
  6402. 'В': 'V',
  6403. 'Г': 'G',
  6404. 'Д': 'D',
  6405. 'Е': 'E',
  6406. 'Ё': 'Yo',
  6407. 'Ж': 'Zh',
  6408. 'З': 'Z',
  6409. 'И': 'I',
  6410. 'Й': 'I',
  6411. 'К': 'K',
  6412. 'Л': 'L',
  6413. 'М': 'M',
  6414. 'Н': 'N',
  6415. 'О': 'O',
  6416. 'П': 'P',
  6417. 'Р': 'R',
  6418. 'С': 'S',
  6419. 'Т': 'T',
  6420. 'У': 'U',
  6421. 'Ф': 'F',
  6422. 'Х': 'Kh',
  6423. 'Ц': 'C',
  6424. 'Ч': 'Ch',
  6425. 'Ш': 'Sh',
  6426. 'Щ': 'Sh',
  6427. 'Ъ': '',
  6428. 'Ы': 'Y',
  6429. 'Ь': '',
  6430. 'Э': 'E',
  6431. 'Ю': 'Yu',
  6432. 'Я': 'Ya',
  6433. // Serbian
  6434. 'ђ': 'dj',
  6435. 'ј': 'j',
  6436. // 'љ': 'lj', // duplicate
  6437. // 'њ': 'nj', // duplicate
  6438. 'ћ': 'c',
  6439. 'џ': 'dz',
  6440. 'Ђ': 'Dj',
  6441. 'Ј': 'j',
  6442. // 'Љ': 'Lj', // duplicate
  6443. // 'Њ': 'Nj', // duplicate
  6444. 'Ћ': 'C',
  6445. 'Џ': 'Dz',
  6446. // Slovak
  6447. 'ľ': 'l',
  6448. 'ĺ': 'l',
  6449. 'ŕ': 'r',
  6450. 'Ľ': 'L',
  6451. 'Ĺ': 'L',
  6452. 'Ŕ': 'R',
  6453. // Turkish
  6454. 'ş': 's',
  6455. 'Ş': 'S',
  6456. 'ı': 'i',
  6457. 'İ': 'I',
  6458. // 'ç': 'c', // duplicate
  6459. // 'Ç': 'C', // duplicate
  6460. // 'ü': 'u', // duplicate, see langCharMap
  6461. // 'Ü': 'U', // duplicate, see langCharMap
  6462. // 'ö': 'o', // duplicate, see langCharMap
  6463. // 'Ö': 'O', // duplicate, see langCharMap
  6464. 'ğ': 'g',
  6465. 'Ğ': 'G',
  6466. // Vietnamese
  6467. 'ả': 'a',
  6468. 'Ả': 'A',
  6469. 'ẳ': 'a',
  6470. 'Ẳ': 'A',
  6471. 'ẩ': 'a',
  6472. 'Ẩ': 'A',
  6473. 'đ': 'd',
  6474. 'Đ': 'D',
  6475. 'ẹ': 'e',
  6476. 'Ẹ': 'E',
  6477. 'ẽ': 'e',
  6478. 'Ẽ': 'E',
  6479. 'ẻ': 'e',
  6480. 'Ẻ': 'E',
  6481. 'ế': 'e',
  6482. 'Ế': 'E',
  6483. 'ề': 'e',
  6484. 'Ề': 'E',
  6485. 'ệ': 'e',
  6486. 'Ệ': 'E',
  6487. 'ễ': 'e',
  6488. 'Ễ': 'E',
  6489. 'ể': 'e',
  6490. 'Ể': 'E',
  6491. 'ỏ': 'o',
  6492. 'ọ': 'o',
  6493. 'Ọ': 'o',
  6494. 'ố': 'o',
  6495. 'Ố': 'O',
  6496. 'ồ': 'o',
  6497. 'Ồ': 'O',
  6498. 'ổ': 'o',
  6499. 'Ổ': 'O',
  6500. 'ộ': 'o',
  6501. 'Ộ': 'O',
  6502. 'ỗ': 'o',
  6503. 'Ỗ': 'O',
  6504. 'ơ': 'o',
  6505. 'Ơ': 'O',
  6506. 'ớ': 'o',
  6507. 'Ớ': 'O',
  6508. 'ờ': 'o',
  6509. 'Ờ': 'O',
  6510. 'ợ': 'o',
  6511. 'Ợ': 'O',
  6512. 'ỡ': 'o',
  6513. 'Ỡ': 'O',
  6514. 'Ở': 'o',
  6515. 'ở': 'o',
  6516. 'ị': 'i',
  6517. 'Ị': 'I',
  6518. 'ĩ': 'i',
  6519. 'Ĩ': 'I',
  6520. 'ỉ': 'i',
  6521. 'Ỉ': 'i',
  6522. 'ủ': 'u',
  6523. 'Ủ': 'U',
  6524. 'ụ': 'u',
  6525. 'Ụ': 'U',
  6526. 'ũ': 'u',
  6527. 'Ũ': 'U',
  6528. 'ư': 'u',
  6529. 'Ư': 'U',
  6530. 'ứ': 'u',
  6531. 'Ứ': 'U',
  6532. 'ừ': 'u',
  6533. 'Ừ': 'U',
  6534. 'ự': 'u',
  6535. 'Ự': 'U',
  6536. 'ữ': 'u',
  6537. 'Ữ': 'U',
  6538. 'ử': 'u',
  6539. 'Ử': 'ư',
  6540. 'ỷ': 'y',
  6541. 'Ỷ': 'y',
  6542. 'ỳ': 'y',
  6543. 'Ỳ': 'Y',
  6544. 'ỵ': 'y',
  6545. 'Ỵ': 'Y',
  6546. 'ỹ': 'y',
  6547. 'Ỹ': 'Y',
  6548. 'ạ': 'a',
  6549. 'Ạ': 'A',
  6550. 'ấ': 'a',
  6551. 'Ấ': 'A',
  6552. 'ầ': 'a',
  6553. 'Ầ': 'A',
  6554. 'ậ': 'a',
  6555. 'Ậ': 'A',
  6556. 'ẫ': 'a',
  6557. 'Ẫ': 'A',
  6558. // 'ă': 'a', // duplicate
  6559. // 'Ă': 'A', // duplicate
  6560. 'ắ': 'a',
  6561. 'Ắ': 'A',
  6562. 'ằ': 'a',
  6563. 'Ằ': 'A',
  6564. 'ặ': 'a',
  6565. 'Ặ': 'A',
  6566. 'ẵ': 'a',
  6567. 'Ẵ': 'A',
  6568. "⓪": "0",
  6569. "①": "1",
  6570. "②": "2",
  6571. "③": "3",
  6572. "④": "4",
  6573. "⑤": "5",
  6574. "⑥": "6",
  6575. "⑦": "7",
  6576. "⑧": "8",
  6577. "⑨": "9",
  6578. "⑩": "10",
  6579. "⑪": "11",
  6580. "⑫": "12",
  6581. "⑬": "13",
  6582. "⑭": "14",
  6583. "⑮": "15",
  6584. "⑯": "16",
  6585. "⑰": "17",
  6586. "⑱": "18",
  6587. "⑲": "18",
  6588. "⑳": "18",
  6589. "⓵": "1",
  6590. "⓶": "2",
  6591. "⓷": "3",
  6592. "⓸": "4",
  6593. "⓹": "5",
  6594. "⓺": "6",
  6595. "⓻": "7",
  6596. "⓼": "8",
  6597. "⓽": "9",
  6598. "⓾": "10",
  6599. "⓿": "0",
  6600. "⓫": "11",
  6601. "⓬": "12",
  6602. "⓭": "13",
  6603. "⓮": "14",
  6604. "⓯": "15",
  6605. "⓰": "16",
  6606. "⓱": "17",
  6607. "⓲": "18",
  6608. "⓳": "19",
  6609. "⓴": "20",
  6610. "Ⓐ": "A",
  6611. "Ⓑ": "B",
  6612. "Ⓒ": "C",
  6613. "Ⓓ": "D",
  6614. "Ⓔ": "E",
  6615. "Ⓕ": "F",
  6616. "Ⓖ": "G",
  6617. "Ⓗ": "H",
  6618. "Ⓘ": "I",
  6619. "Ⓙ": "J",
  6620. "Ⓚ": "K",
  6621. "Ⓛ": "L",
  6622. "Ⓜ": "M",
  6623. "Ⓝ": "N",
  6624. "Ⓞ": "O",
  6625. "Ⓟ": "P",
  6626. "Ⓠ": "Q",
  6627. "Ⓡ": "R",
  6628. "Ⓢ": "S",
  6629. "Ⓣ": "T",
  6630. "Ⓤ": "U",
  6631. "Ⓥ": "V",
  6632. "Ⓦ": "W",
  6633. "Ⓧ": "X",
  6634. "Ⓨ": "Y",
  6635. "Ⓩ": "Z",
  6636. "ⓐ": "a",
  6637. "ⓑ": "b",
  6638. "ⓒ": "c",
  6639. "ⓓ": "d",
  6640. "ⓔ": "e",
  6641. "ⓕ": "f",
  6642. "ⓖ": "g",
  6643. "ⓗ": "h",
  6644. "ⓘ": "i",
  6645. "ⓙ": "j",
  6646. "ⓚ": "k",
  6647. "ⓛ": "l",
  6648. "ⓜ": "m",
  6649. "ⓝ": "n",
  6650. "ⓞ": "o",
  6651. "ⓟ": "p",
  6652. "ⓠ": "q",
  6653. "ⓡ": "r",
  6654. "ⓢ": "s",
  6655. "ⓣ": "t",
  6656. "ⓤ": "u",
  6657. "ⓦ": "v",
  6658. "ⓥ": "w",
  6659. "ⓧ": "x",
  6660. "ⓨ": "y",
  6661. "ⓩ": "z",
  6662. // symbols
  6663. '“': '"',
  6664. '”': '"',
  6665. '‘': "'",
  6666. '’': "'",
  6667. '∂': 'd',
  6668. 'ƒ': 'f',
  6669. '™': '(TM)',
  6670. '©': '(C)',
  6671. 'œ': 'oe',
  6672. 'Œ': 'OE',
  6673. '®': '(R)',
  6674. '†': '+',
  6675. '℠': '(SM)',
  6676. '…': '...',
  6677. '˚': 'o',
  6678. 'º': 'o',
  6679. 'ª': 'a',
  6680. '•': '*',
  6681. '၊': ',',
  6682. '။': '.',
  6683. // currency
  6684. '$': 'USD',
  6685. '€': 'EUR',
  6686. '₢': 'BRN',
  6687. '₣': 'FRF',
  6688. '£': 'GBP',
  6689. '₤': 'ITL',
  6690. '₦': 'NGN',
  6691. '₧': 'ESP',
  6692. '₩': 'KRW',
  6693. '₪': 'ILS',
  6694. '₫': 'VND',
  6695. '₭': 'LAK',
  6696. '₮': 'MNT',
  6697. '₯': 'GRD',
  6698. '₱': 'ARS',
  6699. '₲': 'PYG',
  6700. '₳': 'ARA',
  6701. '₴': 'UAH',
  6702. '₵': 'GHS',
  6703. '¢': 'cent',
  6704. '¥': 'CNY',
  6705. '元': 'CNY',
  6706. '円': 'YEN',
  6707. '﷼': 'IRR',
  6708. '₠': 'EWE',
  6709. '฿': 'THB',
  6710. '₨': 'INR',
  6711. '₹': 'INR',
  6712. '₰': 'PF',
  6713. '₺': 'TRY',
  6714. '؋': 'AFN',
  6715. '₼': 'AZN',
  6716. 'лв': 'BGN',
  6717. '៛': 'KHR',
  6718. '₡': 'CRC',
  6719. '₸': 'KZT',
  6720. 'ден': 'MKD',
  6721. 'zł': 'PLN',
  6722. '₽': 'RUB',
  6723. '₾': 'GEL'
  6724. };
  6725. /**
  6726. * special look ahead character array
  6727. * These characters form with consonants to become 'single'/consonant combo
  6728. * @type [Array]
  6729. */
  6730. var lookAheadCharArray = [
  6731. // burmese
  6732. '်',
  6733. // Dhivehi
  6734. 'ް'
  6735. ];
  6736. /**
  6737. * diatricMap for languages where transliteration changes entirely as more diatrics are added
  6738. * @type {Object}
  6739. */
  6740. var diatricMap = {
  6741. // Burmese
  6742. // dependent vowels
  6743. 'ာ': 'a',
  6744. 'ါ': 'a',
  6745. 'ေ': 'e',
  6746. 'ဲ': 'e',
  6747. 'ိ': 'i',
  6748. 'ီ': 'i',
  6749. 'ို': 'o',
  6750. 'ု': 'u',
  6751. 'ူ': 'u',
  6752. 'ေါင်': 'aung',
  6753. 'ော': 'aw',
  6754. 'ော်': 'aw',
  6755. 'ေါ': 'aw',
  6756. 'ေါ်': 'aw',
  6757. '်': '်', // this is special case but the character will be converted to latin in the code
  6758. 'က်': 'et',
  6759. 'ိုက်': 'aik',
  6760. 'ောက်': 'auk',
  6761. 'င်': 'in',
  6762. 'ိုင်': 'aing',
  6763. 'ောင်': 'aung',
  6764. 'စ်': 'it',
  6765. 'ည်': 'i',
  6766. 'တ်': 'at',
  6767. 'ိတ်': 'eik',
  6768. 'ုတ်': 'ok',
  6769. 'ွတ်': 'ut',
  6770. 'ေတ်': 'it',
  6771. 'ဒ်': 'd',
  6772. 'ိုဒ်': 'ok',
  6773. 'ုဒ်': 'ait',
  6774. 'န်': 'an',
  6775. 'ာန်': 'an',
  6776. 'ိန်': 'ein',
  6777. 'ုန်': 'on',
  6778. 'ွန်': 'un',
  6779. 'ပ်': 'at',
  6780. 'ိပ်': 'eik',
  6781. 'ုပ်': 'ok',
  6782. 'ွပ်': 'ut',
  6783. 'န်ုပ်': 'nub',
  6784. 'မ်': 'an',
  6785. 'ိမ်': 'ein',
  6786. 'ုမ်': 'on',
  6787. 'ွမ်': 'un',
  6788. 'ယ်': 'e',
  6789. 'ိုလ်': 'ol',
  6790. 'ဉ်': 'in',
  6791. 'ံ': 'an',
  6792. 'ိံ': 'ein',
  6793. 'ုံ': 'on',
  6794. // Dhivehi
  6795. 'ައް': 'ah',
  6796. 'ަށް': 'ah'
  6797. };
  6798. /**
  6799. * langCharMap language specific characters translations
  6800. * @type {Object}
  6801. */
  6802. var langCharMap = {
  6803. 'en': {}, // default language
  6804. 'az': { // Azerbaijani
  6805. 'ç': 'c',
  6806. 'ə': 'e',
  6807. 'ğ': 'g',
  6808. 'ı': 'i',
  6809. 'ö': 'o',
  6810. 'ş': 's',
  6811. 'ü': 'u',
  6812. 'Ç': 'C',
  6813. 'Ə': 'E',
  6814. 'Ğ': 'G',
  6815. 'İ': 'I',
  6816. 'Ö': 'O',
  6817. 'Ş': 'S',
  6818. 'Ü': 'U'
  6819. },
  6820. 'cs': { // Czech
  6821. 'č': 'c',
  6822. 'ď': 'd',
  6823. 'ě': 'e',
  6824. 'ň': 'n',
  6825. 'ř': 'r',
  6826. 'š': 's',
  6827. 'ť': 't',
  6828. 'ů': 'u',
  6829. 'ž': 'z',
  6830. 'Č': 'C',
  6831. 'Ď': 'D',
  6832. 'Ě': 'E',
  6833. 'Ň': 'N',
  6834. 'Ř': 'R',
  6835. 'Š': 'S',
  6836. 'Ť': 'T',
  6837. 'Ů': 'U',
  6838. 'Ž': 'Z'
  6839. },
  6840. 'fi': { // Finnish
  6841. // 'å': 'a', duplicate see charMap/latin
  6842. // 'Å': 'A', duplicate see charMap/latin
  6843. 'ä': 'a', // ok
  6844. 'Ä': 'A', // ok
  6845. 'ö': 'o', // ok
  6846. 'Ö': 'O' // ok
  6847. },
  6848. 'hu': { // Hungarian
  6849. 'ä': 'a', // ok
  6850. 'Ä': 'A', // ok
  6851. // 'á': 'a', duplicate see charMap/latin
  6852. // 'Á': 'A', duplicate see charMap/latin
  6853. 'ö': 'o', // ok
  6854. 'Ö': 'O', // ok
  6855. // 'ő': 'o', duplicate see charMap/latin
  6856. // 'Ő': 'O', duplicate see charMap/latin
  6857. 'ü': 'u',
  6858. 'Ü': 'U',
  6859. 'ű': 'u',
  6860. 'Ű': 'U'
  6861. },
  6862. 'lt': { // Lithuanian
  6863. 'ą': 'a',
  6864. 'č': 'c',
  6865. 'ę': 'e',
  6866. 'ė': 'e',
  6867. 'į': 'i',
  6868. 'š': 's',
  6869. 'ų': 'u',
  6870. 'ū': 'u',
  6871. 'ž': 'z',
  6872. 'Ą': 'A',
  6873. 'Č': 'C',
  6874. 'Ę': 'E',
  6875. 'Ė': 'E',
  6876. 'Į': 'I',
  6877. 'Š': 'S',
  6878. 'Ų': 'U',
  6879. 'Ū': 'U'
  6880. },
  6881. 'lv': { // Latvian
  6882. 'ā': 'a',
  6883. 'č': 'c',
  6884. 'ē': 'e',
  6885. 'ģ': 'g',
  6886. 'ī': 'i',
  6887. 'ķ': 'k',
  6888. 'ļ': 'l',
  6889. 'ņ': 'n',
  6890. 'š': 's',
  6891. 'ū': 'u',
  6892. 'ž': 'z',
  6893. 'Ā': 'A',
  6894. 'Č': 'C',
  6895. 'Ē': 'E',
  6896. 'Ģ': 'G',
  6897. 'Ī': 'i',
  6898. 'Ķ': 'k',
  6899. 'Ļ': 'L',
  6900. 'Ņ': 'N',
  6901. 'Š': 'S',
  6902. 'Ū': 'u',
  6903. 'Ž': 'Z'
  6904. },
  6905. 'pl': { // Polish
  6906. 'ą': 'a',
  6907. 'ć': 'c',
  6908. 'ę': 'e',
  6909. 'ł': 'l',
  6910. 'ń': 'n',
  6911. 'ó': 'o',
  6912. 'ś': 's',
  6913. 'ź': 'z',
  6914. 'ż': 'z',
  6915. 'Ą': 'A',
  6916. 'Ć': 'C',
  6917. 'Ę': 'e',
  6918. 'Ł': 'L',
  6919. 'Ń': 'N',
  6920. 'Ó': 'O',
  6921. 'Ś': 'S',
  6922. 'Ź': 'Z',
  6923. 'Ż': 'Z'
  6924. },
  6925. 'sv': { // Swedish
  6926. // 'å': 'a', duplicate see charMap/latin
  6927. // 'Å': 'A', duplicate see charMap/latin
  6928. 'ä': 'a', // ok
  6929. 'Ä': 'A', // ok
  6930. 'ö': 'o', // ok
  6931. 'Ö': 'O' // ok
  6932. },
  6933. 'sk': { // Slovak
  6934. 'ä': 'a',
  6935. 'Ä': 'A'
  6936. },
  6937. 'sr': { // Serbian
  6938. 'љ': 'lj',
  6939. 'њ': 'nj',
  6940. 'Љ': 'Lj',
  6941. 'Њ': 'Nj',
  6942. 'đ': 'dj',
  6943. 'Đ': 'Dj'
  6944. },
  6945. 'tr': { // Turkish
  6946. 'Ü': 'U',
  6947. 'Ö': 'O',
  6948. 'ü': 'u',
  6949. 'ö': 'o'
  6950. }
  6951. };
  6952. /**
  6953. * symbolMap language specific symbol translations
  6954. * translations must be transliterated already
  6955. * @type {Object}
  6956. */
  6957. var symbolMap = {
  6958. 'ar': {
  6959. '∆': 'delta',
  6960. '∞': 'la-nihaya',
  6961. '♥': 'hob',
  6962. '&': 'wa',
  6963. '|': 'aw',
  6964. '<': 'aqal-men',
  6965. '>': 'akbar-men',
  6966. '∑': 'majmou',
  6967. '¤': 'omla'
  6968. },
  6969. 'az': {},
  6970. 'ca': {
  6971. '∆': 'delta',
  6972. '∞': 'infinit',
  6973. '♥': 'amor',
  6974. '&': 'i',
  6975. '|': 'o',
  6976. '<': 'menys que',
  6977. '>': 'mes que',
  6978. '∑': 'suma dels',
  6979. '¤': 'moneda'
  6980. },
  6981. 'cs': {
  6982. '∆': 'delta',
  6983. '∞': 'nekonecno',
  6984. '♥': 'laska',
  6985. '&': 'a',
  6986. '|': 'nebo',
  6987. '<': 'mensi nez',
  6988. '>': 'vetsi nez',
  6989. '∑': 'soucet',
  6990. '¤': 'mena'
  6991. },
  6992. 'de': {
  6993. '∆': 'delta',
  6994. '∞': 'unendlich',
  6995. '♥': 'Liebe',
  6996. '&': 'und',
  6997. '|': 'oder',
  6998. '<': 'kleiner als',
  6999. '>': 'groesser als',
  7000. '∑': 'Summe von',
  7001. '¤': 'Waehrung'
  7002. },
  7003. 'dv': {
  7004. '∆': 'delta',
  7005. '∞': 'kolunulaa',
  7006. '♥': 'loabi',
  7007. '&': 'aai',
  7008. '|': 'noonee',
  7009. '<': 'ah vure kuda',
  7010. '>': 'ah vure bodu',
  7011. '∑': 'jumula',
  7012. '¤': 'faisaa'
  7013. },
  7014. 'en': {
  7015. '∆': 'delta',
  7016. '∞': 'infinity',
  7017. '♥': 'love',
  7018. '&': 'and',
  7019. '|': 'or',
  7020. '<': 'less than',
  7021. '>': 'greater than',
  7022. '∑': 'sum',
  7023. '¤': 'currency'
  7024. },
  7025. 'es': {
  7026. '∆': 'delta',
  7027. '∞': 'infinito',
  7028. '♥': 'amor',
  7029. '&': 'y',
  7030. '|': 'u',
  7031. '<': 'menos que',
  7032. '>': 'mas que',
  7033. '∑': 'suma de los',
  7034. '¤': 'moneda'
  7035. },
  7036. 'fa': {
  7037. '∆': 'delta',
  7038. '∞': 'bi-nahayat',
  7039. '♥': 'eshgh',
  7040. '&': 'va',
  7041. '|': 'ya',
  7042. '<': 'kamtar-az',
  7043. '>': 'bishtar-az',
  7044. '∑': 'majmooe',
  7045. '¤': 'vahed'
  7046. },
  7047. 'fi': {
  7048. '∆': 'delta',
  7049. '∞': 'aarettomyys',
  7050. '♥': 'rakkaus',
  7051. '&': 'ja',
  7052. '|': 'tai',
  7053. '<': 'pienempi kuin',
  7054. '>': 'suurempi kuin',
  7055. '∑': 'summa',
  7056. '¤': 'valuutta'
  7057. },
  7058. 'fr': {
  7059. '∆': 'delta',
  7060. '∞': 'infiniment',
  7061. '♥': 'Amour',
  7062. '&': 'et',
  7063. '|': 'ou',
  7064. '<': 'moins que',
  7065. '>': 'superieure a',
  7066. '∑': 'somme des',
  7067. '¤': 'monnaie'
  7068. },
  7069. 'ge': {
  7070. '∆': 'delta',
  7071. '∞': 'usasruloba',
  7072. '♥': 'siqvaruli',
  7073. '&': 'da',
  7074. '|': 'an',
  7075. '<': 'naklebi',
  7076. '>': 'meti',
  7077. '∑': 'jami',
  7078. '¤': 'valuta'
  7079. },
  7080. 'gr': {},
  7081. 'hu': {
  7082. '∆': 'delta',
  7083. '∞': 'vegtelen',
  7084. '♥': 'szerelem',
  7085. '&': 'es',
  7086. '|': 'vagy',
  7087. '<': 'kisebb mint',
  7088. '>': 'nagyobb mint',
  7089. '∑': 'szumma',
  7090. '¤': 'penznem'
  7091. },
  7092. 'it': {
  7093. '∆': 'delta',
  7094. '∞': 'infinito',
  7095. '♥': 'amore',
  7096. '&': 'e',
  7097. '|': 'o',
  7098. '<': 'minore di',
  7099. '>': 'maggiore di',
  7100. '∑': 'somma',
  7101. '¤': 'moneta'
  7102. },
  7103. 'lt': {
  7104. '∆': 'delta',
  7105. '∞': 'begalybe',
  7106. '♥': 'meile',
  7107. '&': 'ir',
  7108. '|': 'ar',
  7109. '<': 'maziau nei',
  7110. '>': 'daugiau nei',
  7111. '∑': 'suma',
  7112. '¤': 'valiuta'
  7113. },
  7114. 'lv': {
  7115. '∆': 'delta',
  7116. '∞': 'bezgaliba',
  7117. '♥': 'milestiba',
  7118. '&': 'un',
  7119. '|': 'vai',
  7120. '<': 'mazak neka',
  7121. '>': 'lielaks neka',
  7122. '∑': 'summa',
  7123. '¤': 'valuta'
  7124. },
  7125. 'my': {
  7126. '∆': 'kwahkhyaet',
  7127. '∞': 'asaonasme',
  7128. '♥': 'akhyait',
  7129. '&': 'nhin',
  7130. '|': 'tho',
  7131. '<': 'ngethaw',
  7132. '>': 'kyithaw',
  7133. '∑': 'paungld',
  7134. '¤': 'ngwekye'
  7135. },
  7136. 'mk': {},
  7137. 'nl': {
  7138. '∆': 'delta',
  7139. '∞': 'oneindig',
  7140. '♥': 'liefde',
  7141. '&': 'en',
  7142. '|': 'of',
  7143. '<': 'kleiner dan',
  7144. '>': 'groter dan',
  7145. '∑': 'som',
  7146. '¤': 'valuta'
  7147. },
  7148. 'pl': {
  7149. '∆': 'delta',
  7150. '∞': 'nieskonczonosc',
  7151. '♥': 'milosc',
  7152. '&': 'i',
  7153. '|': 'lub',
  7154. '<': 'mniejsze niz',
  7155. '>': 'wieksze niz',
  7156. '∑': 'suma',
  7157. '¤': 'waluta'
  7158. },
  7159. 'pt': {
  7160. '∆': 'delta',
  7161. '∞': 'infinito',
  7162. '♥': 'amor',
  7163. '&': 'e',
  7164. '|': 'ou',
  7165. '<': 'menor que',
  7166. '>': 'maior que',
  7167. '∑': 'soma',
  7168. '¤': 'moeda'
  7169. },
  7170. 'ro': {
  7171. '∆': 'delta',
  7172. '∞': 'infinit',
  7173. '♥': 'dragoste',
  7174. '&': 'si',
  7175. '|': 'sau',
  7176. '<': 'mai mic ca',
  7177. '>': 'mai mare ca',
  7178. '∑': 'suma',
  7179. '¤': 'valuta'
  7180. },
  7181. 'ru': {
  7182. '∆': 'delta',
  7183. '∞': 'beskonechno',
  7184. '♥': 'lubov',
  7185. '&': 'i',
  7186. '|': 'ili',
  7187. '<': 'menshe',
  7188. '>': 'bolshe',
  7189. '∑': 'summa',
  7190. '¤': 'valjuta'
  7191. },
  7192. 'sk': {
  7193. '∆': 'delta',
  7194. '∞': 'nekonecno',
  7195. '♥': 'laska',
  7196. '&': 'a',
  7197. '|': 'alebo',
  7198. '<': 'menej ako',
  7199. '>': 'viac ako',
  7200. '∑': 'sucet',
  7201. '¤': 'mena'
  7202. },
  7203. 'sr': {},
  7204. 'tr': {
  7205. '∆': 'delta',
  7206. '∞': 'sonsuzluk',
  7207. '♥': 'ask',
  7208. '&': 've',
  7209. '|': 'veya',
  7210. '<': 'kucuktur',
  7211. '>': 'buyuktur',
  7212. '∑': 'toplam',
  7213. '¤': 'para birimi'
  7214. },
  7215. 'uk': {
  7216. '∆': 'delta',
  7217. '∞': 'bezkinechnist',
  7218. '♥': 'lubov',
  7219. '&': 'i',
  7220. '|': 'abo',
  7221. '<': 'menshe',
  7222. '>': 'bilshe',
  7223. '∑': 'suma',
  7224. '¤': 'valjuta'
  7225. },
  7226. 'vn': {
  7227. '∆': 'delta',
  7228. '∞': 'vo cuc',
  7229. '♥': 'yeu',
  7230. '&': 'va',
  7231. '|': 'hoac',
  7232. '<': 'nho hon',
  7233. '>': 'lon hon',
  7234. '∑': 'tong',
  7235. '¤': 'tien te'
  7236. }
  7237. };
  7238. var uricChars = [';', '?', ':', '@', '&', '=', '+', '$', ',', '/'].join('');
  7239. var uricNoSlashChars = [';', '?', ':', '@', '&', '=', '+', '$', ','].join('');
  7240. var markChars = ['.', '!', '~', '*', "'", '(', ')'].join('');
  7241. /**
  7242. * getSlug
  7243. * @param {string} input input string
  7244. * @param {object|string} opts config object or separator string/char
  7245. * @api public
  7246. * @return {string} sluggified string
  7247. */
  7248. var getSlug = function getSlug(input, opts) {
  7249. var separator = '-';
  7250. var result = '';
  7251. var diatricString = '';
  7252. var convertSymbols = true;
  7253. var customReplacements = {};
  7254. var maintainCase;
  7255. var titleCase;
  7256. var truncate;
  7257. var uricFlag;
  7258. var uricNoSlashFlag;
  7259. var markFlag;
  7260. var symbol;
  7261. var langChar;
  7262. var lucky;
  7263. var i;
  7264. var ch;
  7265. var l;
  7266. var lastCharWasSymbol;
  7267. var lastCharWasDiatric;
  7268. var allowedChars = '';
  7269. if (typeof input !== 'string') {
  7270. return '';
  7271. }
  7272. if (typeof opts === 'string') {
  7273. separator = opts;
  7274. }
  7275. symbol = symbolMap.en;
  7276. langChar = langCharMap.en;
  7277. if (typeof opts === 'object') {
  7278. maintainCase = opts.maintainCase || false;
  7279. customReplacements = (opts.custom && typeof opts.custom === 'object') ? opts.custom : customReplacements;
  7280. truncate = (+opts.truncate > 1 && opts.truncate) || false;
  7281. uricFlag = opts.uric || false;
  7282. uricNoSlashFlag = opts.uricNoSlash || false;
  7283. markFlag = opts.mark || false;
  7284. convertSymbols = (opts.symbols === false || opts.lang === false) ? false : true;
  7285. separator = opts.separator || separator;
  7286. if (uricFlag) {
  7287. allowedChars += uricChars;
  7288. }
  7289. if (uricNoSlashFlag) {
  7290. allowedChars += uricNoSlashChars;
  7291. }
  7292. if (markFlag) {
  7293. allowedChars += markChars;
  7294. }
  7295. symbol = (opts.lang && symbolMap[opts.lang] && convertSymbols) ?
  7296. symbolMap[opts.lang] : (convertSymbols ? symbolMap.en : {});
  7297. langChar = (opts.lang && langCharMap[opts.lang]) ?
  7298. langCharMap[opts.lang] :
  7299. opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  7300. // if titleCase config is an Array, rewrite to object format
  7301. if (opts.titleCase && typeof opts.titleCase.length === 'number' && Array.prototype.toString.call(opts.titleCase)) {
  7302. opts.titleCase.forEach(function (v) {
  7303. customReplacements[v + ''] = v + '';
  7304. });
  7305. titleCase = true;
  7306. } else {
  7307. titleCase = !!opts.titleCase;
  7308. }
  7309. // if custom config is an Array, rewrite to object format
  7310. if (opts.custom && typeof opts.custom.length === 'number' && Array.prototype.toString.call(opts.custom)) {
  7311. opts.custom.forEach(function (v) {
  7312. customReplacements[v + ''] = v + '';
  7313. });
  7314. }
  7315. // custom replacements
  7316. Object.keys(customReplacements).forEach(function (v) {
  7317. var r;
  7318. if (v.length > 1) {
  7319. r = new RegExp('\\b' + escapeChars(v) + '\\b', 'gi');
  7320. } else {
  7321. r = new RegExp(escapeChars(v), 'gi');
  7322. }
  7323. input = input.replace(r, customReplacements[v]);
  7324. });
  7325. // add all custom replacement to allowed charlist
  7326. for (ch in customReplacements) {
  7327. allowedChars += ch;
  7328. }
  7329. }
  7330. allowedChars += separator;
  7331. // escape all necessary chars
  7332. allowedChars = escapeChars(allowedChars);
  7333. // trim whitespaces
  7334. input = input.replace(/(^\s+|\s+$)/g, '');
  7335. lastCharWasSymbol = false;
  7336. lastCharWasDiatric = false;
  7337. for (i = 0, l = input.length; i < l; i++) {
  7338. ch = input[i];
  7339. if (isReplacedCustomChar(ch, customReplacements)) {
  7340. // don't convert a already converted char
  7341. lastCharWasSymbol = false;
  7342. } else if (langChar[ch]) {
  7343. // process language specific diactrics chars conversion
  7344. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? ' ' + langChar[ch] : langChar[ch];
  7345. lastCharWasSymbol = false;
  7346. } else if (ch in charMap) {
  7347. // the transliteration changes entirely when some special characters are added
  7348. if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
  7349. diatricString += ch;
  7350. ch = '';
  7351. } else if (lastCharWasDiatric === true) {
  7352. ch = diatricMap[diatricString] + charMap[ch];
  7353. diatricString = '';
  7354. } else {
  7355. // process diactrics chars
  7356. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? ' ' + charMap[ch] : charMap[ch];
  7357. }
  7358. lastCharWasSymbol = false;
  7359. lastCharWasDiatric = false;
  7360. } else if (ch in diatricMap) {
  7361. diatricString += ch;
  7362. ch = '';
  7363. // end of string, put the whole meaningful word
  7364. if (i === l - 1) {
  7365. ch = diatricMap[diatricString];
  7366. }
  7367. lastCharWasDiatric = true;
  7368. } else if (
  7369. // process symbol chars
  7370. symbol[ch] && !(uricFlag && uricChars
  7371. .indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars
  7372. // .indexOf(ch) !== -1) && !(markFlag && markChars
  7373. .indexOf(ch) !== -1)) {
  7374. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  7375. ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : '';
  7376. lastCharWasSymbol = true;
  7377. } else {
  7378. if (lastCharWasDiatric === true) {
  7379. ch = diatricMap[diatricString] + ch;
  7380. diatricString = '';
  7381. lastCharWasDiatric = false;
  7382. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  7383. // process latin chars
  7384. ch = ' ' + ch;
  7385. }
  7386. lastCharWasSymbol = false;
  7387. }
  7388. // add allowed chars
  7389. result += ch.replace(new RegExp('[^\\w\\s' + allowedChars + '_-]', 'g'), separator);
  7390. }
  7391. if (titleCase) {
  7392. result = result.replace(/(\w)(\S*)/g, function (_, i, r) {
  7393. var j = i.toUpperCase() + (r !== null ? r : '');
  7394. return (Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0) ? j : j.toLowerCase();
  7395. });
  7396. }
  7397. // eliminate duplicate separators
  7398. // add separator
  7399. // trim separators from start and end
  7400. result = result.replace(/\s+/g, separator)
  7401. .replace(new RegExp('\\' + separator + '+', 'g'), separator)
  7402. .replace(new RegExp('(^\\' + separator + '+|\\' + separator + '+$)', 'g'), '');
  7403. if (truncate && result.length > truncate) {
  7404. lucky = result.charAt(truncate) === separator;
  7405. result = result.slice(0, truncate);
  7406. if (!lucky) {
  7407. result = result.slice(0, result.lastIndexOf(separator));
  7408. }
  7409. }
  7410. if (!maintainCase && !titleCase) {
  7411. result = result.toLowerCase();
  7412. }
  7413. return result;
  7414. };
  7415. /**
  7416. * createSlug curried(opts)(input)
  7417. * @param {object|string} opts config object or input string
  7418. * @return {Function} function getSlugWithConfig()
  7419. **/
  7420. var createSlug = function createSlug(opts) {
  7421. /**
  7422. * getSlugWithConfig
  7423. * @param {string} input string
  7424. * @return {string} slug string
  7425. */
  7426. return function getSlugWithConfig(input) {
  7427. return getSlug(input, opts);
  7428. };
  7429. };
  7430. /**
  7431. * escape Chars
  7432. * @param {string} input string
  7433. */
  7434. var escapeChars = function escapeChars(input) {
  7435. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, '\\$&');
  7436. };
  7437. /**
  7438. * check if the char is an already converted char from custom list
  7439. * @param {char} ch character to check
  7440. * @param {object} customReplacements custom translation map
  7441. */
  7442. var isReplacedCustomChar = function (ch, customReplacements) {
  7443. for (var c in customReplacements) {
  7444. if (customReplacements[c] === ch) {
  7445. return true;
  7446. }
  7447. }
  7448. };
  7449. if ('object' !== 'undefined' && module.exports) {
  7450. // export functions for use in Node
  7451. module.exports = getSlug;
  7452. module.exports.createSlug = createSlug;
  7453. } else if (typeof undefined !== 'undefined' && undefined.amd) {
  7454. // export function for use in AMD
  7455. undefined([], function () {
  7456. return getSlug;
  7457. });
  7458. } else {
  7459. // don't overwrite global if exists
  7460. try {
  7461. if (root.getSlug || root.createSlug) {
  7462. throw 'speakingurl: globals exists /(getSlug|createSlug)/';
  7463. } else {
  7464. root.getSlug = getSlug;
  7465. root.createSlug = createSlug;
  7466. }
  7467. } catch (e) {}
  7468. }
  7469. })(commonjsGlobal);
  7470. });
  7471. var speakingurl_1 = speakingurl.createSlug;
  7472. var speakingurl$1 = speakingurl;
  7473. var urlJoin = createCommonjsModule(function (module) {
  7474. (function (name, context, definition) {
  7475. if ('object' !== 'undefined' && module.exports) module.exports = definition();
  7476. else if (typeof undefined === 'function' && undefined.amd) undefined(definition);
  7477. else context[name] = definition();
  7478. })('urljoin', commonjsGlobal, function () {
  7479. function normalize (strArray) {
  7480. var resultArray = [];
  7481. if (strArray.length === 0) { return ''; }
  7482. if (typeof strArray[0] !== 'string') {
  7483. throw new TypeError('Url must be a string. Received ' + strArray[0]);
  7484. }
  7485. // If the first part is a plain protocol, we combine it with the next part.
  7486. if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) {
  7487. var first = strArray.shift();
  7488. strArray[0] = first + strArray[0];
  7489. }
  7490. // There must be two or three slashes in the file protocol, two slashes in anything else.
  7491. if (strArray[0].match(/^file:\/\/\//)) {
  7492. strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///');
  7493. } else {
  7494. strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://');
  7495. }
  7496. for (var i = 0; i < strArray.length; i++) {
  7497. var component = strArray[i];
  7498. if (typeof component !== 'string') {
  7499. throw new TypeError('Url must be a string. Received ' + component);
  7500. }
  7501. if (component === '') { continue; }
  7502. if (i > 0) {
  7503. // Removing the starting slashes for each component but the first.
  7504. component = component.replace(/^[\/]+/, '');
  7505. }
  7506. if (i < strArray.length - 1) {
  7507. // Removing the ending slashes for each component but the last.
  7508. component = component.replace(/[\/]+$/, '');
  7509. } else {
  7510. // For the last component we will combine multiple slashes to a single one.
  7511. component = component.replace(/[\/]+$/, '/');
  7512. }
  7513. resultArray.push(component);
  7514. }
  7515. var str = resultArray.join('/');
  7516. // Each input component is now separated by a single slash except the possible first plain protocol part.
  7517. // remove trailing slash before parameters or hash
  7518. str = str.replace(/\/(\?|&|#[^!])/g, '$1');
  7519. // replace ? in parameters with &
  7520. var parts = str.split('?');
  7521. str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');
  7522. return str;
  7523. }
  7524. return function () {
  7525. var input;
  7526. if (typeof arguments[0] === 'object') {
  7527. input = arguments[0];
  7528. } else {
  7529. input = [].slice.call(arguments);
  7530. }
  7531. return normalize(input);
  7532. };
  7533. });
  7534. });
  7535. var uritemplate = createCommonjsModule(function (module) {
  7536. /*global unescape, module, define, window, global*/
  7537. /*
  7538. UriTemplate Copyright (c) 2012-2013 Franz Antesberger. All Rights Reserved.
  7539. Available via the MIT license.
  7540. */
  7541. (function (exportCallback) {
  7542. "use strict";
  7543. var UriTemplateError = (function () {
  7544. function UriTemplateError (options) {
  7545. this.options = options;
  7546. }
  7547. UriTemplateError.prototype.toString = function () {
  7548. if (JSON && JSON.stringify) {
  7549. return JSON.stringify(this.options);
  7550. }
  7551. else {
  7552. return this.options;
  7553. }
  7554. };
  7555. return UriTemplateError;
  7556. }());
  7557. var objectHelper = (function () {
  7558. function isArray (value) {
  7559. return Object.prototype.toString.apply(value) === '[object Array]';
  7560. }
  7561. function isString (value) {
  7562. return Object.prototype.toString.apply(value) === '[object String]';
  7563. }
  7564. function isNumber (value) {
  7565. return Object.prototype.toString.apply(value) === '[object Number]';
  7566. }
  7567. function isBoolean (value) {
  7568. return Object.prototype.toString.apply(value) === '[object Boolean]';
  7569. }
  7570. function join (arr, separator) {
  7571. var
  7572. result = '',
  7573. first = true,
  7574. index;
  7575. for (index = 0; index < arr.length; index += 1) {
  7576. if (first) {
  7577. first = false;
  7578. }
  7579. else {
  7580. result += separator;
  7581. }
  7582. result += arr[index];
  7583. }
  7584. return result;
  7585. }
  7586. function map (arr, mapper) {
  7587. var
  7588. result = [],
  7589. index = 0;
  7590. for (; index < arr.length; index += 1) {
  7591. result.push(mapper(arr[index]));
  7592. }
  7593. return result;
  7594. }
  7595. function filter (arr, predicate) {
  7596. var
  7597. result = [],
  7598. index = 0;
  7599. for (; index < arr.length; index += 1) {
  7600. if (predicate(arr[index])) {
  7601. result.push(arr[index]);
  7602. }
  7603. }
  7604. return result;
  7605. }
  7606. function deepFreezeUsingObjectFreeze (object) {
  7607. if (typeof object !== "object" || object === null) {
  7608. return object;
  7609. }
  7610. Object.freeze(object);
  7611. var property, propertyName;
  7612. for (propertyName in object) {
  7613. if (object.hasOwnProperty(propertyName)) {
  7614. property = object[propertyName];
  7615. // be aware, arrays are 'object', too
  7616. if (typeof property === "object") {
  7617. deepFreeze(property);
  7618. }
  7619. }
  7620. }
  7621. return object;
  7622. }
  7623. function deepFreeze (object) {
  7624. if (typeof Object.freeze === 'function') {
  7625. return deepFreezeUsingObjectFreeze(object);
  7626. }
  7627. return object;
  7628. }
  7629. return {
  7630. isArray: isArray,
  7631. isString: isString,
  7632. isNumber: isNumber,
  7633. isBoolean: isBoolean,
  7634. join: join,
  7635. map: map,
  7636. filter: filter,
  7637. deepFreeze: deepFreeze
  7638. };
  7639. }());
  7640. var charHelper = (function () {
  7641. function isAlpha (chr) {
  7642. return (chr >= 'a' && chr <= 'z') || ((chr >= 'A' && chr <= 'Z'));
  7643. }
  7644. function isDigit (chr) {
  7645. return chr >= '0' && chr <= '9';
  7646. }
  7647. function isHexDigit (chr) {
  7648. return isDigit(chr) || (chr >= 'a' && chr <= 'f') || (chr >= 'A' && chr <= 'F');
  7649. }
  7650. return {
  7651. isAlpha: isAlpha,
  7652. isDigit: isDigit,
  7653. isHexDigit: isHexDigit
  7654. };
  7655. }());
  7656. var pctEncoder = (function () {
  7657. var utf8 = {
  7658. encode: function (chr) {
  7659. // see http://ecmanaut.blogspot.de/2006/07/encoding-decoding-utf8-in-javascript.html
  7660. return unescape(encodeURIComponent(chr));
  7661. },
  7662. numBytes: function (firstCharCode) {
  7663. if (firstCharCode <= 0x7F) {
  7664. return 1;
  7665. }
  7666. else if (0xC2 <= firstCharCode && firstCharCode <= 0xDF) {
  7667. return 2;
  7668. }
  7669. else if (0xE0 <= firstCharCode && firstCharCode <= 0xEF) {
  7670. return 3;
  7671. }
  7672. else if (0xF0 <= firstCharCode && firstCharCode <= 0xF4) {
  7673. return 4;
  7674. }
  7675. // no valid first octet
  7676. return 0;
  7677. },
  7678. isValidFollowingCharCode: function (charCode) {
  7679. return 0x80 <= charCode && charCode <= 0xBF;
  7680. }
  7681. };
  7682. /**
  7683. * encodes a character, if needed or not.
  7684. * @param chr
  7685. * @return pct-encoded character
  7686. */
  7687. function encodeCharacter (chr) {
  7688. var
  7689. result = '',
  7690. octets = utf8.encode(chr),
  7691. octet,
  7692. index;
  7693. for (index = 0; index < octets.length; index += 1) {
  7694. octet = octets.charCodeAt(index);
  7695. result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();
  7696. }
  7697. return result;
  7698. }
  7699. /**
  7700. * Returns, whether the given text at start is in the form 'percent hex-digit hex-digit', like '%3F'
  7701. * @param text
  7702. * @param start
  7703. * @return {boolean|*|*}
  7704. */
  7705. function isPercentDigitDigit (text, start) {
  7706. return text.charAt(start) === '%' && charHelper.isHexDigit(text.charAt(start + 1)) && charHelper.isHexDigit(text.charAt(start + 2));
  7707. }
  7708. /**
  7709. * Parses a hex number from start with length 2.
  7710. * @param text a string
  7711. * @param start the start index of the 2-digit hex number
  7712. * @return {Number}
  7713. */
  7714. function parseHex2 (text, start) {
  7715. return parseInt(text.substr(start, 2), 16);
  7716. }
  7717. /**
  7718. * Returns whether or not the given char sequence is a correctly pct-encoded sequence.
  7719. * @param chr
  7720. * @return {boolean}
  7721. */
  7722. function isPctEncoded (chr) {
  7723. if (!isPercentDigitDigit(chr, 0)) {
  7724. return false;
  7725. }
  7726. var firstCharCode = parseHex2(chr, 1);
  7727. var numBytes = utf8.numBytes(firstCharCode);
  7728. if (numBytes === 0) {
  7729. return false;
  7730. }
  7731. for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
  7732. if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
  7733. return false;
  7734. }
  7735. }
  7736. return true;
  7737. }
  7738. /**
  7739. * Reads as much as needed from the text, e.g. '%20' or '%C3%B6'. It does not decode!
  7740. * @param text
  7741. * @param startIndex
  7742. * @return the character or pct-string of the text at startIndex
  7743. */
  7744. function pctCharAt(text, startIndex) {
  7745. var chr = text.charAt(startIndex);
  7746. if (!isPercentDigitDigit(text, startIndex)) {
  7747. return chr;
  7748. }
  7749. var utf8CharCode = parseHex2(text, startIndex + 1);
  7750. var numBytes = utf8.numBytes(utf8CharCode);
  7751. if (numBytes === 0) {
  7752. return chr;
  7753. }
  7754. for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
  7755. if (!isPercentDigitDigit(text, startIndex + 3 * byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(text, startIndex + 3 * byteNumber + 1))) {
  7756. return chr;
  7757. }
  7758. }
  7759. return text.substr(startIndex, 3 * numBytes);
  7760. }
  7761. return {
  7762. encodeCharacter: encodeCharacter,
  7763. isPctEncoded: isPctEncoded,
  7764. pctCharAt: pctCharAt
  7765. };
  7766. }());
  7767. var rfcCharHelper = (function () {
  7768. /**
  7769. * Returns if an character is an varchar character according 2.3 of rfc 6570
  7770. * @param chr
  7771. * @return (Boolean)
  7772. */
  7773. function isVarchar (chr) {
  7774. return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '_' || pctEncoder.isPctEncoded(chr);
  7775. }
  7776. /**
  7777. * Returns if chr is an unreserved character according 1.5 of rfc 6570
  7778. * @param chr
  7779. * @return {Boolean}
  7780. */
  7781. function isUnreserved (chr) {
  7782. return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '-' || chr === '.' || chr === '_' || chr === '~';
  7783. }
  7784. /**
  7785. * Returns if chr is an reserved character according 1.5 of rfc 6570
  7786. * or the percent character mentioned in 3.2.1.
  7787. * @param chr
  7788. * @return {Boolean}
  7789. */
  7790. function isReserved (chr) {
  7791. return chr === ':' || chr === '/' || chr === '?' || chr === '#' || chr === '[' || chr === ']' || chr === '@' || chr === '!' || chr === '$' || chr === '&' || chr === '(' ||
  7792. chr === ')' || chr === '*' || chr === '+' || chr === ',' || chr === ';' || chr === '=' || chr === "'";
  7793. }
  7794. return {
  7795. isVarchar: isVarchar,
  7796. isUnreserved: isUnreserved,
  7797. isReserved: isReserved
  7798. };
  7799. }());
  7800. /**
  7801. * encoding of rfc 6570
  7802. */
  7803. var encodingHelper = (function () {
  7804. function encode (text, passReserved) {
  7805. var
  7806. result = '',
  7807. index,
  7808. chr = '';
  7809. if (typeof text === "number" || typeof text === "boolean") {
  7810. text = text.toString();
  7811. }
  7812. for (index = 0; index < text.length; index += chr.length) {
  7813. chr = text.charAt(index);
  7814. result += rfcCharHelper.isUnreserved(chr) || (passReserved && rfcCharHelper.isReserved(chr)) ? chr : pctEncoder.encodeCharacter(chr);
  7815. }
  7816. return result;
  7817. }
  7818. function encodePassReserved (text) {
  7819. return encode(text, true);
  7820. }
  7821. function encodeLiteralCharacter (literal, index) {
  7822. var chr = pctEncoder.pctCharAt(literal, index);
  7823. if (chr.length > 1) {
  7824. return chr;
  7825. }
  7826. else {
  7827. return rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);
  7828. }
  7829. }
  7830. function encodeLiteral (literal) {
  7831. var
  7832. result = '',
  7833. index,
  7834. chr = '';
  7835. for (index = 0; index < literal.length; index += chr.length) {
  7836. chr = pctEncoder.pctCharAt(literal, index);
  7837. if (chr.length > 1) {
  7838. result += chr;
  7839. }
  7840. else {
  7841. result += rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);
  7842. }
  7843. }
  7844. return result;
  7845. }
  7846. return {
  7847. encode: encode,
  7848. encodePassReserved: encodePassReserved,
  7849. encodeLiteral: encodeLiteral,
  7850. encodeLiteralCharacter: encodeLiteralCharacter
  7851. };
  7852. }());
  7853. // the operators defined by rfc 6570
  7854. var operators = (function () {
  7855. var
  7856. bySymbol = {};
  7857. function create (symbol) {
  7858. bySymbol[symbol] = {
  7859. symbol: symbol,
  7860. separator: (symbol === '?') ? '&' : (symbol === '' || symbol === '+' || symbol === '#') ? ',' : symbol,
  7861. named: symbol === ';' || symbol === '&' || symbol === '?',
  7862. ifEmpty: (symbol === '&' || symbol === '?') ? '=' : '',
  7863. first: (symbol === '+' ) ? '' : symbol,
  7864. encode: (symbol === '+' || symbol === '#') ? encodingHelper.encodePassReserved : encodingHelper.encode,
  7865. toString: function () {
  7866. return this.symbol;
  7867. }
  7868. };
  7869. }
  7870. create('');
  7871. create('+');
  7872. create('#');
  7873. create('.');
  7874. create('/');
  7875. create(';');
  7876. create('?');
  7877. create('&');
  7878. return {
  7879. valueOf: function (chr) {
  7880. if (bySymbol[chr]) {
  7881. return bySymbol[chr];
  7882. }
  7883. if ("=,!@|".indexOf(chr) >= 0) {
  7884. return null;
  7885. }
  7886. return bySymbol[''];
  7887. }
  7888. };
  7889. }());
  7890. /**
  7891. * Detects, whether a given element is defined in the sense of rfc 6570
  7892. * Section 2.3 of the RFC makes clear defintions:
  7893. * * undefined and null are not defined.
  7894. * * the empty string is defined
  7895. * * an array ("list") is defined, if it is not empty (even if all elements are not defined)
  7896. * * an object ("map") is defined, if it contains at least one property with defined value
  7897. * @param object
  7898. * @return {Boolean}
  7899. */
  7900. function isDefined (object) {
  7901. var
  7902. propertyName;
  7903. if (object === null || object === undefined) {
  7904. return false;
  7905. }
  7906. if (objectHelper.isArray(object)) {
  7907. // Section 2.3: A variable defined as a list value is considered undefined if the list contains zero members
  7908. return object.length > 0;
  7909. }
  7910. if (typeof object === "string" || typeof object === "number" || typeof object === "boolean") {
  7911. // falsy values like empty strings, false or 0 are "defined"
  7912. return true;
  7913. }
  7914. // else Object
  7915. for (propertyName in object) {
  7916. if (object.hasOwnProperty(propertyName) && isDefined(object[propertyName])) {
  7917. return true;
  7918. }
  7919. }
  7920. return false;
  7921. }
  7922. var LiteralExpression = (function () {
  7923. function LiteralExpression (literal) {
  7924. this.literal = encodingHelper.encodeLiteral(literal);
  7925. }
  7926. LiteralExpression.prototype.expand = function () {
  7927. return this.literal;
  7928. };
  7929. LiteralExpression.prototype.toString = LiteralExpression.prototype.expand;
  7930. return LiteralExpression;
  7931. }());
  7932. var parse = (function () {
  7933. function parseExpression (expressionText) {
  7934. var
  7935. operator,
  7936. varspecs = [],
  7937. varspec = null,
  7938. varnameStart = null,
  7939. maxLengthStart = null,
  7940. index,
  7941. chr = '';
  7942. function closeVarname () {
  7943. var varname = expressionText.substring(varnameStart, index);
  7944. if (varname.length === 0) {
  7945. throw new UriTemplateError({expressionText: expressionText, message: "a varname must be specified", position: index});
  7946. }
  7947. varspec = {varname: varname, exploded: false, maxLength: null};
  7948. varnameStart = null;
  7949. }
  7950. function closeMaxLength () {
  7951. if (maxLengthStart === index) {
  7952. throw new UriTemplateError({expressionText: expressionText, message: "after a ':' you have to specify the length", position: index});
  7953. }
  7954. varspec.maxLength = parseInt(expressionText.substring(maxLengthStart, index), 10);
  7955. maxLengthStart = null;
  7956. }
  7957. operator = (function (operatorText) {
  7958. var op = operators.valueOf(operatorText);
  7959. if (op === null) {
  7960. throw new UriTemplateError({expressionText: expressionText, message: "illegal use of reserved operator", position: index, operator: operatorText});
  7961. }
  7962. return op;
  7963. }(expressionText.charAt(0)));
  7964. index = operator.symbol.length;
  7965. varnameStart = index;
  7966. for (; index < expressionText.length; index += chr.length) {
  7967. chr = pctEncoder.pctCharAt(expressionText, index);
  7968. if (varnameStart !== null) {
  7969. // the spec says: varname = varchar *( ["."] varchar )
  7970. // so a dot is allowed except for the first char
  7971. if (chr === '.') {
  7972. if (varnameStart === index) {
  7973. throw new UriTemplateError({expressionText: expressionText, message: "a varname MUST NOT start with a dot", position: index});
  7974. }
  7975. continue;
  7976. }
  7977. if (rfcCharHelper.isVarchar(chr)) {
  7978. continue;
  7979. }
  7980. closeVarname();
  7981. }
  7982. if (maxLengthStart !== null) {
  7983. if (index === maxLengthStart && chr === '0') {
  7984. throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must not start with digit 0", position: index});
  7985. }
  7986. if (charHelper.isDigit(chr)) {
  7987. if (index - maxLengthStart >= 4) {
  7988. throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must have max 4 digits", position: index});
  7989. }
  7990. continue;
  7991. }
  7992. closeMaxLength();
  7993. }
  7994. if (chr === ':') {
  7995. if (varspec.maxLength !== null) {
  7996. throw new UriTemplateError({expressionText: expressionText, message: "only one :maxLength is allowed per varspec", position: index});
  7997. }
  7998. if (varspec.exploded) {
  7999. throw new UriTemplateError({expressionText: expressionText, message: "an exploeded varspec MUST NOT be varspeced", position: index});
  8000. }
  8001. maxLengthStart = index + 1;
  8002. continue;
  8003. }
  8004. if (chr === '*') {
  8005. if (varspec === null) {
  8006. throw new UriTemplateError({expressionText: expressionText, message: "exploded without varspec", position: index});
  8007. }
  8008. if (varspec.exploded) {
  8009. throw new UriTemplateError({expressionText: expressionText, message: "exploded twice", position: index});
  8010. }
  8011. if (varspec.maxLength) {
  8012. throw new UriTemplateError({expressionText: expressionText, message: "an explode (*) MUST NOT follow to a prefix", position: index});
  8013. }
  8014. varspec.exploded = true;
  8015. continue;
  8016. }
  8017. // the only legal character now is the comma
  8018. if (chr === ',') {
  8019. varspecs.push(varspec);
  8020. varspec = null;
  8021. varnameStart = index + 1;
  8022. continue;
  8023. }
  8024. throw new UriTemplateError({expressionText: expressionText, message: "illegal character", character: chr, position: index});
  8025. } // for chr
  8026. if (varnameStart !== null) {
  8027. closeVarname();
  8028. }
  8029. if (maxLengthStart !== null) {
  8030. closeMaxLength();
  8031. }
  8032. varspecs.push(varspec);
  8033. return new VariableExpression(expressionText, operator, varspecs);
  8034. }
  8035. function parse (uriTemplateText) {
  8036. // assert filled string
  8037. var
  8038. index,
  8039. chr,
  8040. expressions = [],
  8041. braceOpenIndex = null,
  8042. literalStart = 0;
  8043. for (index = 0; index < uriTemplateText.length; index += 1) {
  8044. chr = uriTemplateText.charAt(index);
  8045. if (literalStart !== null) {
  8046. if (chr === '}') {
  8047. throw new UriTemplateError({templateText: uriTemplateText, message: "unopened brace closed", position: index});
  8048. }
  8049. if (chr === '{') {
  8050. if (literalStart < index) {
  8051. expressions.push(new LiteralExpression(uriTemplateText.substring(literalStart, index)));
  8052. }
  8053. literalStart = null;
  8054. braceOpenIndex = index;
  8055. }
  8056. continue;
  8057. }
  8058. if (braceOpenIndex !== null) {
  8059. // here just { is forbidden
  8060. if (chr === '{') {
  8061. throw new UriTemplateError({templateText: uriTemplateText, message: "brace already opened", position: index});
  8062. }
  8063. if (chr === '}') {
  8064. if (braceOpenIndex + 1 === index) {
  8065. throw new UriTemplateError({templateText: uriTemplateText, message: "empty braces", position: braceOpenIndex});
  8066. }
  8067. try {
  8068. expressions.push(parseExpression(uriTemplateText.substring(braceOpenIndex + 1, index)));
  8069. }
  8070. catch (error) {
  8071. if (error.prototype === UriTemplateError.prototype) {
  8072. throw new UriTemplateError({templateText: uriTemplateText, message: error.options.message, position: braceOpenIndex + error.options.position, details: error.options});
  8073. }
  8074. throw error;
  8075. }
  8076. braceOpenIndex = null;
  8077. literalStart = index + 1;
  8078. }
  8079. continue;
  8080. }
  8081. throw new Error('reached unreachable code');
  8082. }
  8083. if (braceOpenIndex !== null) {
  8084. throw new UriTemplateError({templateText: uriTemplateText, message: "unclosed brace", position: braceOpenIndex});
  8085. }
  8086. if (literalStart < uriTemplateText.length) {
  8087. expressions.push(new LiteralExpression(uriTemplateText.substr(literalStart)));
  8088. }
  8089. return new UriTemplate(uriTemplateText, expressions);
  8090. }
  8091. return parse;
  8092. }());
  8093. var VariableExpression = (function () {
  8094. // helper function if JSON is not available
  8095. function prettyPrint (value) {
  8096. return (JSON && JSON.stringify) ? JSON.stringify(value) : value;
  8097. }
  8098. function isEmpty (value) {
  8099. if (!isDefined(value)) {
  8100. return true;
  8101. }
  8102. if (objectHelper.isString(value)) {
  8103. return value === '';
  8104. }
  8105. if (objectHelper.isNumber(value) || objectHelper.isBoolean(value)) {
  8106. return false;
  8107. }
  8108. if (objectHelper.isArray(value)) {
  8109. return value.length === 0;
  8110. }
  8111. for (var propertyName in value) {
  8112. if (value.hasOwnProperty(propertyName)) {
  8113. return false;
  8114. }
  8115. }
  8116. return true;
  8117. }
  8118. function propertyArray (object) {
  8119. var
  8120. result = [],
  8121. propertyName;
  8122. for (propertyName in object) {
  8123. if (object.hasOwnProperty(propertyName)) {
  8124. result.push({name: propertyName, value: object[propertyName]});
  8125. }
  8126. }
  8127. return result;
  8128. }
  8129. function VariableExpression (templateText, operator, varspecs) {
  8130. this.templateText = templateText;
  8131. this.operator = operator;
  8132. this.varspecs = varspecs;
  8133. }
  8134. VariableExpression.prototype.toString = function () {
  8135. return this.templateText;
  8136. };
  8137. function expandSimpleValue(varspec, operator, value) {
  8138. var result = '';
  8139. value = value.toString();
  8140. if (operator.named) {
  8141. result += encodingHelper.encodeLiteral(varspec.varname);
  8142. if (value === '') {
  8143. result += operator.ifEmpty;
  8144. return result;
  8145. }
  8146. result += '=';
  8147. }
  8148. if (varspec.maxLength !== null) {
  8149. value = value.substr(0, varspec.maxLength);
  8150. }
  8151. result += operator.encode(value);
  8152. return result;
  8153. }
  8154. function valueDefined (nameValue) {
  8155. return isDefined(nameValue.value);
  8156. }
  8157. function expandNotExploded(varspec, operator, value) {
  8158. var
  8159. arr = [],
  8160. result = '';
  8161. if (operator.named) {
  8162. result += encodingHelper.encodeLiteral(varspec.varname);
  8163. if (isEmpty(value)) {
  8164. result += operator.ifEmpty;
  8165. return result;
  8166. }
  8167. result += '=';
  8168. }
  8169. if (objectHelper.isArray(value)) {
  8170. arr = value;
  8171. arr = objectHelper.filter(arr, isDefined);
  8172. arr = objectHelper.map(arr, operator.encode);
  8173. result += objectHelper.join(arr, ',');
  8174. }
  8175. else {
  8176. arr = propertyArray(value);
  8177. arr = objectHelper.filter(arr, valueDefined);
  8178. arr = objectHelper.map(arr, function (nameValue) {
  8179. return operator.encode(nameValue.name) + ',' + operator.encode(nameValue.value);
  8180. });
  8181. result += objectHelper.join(arr, ',');
  8182. }
  8183. return result;
  8184. }
  8185. function expandExplodedNamed (varspec, operator, value) {
  8186. var
  8187. isArray = objectHelper.isArray(value),
  8188. arr = [];
  8189. if (isArray) {
  8190. arr = value;
  8191. arr = objectHelper.filter(arr, isDefined);
  8192. arr = objectHelper.map(arr, function (listElement) {
  8193. var tmp = encodingHelper.encodeLiteral(varspec.varname);
  8194. if (isEmpty(listElement)) {
  8195. tmp += operator.ifEmpty;
  8196. }
  8197. else {
  8198. tmp += '=' + operator.encode(listElement);
  8199. }
  8200. return tmp;
  8201. });
  8202. }
  8203. else {
  8204. arr = propertyArray(value);
  8205. arr = objectHelper.filter(arr, valueDefined);
  8206. arr = objectHelper.map(arr, function (nameValue) {
  8207. var tmp = encodingHelper.encodeLiteral(nameValue.name);
  8208. if (isEmpty(nameValue.value)) {
  8209. tmp += operator.ifEmpty;
  8210. }
  8211. else {
  8212. tmp += '=' + operator.encode(nameValue.value);
  8213. }
  8214. return tmp;
  8215. });
  8216. }
  8217. return objectHelper.join(arr, operator.separator);
  8218. }
  8219. function expandExplodedUnnamed (operator, value) {
  8220. var
  8221. arr = [],
  8222. result = '';
  8223. if (objectHelper.isArray(value)) {
  8224. arr = value;
  8225. arr = objectHelper.filter(arr, isDefined);
  8226. arr = objectHelper.map(arr, operator.encode);
  8227. result += objectHelper.join(arr, operator.separator);
  8228. }
  8229. else {
  8230. arr = propertyArray(value);
  8231. arr = objectHelper.filter(arr, function (nameValue) {
  8232. return isDefined(nameValue.value);
  8233. });
  8234. arr = objectHelper.map(arr, function (nameValue) {
  8235. return operator.encode(nameValue.name) + '=' + operator.encode(nameValue.value);
  8236. });
  8237. result += objectHelper.join(arr, operator.separator);
  8238. }
  8239. return result;
  8240. }
  8241. VariableExpression.prototype.expand = function (variables) {
  8242. var
  8243. expanded = [],
  8244. index,
  8245. varspec,
  8246. value,
  8247. valueIsArr,
  8248. oneExploded = false,
  8249. operator = this.operator;
  8250. // expand each varspec and join with operator's separator
  8251. for (index = 0; index < this.varspecs.length; index += 1) {
  8252. varspec = this.varspecs[index];
  8253. value = variables[varspec.varname];
  8254. // if (!isDefined(value)) {
  8255. // if (variables.hasOwnProperty(varspec.name)) {
  8256. if (value === null || value === undefined) {
  8257. continue;
  8258. }
  8259. if (varspec.exploded) {
  8260. oneExploded = true;
  8261. }
  8262. valueIsArr = objectHelper.isArray(value);
  8263. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  8264. expanded.push(expandSimpleValue(varspec, operator, value));
  8265. }
  8266. else if (varspec.maxLength && isDefined(value)) {
  8267. // 2.4.1 of the spec says: "Prefix modifiers are not applicable to variables that have composite values."
  8268. throw new Error('Prefix modifiers are not applicable to variables that have composite values. You tried to expand ' + this + " with " + prettyPrint(value));
  8269. }
  8270. else if (!varspec.exploded) {
  8271. if (operator.named || !isEmpty(value)) {
  8272. expanded.push(expandNotExploded(varspec, operator, value));
  8273. }
  8274. }
  8275. else if (isDefined(value)) {
  8276. if (operator.named) {
  8277. expanded.push(expandExplodedNamed(varspec, operator, value));
  8278. }
  8279. else {
  8280. expanded.push(expandExplodedUnnamed(operator, value));
  8281. }
  8282. }
  8283. }
  8284. if (expanded.length === 0) {
  8285. return "";
  8286. }
  8287. else {
  8288. return operator.first + objectHelper.join(expanded, operator.separator);
  8289. }
  8290. };
  8291. return VariableExpression;
  8292. }());
  8293. var UriTemplate = (function () {
  8294. function UriTemplate (templateText, expressions) {
  8295. this.templateText = templateText;
  8296. this.expressions = expressions;
  8297. objectHelper.deepFreeze(this);
  8298. }
  8299. UriTemplate.prototype.toString = function () {
  8300. return this.templateText;
  8301. };
  8302. UriTemplate.prototype.expand = function (variables) {
  8303. // this.expressions.map(function (expression) {return expression.expand(variables);}).join('');
  8304. var
  8305. index,
  8306. result = '';
  8307. for (index = 0; index < this.expressions.length; index += 1) {
  8308. result += this.expressions[index].expand(variables);
  8309. }
  8310. return result;
  8311. };
  8312. UriTemplate.parse = parse;
  8313. UriTemplate.UriTemplateError = UriTemplateError;
  8314. return UriTemplate;
  8315. }());
  8316. exportCallback(UriTemplate);
  8317. }(function (UriTemplate) {
  8318. "use strict";
  8319. // export UriTemplate, when module is present, or pass it to window or global
  8320. if ('object' !== "undefined") {
  8321. module.exports = UriTemplate;
  8322. }
  8323. else if (typeof undefined === "function") {
  8324. undefined([],function() {
  8325. return UriTemplate;
  8326. });
  8327. }
  8328. else if (typeof window !== "undefined") {
  8329. window.UriTemplate = UriTemplate;
  8330. }
  8331. else {
  8332. commonjsGlobal.UriTemplate = UriTemplate;
  8333. }
  8334. }
  8335. ));
  8336. });
  8337. var store2 = createCommonjsModule(function (module) {
  8338. /*! store2 - v2.10.0 - 2019-09-27
  8339. * Copyright (c) 2019 Nathan Bubna; Licensed (MIT OR GPL-3.0) */
  8340. ;(function(window, define) {
  8341. var _ = {
  8342. version: "2.10.0",
  8343. areas: {},
  8344. apis: {},
  8345. // utilities
  8346. inherit: function(api, o) {
  8347. for (var p in api) {
  8348. if (!o.hasOwnProperty(p)) {
  8349. Object.defineProperty(o, p, Object.getOwnPropertyDescriptor(api, p));
  8350. }
  8351. }
  8352. return o;
  8353. },
  8354. stringify: function(d) {
  8355. return d === undefined || typeof d === "function" ? d+'' : JSON.stringify(d);
  8356. },
  8357. parse: function(s) {
  8358. // if it doesn't parse, return as is
  8359. try{ return JSON.parse(s); }catch(e){ return s; }
  8360. },
  8361. // extension hooks
  8362. fn: function(name, fn) {
  8363. _.storeAPI[name] = fn;
  8364. for (var api in _.apis) {
  8365. _.apis[api][name] = fn;
  8366. }
  8367. },
  8368. get: function(area, key){ return area.getItem(key); },
  8369. set: function(area, key, string){ area.setItem(key, string); },
  8370. remove: function(area, key){ area.removeItem(key); },
  8371. key: function(area, i){ return area.key(i); },
  8372. length: function(area){ return area.length; },
  8373. clear: function(area){ area.clear(); },
  8374. // core functions
  8375. Store: function(id, area, namespace) {
  8376. var store = _.inherit(_.storeAPI, function(key, data, overwrite) {
  8377. if (arguments.length === 0){ return store.getAll(); }
  8378. if (typeof data === "function"){ return store.transact(key, data, overwrite); }// fn=data, alt=overwrite
  8379. if (data !== undefined){ return store.set(key, data, overwrite); }
  8380. if (typeof key === "string" || typeof key === "number"){ return store.get(key); }
  8381. if (typeof key === "function"){ return store.each(key); }
  8382. if (!key){ return store.clear(); }
  8383. return store.setAll(key, data);// overwrite=data, data=key
  8384. });
  8385. store._id = id;
  8386. try {
  8387. var testKey = '_-bad-_';
  8388. area.setItem(testKey, 'wolf');
  8389. store._area = area;
  8390. area.removeItem(testKey);
  8391. } catch (e) {}
  8392. if (!store._area) {
  8393. store._area = _.storage('fake');
  8394. }
  8395. store._ns = namespace || '';
  8396. if (!_.areas[id]) {
  8397. _.areas[id] = store._area;
  8398. }
  8399. if (!_.apis[store._ns+store._id]) {
  8400. _.apis[store._ns+store._id] = store;
  8401. }
  8402. return store;
  8403. },
  8404. storeAPI: {
  8405. // admin functions
  8406. area: function(id, area) {
  8407. var store = this[id];
  8408. if (!store || !store.area) {
  8409. store = _.Store(id, area, this._ns);//new area-specific api in this namespace
  8410. if (!this[id]){ this[id] = store; }
  8411. }
  8412. return store;
  8413. },
  8414. namespace: function(namespace, singleArea) {
  8415. if (!namespace){
  8416. return this._ns ? this._ns.substring(0,this._ns.length-1) : '';
  8417. }
  8418. var ns = namespace, store = this[ns];
  8419. if (!store || !store.namespace) {
  8420. store = _.Store(this._id, this._area, this._ns+ns+'.');//new namespaced api
  8421. if (!this[ns]){ this[ns] = store; }
  8422. if (!singleArea) {
  8423. for (var name in _.areas) {
  8424. store.area(name, _.areas[name]);
  8425. }
  8426. }
  8427. }
  8428. return store;
  8429. },
  8430. isFake: function(){ return this._area.name === 'fake'; },
  8431. toString: function() {
  8432. return 'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';
  8433. },
  8434. // storage functions
  8435. has: function(key) {
  8436. if (this._area.has) {
  8437. return this._area.has(this._in(key));//extension hook
  8438. }
  8439. return !!(this._in(key) in this._area);
  8440. },
  8441. size: function(){ return this.keys().length; },
  8442. each: function(fn, fill) {// fill is used by keys(fillList) and getAll(fillList))
  8443. for (var i=0, m=_.length(this._area); i<m; i++) {
  8444. var key = this._out(_.key(this._area, i));
  8445. if (key !== undefined) {
  8446. if (fn.call(this, key, this.get(key), fill) === false) {
  8447. break;
  8448. }
  8449. }
  8450. if (m > _.length(this._area)) { m--; i--; }// in case of removeItem
  8451. }
  8452. return fill || this;
  8453. },
  8454. keys: function(fillList) {
  8455. return this.each(function(k, v, list){ list.push(k); }, fillList || []);
  8456. },
  8457. get: function(key, alt) {
  8458. var s = _.get(this._area, this._in(key));
  8459. return s !== null ? _.parse(s) : alt || s;// support alt for easy default mgmt
  8460. },
  8461. getAll: function(fillObj) {
  8462. return this.each(function(k, v, all){ all[k] = v; }, fillObj || {});
  8463. },
  8464. transact: function(key, fn, alt) {
  8465. var val = this.get(key, alt),
  8466. ret = fn(val);
  8467. this.set(key, ret === undefined ? val : ret);
  8468. return this;
  8469. },
  8470. set: function(key, data, overwrite) {
  8471. var d = this.get(key);
  8472. if (d != null && overwrite === false) {
  8473. return data;
  8474. }
  8475. return _.set(this._area, this._in(key), _.stringify(data), overwrite) || d;
  8476. },
  8477. setAll: function(data, overwrite) {
  8478. var changed, val;
  8479. for (var key in data) {
  8480. val = data[key];
  8481. if (this.set(key, val, overwrite) !== val) {
  8482. changed = true;
  8483. }
  8484. }
  8485. return changed;
  8486. },
  8487. add: function(key, data) {
  8488. var d = this.get(key);
  8489. if (d instanceof Array) {
  8490. data = d.concat(data);
  8491. } else if (d !== null) {
  8492. var type = typeof d;
  8493. if (type === typeof data && type === 'object') {
  8494. for (var k in data) {
  8495. d[k] = data[k];
  8496. }
  8497. data = d;
  8498. } else {
  8499. data = d + data;
  8500. }
  8501. }
  8502. _.set(this._area, this._in(key), _.stringify(data));
  8503. return data;
  8504. },
  8505. remove: function(key, alt) {
  8506. var d = this.get(key, alt);
  8507. _.remove(this._area, this._in(key));
  8508. return d;
  8509. },
  8510. clear: function() {
  8511. if (!this._ns) {
  8512. _.clear(this._area);
  8513. } else {
  8514. this.each(function(k){ _.remove(this._area, this._in(k)); }, 1);
  8515. }
  8516. return this;
  8517. },
  8518. clearAll: function() {
  8519. var area = this._area;
  8520. for (var id in _.areas) {
  8521. if (_.areas.hasOwnProperty(id)) {
  8522. this._area = _.areas[id];
  8523. this.clear();
  8524. }
  8525. }
  8526. this._area = area;
  8527. return this;
  8528. },
  8529. // internal use functions
  8530. _in: function(k) {
  8531. if (typeof k !== "string"){ k = _.stringify(k); }
  8532. return this._ns ? this._ns + k : k;
  8533. },
  8534. _out: function(k) {
  8535. return this._ns ?
  8536. k && k.indexOf(this._ns) === 0 ?
  8537. k.substring(this._ns.length) :
  8538. undefined : // so each() knows to skip it
  8539. k;
  8540. }
  8541. },// end _.storeAPI
  8542. storage: function(name) {
  8543. return _.inherit(_.storageAPI, { items: {}, name: name });
  8544. },
  8545. storageAPI: {
  8546. length: 0,
  8547. has: function(k){ return this.items.hasOwnProperty(k); },
  8548. key: function(i) {
  8549. var c = 0;
  8550. for (var k in this.items){
  8551. if (this.has(k) && i === c++) {
  8552. return k;
  8553. }
  8554. }
  8555. },
  8556. setItem: function(k, v) {
  8557. if (!this.has(k)) {
  8558. this.length++;
  8559. }
  8560. this.items[k] = v;
  8561. },
  8562. removeItem: function(k) {
  8563. if (this.has(k)) {
  8564. delete this.items[k];
  8565. this.length--;
  8566. }
  8567. },
  8568. getItem: function(k){ return this.has(k) ? this.items[k] : null; },
  8569. clear: function(){ for (var k in this.items){ this.removeItem(k); } }
  8570. }// end _.storageAPI
  8571. };
  8572. var store =
  8573. // safely set this up (throws error in IE10/32bit mode for local files)
  8574. _.Store("local", (function(){try{ return localStorage; }catch(e){}})());
  8575. store.local = store;// for completeness
  8576. store._ = _;// for extenders and debuggers...
  8577. // safely setup store.session (throws exception in FF for file:/// urls)
  8578. store.area("session", (function(){try{ return sessionStorage; }catch(e){}})());
  8579. store.area("page", _.storage("page"));
  8580. if (typeof define === 'function' && define.amd !== undefined) {
  8581. define('store2', [], function () {
  8582. return store;
  8583. });
  8584. } else if ('object' !== 'undefined' && module.exports) {
  8585. module.exports = store;
  8586. } else {
  8587. // expose the primary store fn to the global object and save conflicts
  8588. if (window.store){ _.conflict = window.store; }
  8589. window.store = store;
  8590. }
  8591. })(commonjsGlobal, commonjsGlobal && commonjsGlobal.define);
  8592. });
  8593. 'use strict';
  8594. var bind$1 = function bind(fn, thisArg) {
  8595. return function wrap() {
  8596. var args = new Array(arguments.length);
  8597. for (var i = 0; i < args.length; i++) {
  8598. args[i] = arguments[i];
  8599. }
  8600. return fn.apply(thisArg, args);
  8601. };
  8602. };
  8603. 'use strict';
  8604. /*global toString:true*/
  8605. // utils is a library of generic helper functions non-specific to axios
  8606. var toString = Object.prototype.toString;
  8607. /**
  8608. * Determine if a value is an Array
  8609. *
  8610. * @param {Object} val The value to test
  8611. * @returns {boolean} True if value is an Array, otherwise false
  8612. */
  8613. function isArray(val) {
  8614. return toString.call(val) === '[object Array]';
  8615. }
  8616. /**
  8617. * Determine if a value is undefined
  8618. *
  8619. * @param {Object} val The value to test
  8620. * @returns {boolean} True if the value is undefined, otherwise false
  8621. */
  8622. function isUndefined(val) {
  8623. return typeof val === 'undefined';
  8624. }
  8625. /**
  8626. * Determine if a value is a Buffer
  8627. *
  8628. * @param {Object} val The value to test
  8629. * @returns {boolean} True if value is a Buffer, otherwise false
  8630. */
  8631. function isBuffer(val) {
  8632. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  8633. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  8634. }
  8635. /**
  8636. * Determine if a value is an ArrayBuffer
  8637. *
  8638. * @param {Object} val The value to test
  8639. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  8640. */
  8641. function isArrayBuffer(val) {
  8642. return toString.call(val) === '[object ArrayBuffer]';
  8643. }
  8644. /**
  8645. * Determine if a value is a FormData
  8646. *
  8647. * @param {Object} val The value to test
  8648. * @returns {boolean} True if value is an FormData, otherwise false
  8649. */
  8650. function isFormData(val) {
  8651. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  8652. }
  8653. /**
  8654. * Determine if a value is a view on an ArrayBuffer
  8655. *
  8656. * @param {Object} val The value to test
  8657. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  8658. */
  8659. function isArrayBufferView(val) {
  8660. var result;
  8661. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  8662. result = ArrayBuffer.isView(val);
  8663. } else {
  8664. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  8665. }
  8666. return result;
  8667. }
  8668. /**
  8669. * Determine if a value is a String
  8670. *
  8671. * @param {Object} val The value to test
  8672. * @returns {boolean} True if value is a String, otherwise false
  8673. */
  8674. function isString(val) {
  8675. return typeof val === 'string';
  8676. }
  8677. /**
  8678. * Determine if a value is a Number
  8679. *
  8680. * @param {Object} val The value to test
  8681. * @returns {boolean} True if value is a Number, otherwise false
  8682. */
  8683. function isNumber(val) {
  8684. return typeof val === 'number';
  8685. }
  8686. /**
  8687. * Determine if a value is an Object
  8688. *
  8689. * @param {Object} val The value to test
  8690. * @returns {boolean} True if value is an Object, otherwise false
  8691. */
  8692. function isObject(val) {
  8693. return val !== null && typeof val === 'object';
  8694. }
  8695. /**
  8696. * Determine if a value is a Date
  8697. *
  8698. * @param {Object} val The value to test
  8699. * @returns {boolean} True if value is a Date, otherwise false
  8700. */
  8701. function isDate(val) {
  8702. return toString.call(val) === '[object Date]';
  8703. }
  8704. /**
  8705. * Determine if a value is a File
  8706. *
  8707. * @param {Object} val The value to test
  8708. * @returns {boolean} True if value is a File, otherwise false
  8709. */
  8710. function isFile(val) {
  8711. return toString.call(val) === '[object File]';
  8712. }
  8713. /**
  8714. * Determine if a value is a Blob
  8715. *
  8716. * @param {Object} val The value to test
  8717. * @returns {boolean} True if value is a Blob, otherwise false
  8718. */
  8719. function isBlob(val) {
  8720. return toString.call(val) === '[object Blob]';
  8721. }
  8722. /**
  8723. * Determine if a value is a Function
  8724. *
  8725. * @param {Object} val The value to test
  8726. * @returns {boolean} True if value is a Function, otherwise false
  8727. */
  8728. function isFunction(val) {
  8729. return toString.call(val) === '[object Function]';
  8730. }
  8731. /**
  8732. * Determine if a value is a Stream
  8733. *
  8734. * @param {Object} val The value to test
  8735. * @returns {boolean} True if value is a Stream, otherwise false
  8736. */
  8737. function isStream(val) {
  8738. return isObject(val) && isFunction(val.pipe);
  8739. }
  8740. /**
  8741. * Determine if a value is a URLSearchParams object
  8742. *
  8743. * @param {Object} val The value to test
  8744. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  8745. */
  8746. function isURLSearchParams(val) {
  8747. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  8748. }
  8749. /**
  8750. * Trim excess whitespace off the beginning and end of a string
  8751. *
  8752. * @param {String} str The String to trim
  8753. * @returns {String} The String freed of excess whitespace
  8754. */
  8755. function trim(str) {
  8756. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  8757. }
  8758. /**
  8759. * Determine if we're running in a standard browser environment
  8760. *
  8761. * This allows axios to run in a web worker, and react-native.
  8762. * Both environments support XMLHttpRequest, but not fully standard globals.
  8763. *
  8764. * web workers:
  8765. * typeof window -> undefined
  8766. * typeof document -> undefined
  8767. *
  8768. * react-native:
  8769. * navigator.product -> 'ReactNative'
  8770. * nativescript
  8771. * navigator.product -> 'NativeScript' or 'NS'
  8772. */
  8773. function isStandardBrowserEnv() {
  8774. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  8775. navigator.product === 'NativeScript' ||
  8776. navigator.product === 'NS')) {
  8777. return false;
  8778. }
  8779. return (
  8780. typeof window !== 'undefined' &&
  8781. typeof document !== 'undefined'
  8782. );
  8783. }
  8784. /**
  8785. * Iterate over an Array or an Object invoking a function for each item.
  8786. *
  8787. * If `obj` is an Array callback will be called passing
  8788. * the value, index, and complete array for each item.
  8789. *
  8790. * If 'obj' is an Object callback will be called passing
  8791. * the value, key, and complete object for each property.
  8792. *
  8793. * @param {Object|Array} obj The object to iterate
  8794. * @param {Function} fn The callback to invoke for each item
  8795. */
  8796. function forEach(obj, fn) {
  8797. // Don't bother if no value provided
  8798. if (obj === null || typeof obj === 'undefined') {
  8799. return;
  8800. }
  8801. // Force an array if not already something iterable
  8802. if (typeof obj !== 'object') {
  8803. /*eslint no-param-reassign:0*/
  8804. obj = [obj];
  8805. }
  8806. if (isArray(obj)) {
  8807. // Iterate over array values
  8808. for (var i = 0, l = obj.length; i < l; i++) {
  8809. fn.call(null, obj[i], i, obj);
  8810. }
  8811. } else {
  8812. // Iterate over object keys
  8813. for (var key in obj) {
  8814. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  8815. fn.call(null, obj[key], key, obj);
  8816. }
  8817. }
  8818. }
  8819. }
  8820. /**
  8821. * Accepts varargs expecting each argument to be an object, then
  8822. * immutably merges the properties of each object and returns result.
  8823. *
  8824. * When multiple objects contain the same key the later object in
  8825. * the arguments list will take precedence.
  8826. *
  8827. * Example:
  8828. *
  8829. * ```js
  8830. * var result = merge({foo: 123}, {foo: 456});
  8831. * console.log(result.foo); // outputs 456
  8832. * ```
  8833. *
  8834. * @param {Object} obj1 Object to merge
  8835. * @returns {Object} Result of all merge properties
  8836. */
  8837. function merge(/* obj1, obj2, obj3, ... */) {
  8838. var result = {};
  8839. function assignValue(val, key) {
  8840. if (typeof result[key] === 'object' && typeof val === 'object') {
  8841. result[key] = merge(result[key], val);
  8842. } else {
  8843. result[key] = val;
  8844. }
  8845. }
  8846. for (var i = 0, l = arguments.length; i < l; i++) {
  8847. forEach(arguments[i], assignValue);
  8848. }
  8849. return result;
  8850. }
  8851. /**
  8852. * Function equal to merge with the difference being that no reference
  8853. * to original objects is kept.
  8854. *
  8855. * @see merge
  8856. * @param {Object} obj1 Object to merge
  8857. * @returns {Object} Result of all merge properties
  8858. */
  8859. function deepMerge(/* obj1, obj2, obj3, ... */) {
  8860. var result = {};
  8861. function assignValue(val, key) {
  8862. if (typeof result[key] === 'object' && typeof val === 'object') {
  8863. result[key] = deepMerge(result[key], val);
  8864. } else if (typeof val === 'object') {
  8865. result[key] = deepMerge({}, val);
  8866. } else {
  8867. result[key] = val;
  8868. }
  8869. }
  8870. for (var i = 0, l = arguments.length; i < l; i++) {
  8871. forEach(arguments[i], assignValue);
  8872. }
  8873. return result;
  8874. }
  8875. /**
  8876. * Extends object a by mutably adding to it the properties of object b.
  8877. *
  8878. * @param {Object} a The object to be extended
  8879. * @param {Object} b The object to copy properties from
  8880. * @param {Object} thisArg The object to bind function to
  8881. * @return {Object} The resulting value of object a
  8882. */
  8883. function extend(a, b, thisArg) {
  8884. forEach(b, function assignValue(val, key) {
  8885. if (thisArg && typeof val === 'function') {
  8886. a[key] = bind$1(val, thisArg);
  8887. } else {
  8888. a[key] = val;
  8889. }
  8890. });
  8891. return a;
  8892. }
  8893. var utils = {
  8894. isArray: isArray,
  8895. isArrayBuffer: isArrayBuffer,
  8896. isBuffer: isBuffer,
  8897. isFormData: isFormData,
  8898. isArrayBufferView: isArrayBufferView,
  8899. isString: isString,
  8900. isNumber: isNumber,
  8901. isObject: isObject,
  8902. isUndefined: isUndefined,
  8903. isDate: isDate,
  8904. isFile: isFile,
  8905. isBlob: isBlob,
  8906. isFunction: isFunction,
  8907. isStream: isStream,
  8908. isURLSearchParams: isURLSearchParams,
  8909. isStandardBrowserEnv: isStandardBrowserEnv,
  8910. forEach: forEach,
  8911. merge: merge,
  8912. deepMerge: deepMerge,
  8913. extend: extend,
  8914. trim: trim
  8915. };
  8916. var utils_1 = utils.isArray;
  8917. var utils_2 = utils.isArrayBuffer;
  8918. var utils_3 = utils.isBuffer;
  8919. var utils_4 = utils.isFormData;
  8920. var utils_5 = utils.isArrayBufferView;
  8921. var utils_6 = utils.isString;
  8922. var utils_7 = utils.isNumber;
  8923. var utils_8 = utils.isObject;
  8924. var utils_9 = utils.isUndefined;
  8925. var utils_10 = utils.isDate;
  8926. var utils_11 = utils.isFile;
  8927. var utils_12 = utils.isBlob;
  8928. var utils_13 = utils.isFunction;
  8929. var utils_14 = utils.isStream;
  8930. var utils_15 = utils.isURLSearchParams;
  8931. var utils_16 = utils.isStandardBrowserEnv;
  8932. var utils_17 = utils.forEach;
  8933. var utils_18 = utils.merge;
  8934. var utils_19 = utils.deepMerge;
  8935. var utils_20 = utils.extend;
  8936. var utils_21 = utils.trim;
  8937. 'use strict';
  8938. function encode$1(val) {
  8939. return encodeURIComponent(val).
  8940. replace(/%40/gi, '@').
  8941. replace(/%3A/gi, ':').
  8942. replace(/%24/g, '$').
  8943. replace(/%2C/gi, ',').
  8944. replace(/%20/g, '+').
  8945. replace(/%5B/gi, '[').
  8946. replace(/%5D/gi, ']');
  8947. }
  8948. /**
  8949. * Build a URL by appending params to the end
  8950. *
  8951. * @param {string} url The base of the url (e.g., http://www.google.com)
  8952. * @param {object} [params] The params to be appended
  8953. * @returns {string} The formatted url
  8954. */
  8955. var buildURL = function buildURL(url, params, paramsSerializer) {
  8956. /*eslint no-param-reassign:0*/
  8957. if (!params) {
  8958. return url;
  8959. }
  8960. var serializedParams;
  8961. if (paramsSerializer) {
  8962. serializedParams = paramsSerializer(params);
  8963. } else if (utils.isURLSearchParams(params)) {
  8964. serializedParams = params.toString();
  8965. } else {
  8966. var parts = [];
  8967. utils.forEach(params, function serialize(val, key) {
  8968. if (val === null || typeof val === 'undefined') {
  8969. return;
  8970. }
  8971. if (utils.isArray(val)) {
  8972. key = key + '[]';
  8973. } else {
  8974. val = [val];
  8975. }
  8976. utils.forEach(val, function parseValue(v) {
  8977. if (utils.isDate(v)) {
  8978. v = v.toISOString();
  8979. } else if (utils.isObject(v)) {
  8980. v = JSON.stringify(v);
  8981. }
  8982. parts.push(encode$1(key) + '=' + encode$1(v));
  8983. });
  8984. });
  8985. serializedParams = parts.join('&');
  8986. }
  8987. if (serializedParams) {
  8988. var hashmarkIndex = url.indexOf('#');
  8989. if (hashmarkIndex !== -1) {
  8990. url = url.slice(0, hashmarkIndex);
  8991. }
  8992. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  8993. }
  8994. return url;
  8995. };
  8996. 'use strict';
  8997. function InterceptorManager() {
  8998. this.handlers = [];
  8999. }
  9000. /**
  9001. * Add a new interceptor to the stack
  9002. *
  9003. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  9004. * @param {Function} rejected The function to handle `reject` for a `Promise`
  9005. *
  9006. * @return {Number} An ID used to remove interceptor later
  9007. */
  9008. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  9009. this.handlers.push({
  9010. fulfilled: fulfilled,
  9011. rejected: rejected
  9012. });
  9013. return this.handlers.length - 1;
  9014. };
  9015. /**
  9016. * Remove an interceptor from the stack
  9017. *
  9018. * @param {Number} id The ID that was returned by `use`
  9019. */
  9020. InterceptorManager.prototype.eject = function eject(id) {
  9021. if (this.handlers[id]) {
  9022. this.handlers[id] = null;
  9023. }
  9024. };
  9025. /**
  9026. * Iterate over all the registered interceptors
  9027. *
  9028. * This method is particularly useful for skipping over any
  9029. * interceptors that may have become `null` calling `eject`.
  9030. *
  9031. * @param {Function} fn The function to call for each interceptor
  9032. */
  9033. InterceptorManager.prototype.forEach = function forEach(fn) {
  9034. utils.forEach(this.handlers, function forEachHandler(h) {
  9035. if (h !== null) {
  9036. fn(h);
  9037. }
  9038. });
  9039. };
  9040. var InterceptorManager_1 = InterceptorManager;
  9041. 'use strict';
  9042. /**
  9043. * Transform the data for a request or a response
  9044. *
  9045. * @param {Object|String} data The data to be transformed
  9046. * @param {Array} headers The headers for the request or response
  9047. * @param {Array|Function} fns A single function or Array of functions
  9048. * @returns {*} The resulting transformed data
  9049. */
  9050. var transformData = function transformData(data, headers, fns) {
  9051. /*eslint no-param-reassign:0*/
  9052. utils.forEach(fns, function transform(fn) {
  9053. data = fn(data, headers);
  9054. });
  9055. return data;
  9056. };
  9057. 'use strict';
  9058. var isCancel = function isCancel(value) {
  9059. return !!(value && value.__CANCEL__);
  9060. };
  9061. 'use strict';
  9062. var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
  9063. utils.forEach(headers, function processHeader(value, name) {
  9064. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  9065. headers[normalizedName] = value;
  9066. delete headers[name];
  9067. }
  9068. });
  9069. };
  9070. 'use strict';
  9071. /**
  9072. * Update an Error with the specified config, error code, and response.
  9073. *
  9074. * @param {Error} error The error to update.
  9075. * @param {Object} config The config.
  9076. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  9077. * @param {Object} [request] The request.
  9078. * @param {Object} [response] The response.
  9079. * @returns {Error} The error.
  9080. */
  9081. var enhanceError = function enhanceError(error, config, code, request, response) {
  9082. error.config = config;
  9083. if (code) {
  9084. error.code = code;
  9085. }
  9086. error.request = request;
  9087. error.response = response;
  9088. error.isAxiosError = true;
  9089. error.toJSON = function() {
  9090. return {
  9091. // Standard
  9092. message: this.message,
  9093. name: this.name,
  9094. // Microsoft
  9095. description: this.description,
  9096. number: this.number,
  9097. // Mozilla
  9098. fileName: this.fileName,
  9099. lineNumber: this.lineNumber,
  9100. columnNumber: this.columnNumber,
  9101. stack: this.stack,
  9102. // Axios
  9103. config: this.config,
  9104. code: this.code
  9105. };
  9106. };
  9107. return error;
  9108. };
  9109. 'use strict';
  9110. /**
  9111. * Create an Error with the specified message, config, error code, request and response.
  9112. *
  9113. * @param {string} message The error message.
  9114. * @param {Object} config The config.
  9115. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  9116. * @param {Object} [request] The request.
  9117. * @param {Object} [response] The response.
  9118. * @returns {Error} The created error.
  9119. */
  9120. var createError = function createError(message, config, code, request, response) {
  9121. var error = new Error(message);
  9122. return enhanceError(error, config, code, request, response);
  9123. };
  9124. 'use strict';
  9125. /**
  9126. * Resolve or reject a Promise based on response status.
  9127. *
  9128. * @param {Function} resolve A function that resolves the promise.
  9129. * @param {Function} reject A function that rejects the promise.
  9130. * @param {object} response The response.
  9131. */
  9132. var settle = function settle(resolve, reject, response) {
  9133. var validateStatus = response.config.validateStatus;
  9134. if (!validateStatus || validateStatus(response.status)) {
  9135. resolve(response);
  9136. } else {
  9137. reject(createError(
  9138. 'Request failed with status code ' + response.status,
  9139. response.config,
  9140. null,
  9141. response.request,
  9142. response
  9143. ));
  9144. }
  9145. };
  9146. 'use strict';
  9147. /**
  9148. * Determines whether the specified URL is absolute
  9149. *
  9150. * @param {string} url The URL to test
  9151. * @returns {boolean} True if the specified URL is absolute, otherwise false
  9152. */
  9153. var isAbsoluteURL = function isAbsoluteURL(url) {
  9154. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  9155. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  9156. // by any combination of letters, digits, plus, period, or hyphen.
  9157. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  9158. };
  9159. 'use strict';
  9160. /**
  9161. * Creates a new URL by combining the specified URLs
  9162. *
  9163. * @param {string} baseURL The base URL
  9164. * @param {string} relativeURL The relative URL
  9165. * @returns {string} The combined URL
  9166. */
  9167. var combineURLs = function combineURLs(baseURL, relativeURL) {
  9168. return relativeURL
  9169. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  9170. : baseURL;
  9171. };
  9172. 'use strict';
  9173. /**
  9174. * Creates a new URL by combining the baseURL with the requestedURL,
  9175. * only when the requestedURL is not already an absolute URL.
  9176. * If the requestURL is absolute, this function returns the requestedURL untouched.
  9177. *
  9178. * @param {string} baseURL The base URL
  9179. * @param {string} requestedURL Absolute or relative URL to combine
  9180. * @returns {string} The combined full path
  9181. */
  9182. var buildFullPath = function buildFullPath(baseURL, requestedURL) {
  9183. if (baseURL && !isAbsoluteURL(requestedURL)) {
  9184. return combineURLs(baseURL, requestedURL);
  9185. }
  9186. return requestedURL;
  9187. };
  9188. 'use strict';
  9189. // Headers whose duplicates are ignored by node
  9190. // c.f. https://nodejs.org/api/http.html#http_message_headers
  9191. var ignoreDuplicateOf = [
  9192. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  9193. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  9194. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  9195. 'referer', 'retry-after', 'user-agent'
  9196. ];
  9197. /**
  9198. * Parse headers into an object
  9199. *
  9200. * ```
  9201. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  9202. * Content-Type: application/json
  9203. * Connection: keep-alive
  9204. * Transfer-Encoding: chunked
  9205. * ```
  9206. *
  9207. * @param {String} headers Headers needing to be parsed
  9208. * @returns {Object} Headers parsed into an object
  9209. */
  9210. var parseHeaders = function parseHeaders(headers) {
  9211. var parsed = {};
  9212. var key;
  9213. var val;
  9214. var i;
  9215. if (!headers) { return parsed; }
  9216. utils.forEach(headers.split('\n'), function parser(line) {
  9217. i = line.indexOf(':');
  9218. key = utils.trim(line.substr(0, i)).toLowerCase();
  9219. val = utils.trim(line.substr(i + 1));
  9220. if (key) {
  9221. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  9222. return;
  9223. }
  9224. if (key === 'set-cookie') {
  9225. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  9226. } else {
  9227. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  9228. }
  9229. }
  9230. });
  9231. return parsed;
  9232. };
  9233. 'use strict';
  9234. var isURLSameOrigin = (
  9235. utils.isStandardBrowserEnv() ?
  9236. // Standard browser envs have full support of the APIs needed to test
  9237. // whether the request URL is of the same origin as current location.
  9238. (function standardBrowserEnv() {
  9239. var msie = /(msie|trident)/i.test(navigator.userAgent);
  9240. var urlParsingNode = document.createElement('a');
  9241. var originURL;
  9242. /**
  9243. * Parse a URL to discover it's components
  9244. *
  9245. * @param {String} url The URL to be parsed
  9246. * @returns {Object}
  9247. */
  9248. function resolveURL(url) {
  9249. var href = url;
  9250. if (msie) {
  9251. // IE needs attribute set twice to normalize properties
  9252. urlParsingNode.setAttribute('href', href);
  9253. href = urlParsingNode.href;
  9254. }
  9255. urlParsingNode.setAttribute('href', href);
  9256. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  9257. return {
  9258. href: urlParsingNode.href,
  9259. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  9260. host: urlParsingNode.host,
  9261. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  9262. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  9263. hostname: urlParsingNode.hostname,
  9264. port: urlParsingNode.port,
  9265. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  9266. urlParsingNode.pathname :
  9267. '/' + urlParsingNode.pathname
  9268. };
  9269. }
  9270. originURL = resolveURL(window.location.href);
  9271. /**
  9272. * Determine if a URL shares the same origin as the current location
  9273. *
  9274. * @param {String} requestURL The URL to test
  9275. * @returns {boolean} True if URL shares the same origin, otherwise false
  9276. */
  9277. return function isURLSameOrigin(requestURL) {
  9278. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  9279. return (parsed.protocol === originURL.protocol &&
  9280. parsed.host === originURL.host);
  9281. };
  9282. })() :
  9283. // Non standard browser envs (web workers, react-native) lack needed support.
  9284. (function nonStandardBrowserEnv() {
  9285. return function isURLSameOrigin() {
  9286. return true;
  9287. };
  9288. })()
  9289. );
  9290. 'use strict';
  9291. var cookies = (
  9292. utils.isStandardBrowserEnv() ?
  9293. // Standard browser envs support document.cookie
  9294. (function standardBrowserEnv() {
  9295. return {
  9296. write: function write(name, value, expires, path, domain, secure) {
  9297. var cookie = [];
  9298. cookie.push(name + '=' + encodeURIComponent(value));
  9299. if (utils.isNumber(expires)) {
  9300. cookie.push('expires=' + new Date(expires).toGMTString());
  9301. }
  9302. if (utils.isString(path)) {
  9303. cookie.push('path=' + path);
  9304. }
  9305. if (utils.isString(domain)) {
  9306. cookie.push('domain=' + domain);
  9307. }
  9308. if (secure === true) {
  9309. cookie.push('secure');
  9310. }
  9311. document.cookie = cookie.join('; ');
  9312. },
  9313. read: function read(name) {
  9314. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  9315. return (match ? decodeURIComponent(match[3]) : null);
  9316. },
  9317. remove: function remove(name) {
  9318. this.write(name, '', Date.now() - 86400000);
  9319. }
  9320. };
  9321. })() :
  9322. // Non standard browser env (web workers, react-native) lack needed support.
  9323. (function nonStandardBrowserEnv() {
  9324. return {
  9325. write: function write() {},
  9326. read: function read() { return null; },
  9327. remove: function remove() {}
  9328. };
  9329. })()
  9330. );
  9331. 'use strict';
  9332. var xhr = function xhrAdapter(config) {
  9333. return new Promise(function dispatchXhrRequest(resolve, reject) {
  9334. var requestData = config.data;
  9335. var requestHeaders = config.headers;
  9336. if (utils.isFormData(requestData)) {
  9337. delete requestHeaders['Content-Type']; // Let the browser set it
  9338. }
  9339. var request = new XMLHttpRequest();
  9340. // HTTP basic authentication
  9341. if (config.auth) {
  9342. var username = config.auth.username || '';
  9343. var password = config.auth.password || '';
  9344. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  9345. }
  9346. var fullPath = buildFullPath(config.baseURL, config.url);
  9347. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  9348. // Set the request timeout in MS
  9349. request.timeout = config.timeout;
  9350. // Listen for ready state
  9351. request.onreadystatechange = function handleLoad() {
  9352. if (!request || request.readyState !== 4) {
  9353. return;
  9354. }
  9355. // The request errored out and we didn't get a response, this will be
  9356. // handled by onerror instead
  9357. // With one exception: request that using file: protocol, most browsers
  9358. // will return status as 0 even though it's a successful request
  9359. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  9360. return;
  9361. }
  9362. // Prepare the response
  9363. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  9364. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  9365. var response = {
  9366. data: responseData,
  9367. status: request.status,
  9368. statusText: request.statusText,
  9369. headers: responseHeaders,
  9370. config: config,
  9371. request: request
  9372. };
  9373. settle(resolve, reject, response);
  9374. // Clean up request
  9375. request = null;
  9376. };
  9377. // Handle browser request cancellation (as opposed to a manual cancellation)
  9378. request.onabort = function handleAbort() {
  9379. if (!request) {
  9380. return;
  9381. }
  9382. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  9383. // Clean up request
  9384. request = null;
  9385. };
  9386. // Handle low level network errors
  9387. request.onerror = function handleError() {
  9388. // Real errors are hidden from us by the browser
  9389. // onerror should only fire if it's a network error
  9390. reject(createError('Network Error', config, null, request));
  9391. // Clean up request
  9392. request = null;
  9393. };
  9394. // Handle timeout
  9395. request.ontimeout = function handleTimeout() {
  9396. var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
  9397. if (config.timeoutErrorMessage) {
  9398. timeoutErrorMessage = config.timeoutErrorMessage;
  9399. }
  9400. reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
  9401. request));
  9402. // Clean up request
  9403. request = null;
  9404. };
  9405. // Add xsrf header
  9406. // This is only done if running in a standard browser environment.
  9407. // Specifically not if we're in a web worker, or react-native.
  9408. if (utils.isStandardBrowserEnv()) {
  9409. var cookies$1 = cookies;
  9410. // Add xsrf header
  9411. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  9412. cookies$1.read(config.xsrfCookieName) :
  9413. undefined;
  9414. if (xsrfValue) {
  9415. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  9416. }
  9417. }
  9418. // Add headers to the request
  9419. if ('setRequestHeader' in request) {
  9420. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  9421. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  9422. // Remove Content-Type if data is undefined
  9423. delete requestHeaders[key];
  9424. } else {
  9425. // Otherwise add header to the request
  9426. request.setRequestHeader(key, val);
  9427. }
  9428. });
  9429. }
  9430. // Add withCredentials to request if needed
  9431. if (!utils.isUndefined(config.withCredentials)) {
  9432. request.withCredentials = !!config.withCredentials;
  9433. }
  9434. // Add responseType to request if needed
  9435. if (config.responseType) {
  9436. try {
  9437. request.responseType = config.responseType;
  9438. } catch (e) {
  9439. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  9440. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  9441. if (config.responseType !== 'json') {
  9442. throw e;
  9443. }
  9444. }
  9445. }
  9446. // Handle progress if needed
  9447. if (typeof config.onDownloadProgress === 'function') {
  9448. request.addEventListener('progress', config.onDownloadProgress);
  9449. }
  9450. // Not all browsers support upload events
  9451. if (typeof config.onUploadProgress === 'function' && request.upload) {
  9452. request.upload.addEventListener('progress', config.onUploadProgress);
  9453. }
  9454. if (config.cancelToken) {
  9455. // Handle cancellation
  9456. config.cancelToken.promise.then(function onCanceled(cancel) {
  9457. if (!request) {
  9458. return;
  9459. }
  9460. request.abort();
  9461. reject(cancel);
  9462. // Clean up request
  9463. request = null;
  9464. });
  9465. }
  9466. if (requestData === undefined) {
  9467. requestData = null;
  9468. }
  9469. // Send the request
  9470. request.send(requestData);
  9471. });
  9472. };
  9473. 'use strict';
  9474. var DEFAULT_CONTENT_TYPE = {
  9475. 'Content-Type': 'application/x-www-form-urlencoded'
  9476. };
  9477. function setContentTypeIfUnset(headers, value) {
  9478. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  9479. headers['Content-Type'] = value;
  9480. }
  9481. }
  9482. function getDefaultAdapter() {
  9483. var adapter;
  9484. if (typeof XMLHttpRequest !== 'undefined') {
  9485. // For browsers use XHR adapter
  9486. adapter = xhr;
  9487. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  9488. // For node use HTTP adapter
  9489. adapter = xhr;
  9490. }
  9491. return adapter;
  9492. }
  9493. var defaults = {
  9494. adapter: getDefaultAdapter(),
  9495. transformRequest: [function transformRequest(data, headers) {
  9496. normalizeHeaderName(headers, 'Accept');
  9497. normalizeHeaderName(headers, 'Content-Type');
  9498. if (utils.isFormData(data) ||
  9499. utils.isArrayBuffer(data) ||
  9500. utils.isBuffer(data) ||
  9501. utils.isStream(data) ||
  9502. utils.isFile(data) ||
  9503. utils.isBlob(data)
  9504. ) {
  9505. return data;
  9506. }
  9507. if (utils.isArrayBufferView(data)) {
  9508. return data.buffer;
  9509. }
  9510. if (utils.isURLSearchParams(data)) {
  9511. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  9512. return data.toString();
  9513. }
  9514. if (utils.isObject(data)) {
  9515. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  9516. return JSON.stringify(data);
  9517. }
  9518. return data;
  9519. }],
  9520. transformResponse: [function transformResponse(data) {
  9521. /*eslint no-param-reassign:0*/
  9522. if (typeof data === 'string') {
  9523. try {
  9524. data = JSON.parse(data);
  9525. } catch (e) { /* Ignore */ }
  9526. }
  9527. return data;
  9528. }],
  9529. /**
  9530. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  9531. * timeout is not created.
  9532. */
  9533. timeout: 0,
  9534. xsrfCookieName: 'XSRF-TOKEN',
  9535. xsrfHeaderName: 'X-XSRF-TOKEN',
  9536. maxContentLength: -1,
  9537. validateStatus: function validateStatus(status) {
  9538. return status >= 200 && status < 300;
  9539. }
  9540. };
  9541. defaults.headers = {
  9542. common: {
  9543. 'Accept': 'application/json, text/plain, */*'
  9544. }
  9545. };
  9546. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  9547. defaults.headers[method] = {};
  9548. });
  9549. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  9550. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  9551. });
  9552. var defaults_1 = defaults;
  9553. 'use strict';
  9554. /**
  9555. * Throws a `Cancel` if cancellation has been requested.
  9556. */
  9557. function throwIfCancellationRequested(config) {
  9558. if (config.cancelToken) {
  9559. config.cancelToken.throwIfRequested();
  9560. }
  9561. }
  9562. /**
  9563. * Dispatch a request to the server using the configured adapter.
  9564. *
  9565. * @param {object} config The config that is to be used for the request
  9566. * @returns {Promise} The Promise to be fulfilled
  9567. */
  9568. var dispatchRequest = function dispatchRequest(config) {
  9569. throwIfCancellationRequested(config);
  9570. // Ensure headers exist
  9571. config.headers = config.headers || {};
  9572. // Transform request data
  9573. config.data = transformData(
  9574. config.data,
  9575. config.headers,
  9576. config.transformRequest
  9577. );
  9578. // Flatten headers
  9579. config.headers = utils.merge(
  9580. config.headers.common || {},
  9581. config.headers[config.method] || {},
  9582. config.headers
  9583. );
  9584. utils.forEach(
  9585. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  9586. function cleanHeaderConfig(method) {
  9587. delete config.headers[method];
  9588. }
  9589. );
  9590. var adapter = config.adapter || defaults_1.adapter;
  9591. return adapter(config).then(function onAdapterResolution(response) {
  9592. throwIfCancellationRequested(config);
  9593. // Transform response data
  9594. response.data = transformData(
  9595. response.data,
  9596. response.headers,
  9597. config.transformResponse
  9598. );
  9599. return response;
  9600. }, function onAdapterRejection(reason) {
  9601. if (!isCancel(reason)) {
  9602. throwIfCancellationRequested(config);
  9603. // Transform response data
  9604. if (reason && reason.response) {
  9605. reason.response.data = transformData(
  9606. reason.response.data,
  9607. reason.response.headers,
  9608. config.transformResponse
  9609. );
  9610. }
  9611. }
  9612. return Promise.reject(reason);
  9613. });
  9614. };
  9615. 'use strict';
  9616. /**
  9617. * Config-specific merge-function which creates a new config-object
  9618. * by merging two configuration objects together.
  9619. *
  9620. * @param {Object} config1
  9621. * @param {Object} config2
  9622. * @returns {Object} New object resulting from merging config2 to config1
  9623. */
  9624. var mergeConfig = function mergeConfig(config1, config2) {
  9625. // eslint-disable-next-line no-param-reassign
  9626. config2 = config2 || {};
  9627. var config = {};
  9628. var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
  9629. var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
  9630. var defaultToConfig2Keys = [
  9631. 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
  9632. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  9633. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
  9634. 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
  9635. 'httpsAgent', 'cancelToken', 'socketPath'
  9636. ];
  9637. utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
  9638. if (typeof config2[prop] !== 'undefined') {
  9639. config[prop] = config2[prop];
  9640. }
  9641. });
  9642. utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
  9643. if (utils.isObject(config2[prop])) {
  9644. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  9645. } else if (typeof config2[prop] !== 'undefined') {
  9646. config[prop] = config2[prop];
  9647. } else if (utils.isObject(config1[prop])) {
  9648. config[prop] = utils.deepMerge(config1[prop]);
  9649. } else if (typeof config1[prop] !== 'undefined') {
  9650. config[prop] = config1[prop];
  9651. }
  9652. });
  9653. utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
  9654. if (typeof config2[prop] !== 'undefined') {
  9655. config[prop] = config2[prop];
  9656. } else if (typeof config1[prop] !== 'undefined') {
  9657. config[prop] = config1[prop];
  9658. }
  9659. });
  9660. var axiosKeys = valueFromConfig2Keys
  9661. .concat(mergeDeepPropertiesKeys)
  9662. .concat(defaultToConfig2Keys);
  9663. var otherKeys = Object
  9664. .keys(config2)
  9665. .filter(function filterAxiosKeys(key) {
  9666. return axiosKeys.indexOf(key) === -1;
  9667. });
  9668. utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
  9669. if (typeof config2[prop] !== 'undefined') {
  9670. config[prop] = config2[prop];
  9671. } else if (typeof config1[prop] !== 'undefined') {
  9672. config[prop] = config1[prop];
  9673. }
  9674. });
  9675. return config;
  9676. };
  9677. 'use strict';
  9678. /**
  9679. * Create a new instance of Axios
  9680. *
  9681. * @param {Object} instanceConfig The default config for the instance
  9682. */
  9683. function Axios(instanceConfig) {
  9684. this.defaults = instanceConfig;
  9685. this.interceptors = {
  9686. request: new InterceptorManager_1(),
  9687. response: new InterceptorManager_1()
  9688. };
  9689. }
  9690. /**
  9691. * Dispatch a request
  9692. *
  9693. * @param {Object} config The config specific for this request (merged with this.defaults)
  9694. */
  9695. Axios.prototype.request = function request(config) {
  9696. /*eslint no-param-reassign:0*/
  9697. // Allow for axios('example/url'[, config]) a la fetch API
  9698. if (typeof config === 'string') {
  9699. config = arguments[1] || {};
  9700. config.url = arguments[0];
  9701. } else {
  9702. config = config || {};
  9703. }
  9704. config = mergeConfig(this.defaults, config);
  9705. // Set config.method
  9706. if (config.method) {
  9707. config.method = config.method.toLowerCase();
  9708. } else if (this.defaults.method) {
  9709. config.method = this.defaults.method.toLowerCase();
  9710. } else {
  9711. config.method = 'get';
  9712. }
  9713. // Hook up interceptors middleware
  9714. var chain = [dispatchRequest, undefined];
  9715. var promise = Promise.resolve(config);
  9716. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  9717. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  9718. });
  9719. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  9720. chain.push(interceptor.fulfilled, interceptor.rejected);
  9721. });
  9722. while (chain.length) {
  9723. promise = promise.then(chain.shift(), chain.shift());
  9724. }
  9725. return promise;
  9726. };
  9727. Axios.prototype.getUri = function getUri(config) {
  9728. config = mergeConfig(this.defaults, config);
  9729. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  9730. };
  9731. // Provide aliases for supported request methods
  9732. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  9733. /*eslint func-names:0*/
  9734. Axios.prototype[method] = function(url, config) {
  9735. return this.request(utils.merge(config || {}, {
  9736. method: method,
  9737. url: url
  9738. }));
  9739. };
  9740. });
  9741. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  9742. /*eslint func-names:0*/
  9743. Axios.prototype[method] = function(url, data, config) {
  9744. return this.request(utils.merge(config || {}, {
  9745. method: method,
  9746. url: url,
  9747. data: data
  9748. }));
  9749. };
  9750. });
  9751. var Axios_1 = Axios;
  9752. 'use strict';
  9753. /**
  9754. * A `Cancel` is an object that is thrown when an operation is canceled.
  9755. *
  9756. * @class
  9757. * @param {string=} message The message.
  9758. */
  9759. function Cancel(message) {
  9760. this.message = message;
  9761. }
  9762. Cancel.prototype.toString = function toString() {
  9763. return 'Cancel' + (this.message ? ': ' + this.message : '');
  9764. };
  9765. Cancel.prototype.__CANCEL__ = true;
  9766. var Cancel_1 = Cancel;
  9767. 'use strict';
  9768. /**
  9769. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  9770. *
  9771. * @class
  9772. * @param {Function} executor The executor function.
  9773. */
  9774. function CancelToken(executor) {
  9775. if (typeof executor !== 'function') {
  9776. throw new TypeError('executor must be a function.');
  9777. }
  9778. var resolvePromise;
  9779. this.promise = new Promise(function promiseExecutor(resolve) {
  9780. resolvePromise = resolve;
  9781. });
  9782. var token = this;
  9783. executor(function cancel(message) {
  9784. if (token.reason) {
  9785. // Cancellation has already been requested
  9786. return;
  9787. }
  9788. token.reason = new Cancel_1(message);
  9789. resolvePromise(token.reason);
  9790. });
  9791. }
  9792. /**
  9793. * Throws a `Cancel` if cancellation has been requested.
  9794. */
  9795. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  9796. if (this.reason) {
  9797. throw this.reason;
  9798. }
  9799. };
  9800. /**
  9801. * Returns an object that contains a new `CancelToken` and a function that, when called,
  9802. * cancels the `CancelToken`.
  9803. */
  9804. CancelToken.source = function source() {
  9805. var cancel;
  9806. var token = new CancelToken(function executor(c) {
  9807. cancel = c;
  9808. });
  9809. return {
  9810. token: token,
  9811. cancel: cancel
  9812. };
  9813. };
  9814. var CancelToken_1 = CancelToken;
  9815. 'use strict';
  9816. /**
  9817. * Syntactic sugar for invoking a function and expanding an array for arguments.
  9818. *
  9819. * Common use case would be to use `Function.prototype.apply`.
  9820. *
  9821. * ```js
  9822. * function f(x, y, z) {}
  9823. * var args = [1, 2, 3];
  9824. * f.apply(null, args);
  9825. * ```
  9826. *
  9827. * With `spread` this example can be re-written.
  9828. *
  9829. * ```js
  9830. * spread(function(x, y, z) {})([1, 2, 3]);
  9831. * ```
  9832. *
  9833. * @param {Function} callback
  9834. * @returns {Function}
  9835. */
  9836. var spread$1 = function spread(callback) {
  9837. return function wrap(arr) {
  9838. return callback.apply(null, arr);
  9839. };
  9840. };
  9841. 'use strict';
  9842. /**
  9843. * Create an instance of Axios
  9844. *
  9845. * @param {Object} defaultConfig The default config for the instance
  9846. * @return {Axios} A new instance of Axios
  9847. */
  9848. function createInstance(defaultConfig) {
  9849. var context = new Axios_1(defaultConfig);
  9850. var instance = bind$1(Axios_1.prototype.request, context);
  9851. // Copy axios.prototype to instance
  9852. utils.extend(instance, Axios_1.prototype, context);
  9853. // Copy context to instance
  9854. utils.extend(instance, context);
  9855. return instance;
  9856. }
  9857. // Create the default instance to be exported
  9858. var axios = createInstance(defaults_1);
  9859. // Expose Axios class to allow class inheritance
  9860. axios.Axios = Axios_1;
  9861. // Factory for creating new instances
  9862. axios.create = function create(instanceConfig) {
  9863. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  9864. };
  9865. // Expose Cancel & CancelToken
  9866. axios.Cancel = Cancel_1;
  9867. axios.CancelToken = CancelToken_1;
  9868. axios.isCancel = isCancel;
  9869. // Expose all/spread
  9870. axios.all = function all(promises) {
  9871. return Promise.all(promises);
  9872. };
  9873. axios.spread = spread$1;
  9874. var axios_1 = axios;
  9875. // Allow use of default import syntax in TypeScript
  9876. var default_1 = axios;
  9877. axios_1.default = default_1;
  9878. var axios$1 = axios_1;
  9879. 'use strict';
  9880. var has$1 = Object.prototype.hasOwnProperty;
  9881. var isArray$1 = Array.isArray;
  9882. var hexTable = (function () {
  9883. var array = [];
  9884. for (var i = 0; i < 256; ++i) {
  9885. array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
  9886. }
  9887. return array;
  9888. }());
  9889. var compactQueue = function compactQueue(queue) {
  9890. while (queue.length > 1) {
  9891. var item = queue.pop();
  9892. var obj = item.obj[item.prop];
  9893. if (isArray$1(obj)) {
  9894. var compacted = [];
  9895. for (var j = 0; j < obj.length; ++j) {
  9896. if (typeof obj[j] !== 'undefined') {
  9897. compacted.push(obj[j]);
  9898. }
  9899. }
  9900. item.obj[item.prop] = compacted;
  9901. }
  9902. }
  9903. };
  9904. var arrayToObject = function arrayToObject(source, options) {
  9905. var obj = options && options.plainObjects ? Object.create(null) : {};
  9906. for (var i = 0; i < source.length; ++i) {
  9907. if (typeof source[i] !== 'undefined') {
  9908. obj[i] = source[i];
  9909. }
  9910. }
  9911. return obj;
  9912. };
  9913. var merge$1 = function merge(target, source, options) {
  9914. /* eslint no-param-reassign: 0 */
  9915. if (!source) {
  9916. return target;
  9917. }
  9918. if (typeof source !== 'object') {
  9919. if (isArray$1(target)) {
  9920. target.push(source);
  9921. } else if (target && typeof target === 'object') {
  9922. if ((options && (options.plainObjects || options.allowPrototypes)) || !has$1.call(Object.prototype, source)) {
  9923. target[source] = true;
  9924. }
  9925. } else {
  9926. return [target, source];
  9927. }
  9928. return target;
  9929. }
  9930. if (!target || typeof target !== 'object') {
  9931. return [target].concat(source);
  9932. }
  9933. var mergeTarget = target;
  9934. if (isArray$1(target) && !isArray$1(source)) {
  9935. mergeTarget = arrayToObject(target, options);
  9936. }
  9937. if (isArray$1(target) && isArray$1(source)) {
  9938. source.forEach(function (item, i) {
  9939. if (has$1.call(target, i)) {
  9940. var targetItem = target[i];
  9941. if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
  9942. target[i] = merge(targetItem, item, options);
  9943. } else {
  9944. target.push(item);
  9945. }
  9946. } else {
  9947. target[i] = item;
  9948. }
  9949. });
  9950. return target;
  9951. }
  9952. return Object.keys(source).reduce(function (acc, key) {
  9953. var value = source[key];
  9954. if (has$1.call(acc, key)) {
  9955. acc[key] = merge(acc[key], value, options);
  9956. } else {
  9957. acc[key] = value;
  9958. }
  9959. return acc;
  9960. }, mergeTarget);
  9961. };
  9962. var assign$1 = function assignSingleSource(target, source) {
  9963. return Object.keys(source).reduce(function (acc, key) {
  9964. acc[key] = source[key];
  9965. return acc;
  9966. }, target);
  9967. };
  9968. var decode$2 = function (str, decoder, charset) {
  9969. var strWithoutPlus = str.replace(/\+/g, ' ');
  9970. if (charset === 'iso-8859-1') {
  9971. // unescape never throws, no try...catch needed:
  9972. return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
  9973. }
  9974. // utf-8
  9975. try {
  9976. return decodeURIComponent(strWithoutPlus);
  9977. } catch (e) {
  9978. return strWithoutPlus;
  9979. }
  9980. };
  9981. var encode$2 = function encode(str, defaultEncoder, charset) {
  9982. // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
  9983. // It has been adapted here for stricter adherence to RFC 3986
  9984. if (str.length === 0) {
  9985. return str;
  9986. }
  9987. var string = str;
  9988. if (typeof str === 'symbol') {
  9989. string = Symbol.prototype.toString.call(str);
  9990. } else if (typeof str !== 'string') {
  9991. string = String(str);
  9992. }
  9993. if (charset === 'iso-8859-1') {
  9994. return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
  9995. return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
  9996. });
  9997. }
  9998. var out = '';
  9999. for (var i = 0; i < string.length; ++i) {
  10000. var c = string.charCodeAt(i);
  10001. if (
  10002. c === 0x2D // -
  10003. || c === 0x2E // .
  10004. || c === 0x5F // _
  10005. || c === 0x7E // ~
  10006. || (c >= 0x30 && c <= 0x39) // 0-9
  10007. || (c >= 0x41 && c <= 0x5A) // a-z
  10008. || (c >= 0x61 && c <= 0x7A) // A-Z
  10009. ) {
  10010. out += string.charAt(i);
  10011. continue;
  10012. }
  10013. if (c < 0x80) {
  10014. out = out + hexTable[c];
  10015. continue;
  10016. }
  10017. if (c < 0x800) {
  10018. out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
  10019. continue;
  10020. }
  10021. if (c < 0xD800 || c >= 0xE000) {
  10022. out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
  10023. continue;
  10024. }
  10025. i += 1;
  10026. c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
  10027. out += hexTable[0xF0 | (c >> 18)]
  10028. + hexTable[0x80 | ((c >> 12) & 0x3F)]
  10029. + hexTable[0x80 | ((c >> 6) & 0x3F)]
  10030. + hexTable[0x80 | (c & 0x3F)];
  10031. }
  10032. return out;
  10033. };
  10034. var compact = function compact(value) {
  10035. var queue = [{ obj: { o: value }, prop: 'o' }];
  10036. var refs = [];
  10037. for (var i = 0; i < queue.length; ++i) {
  10038. var item = queue[i];
  10039. var obj = item.obj[item.prop];
  10040. var keys = Object.keys(obj);
  10041. for (var j = 0; j < keys.length; ++j) {
  10042. var key = keys[j];
  10043. var val = obj[key];
  10044. if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
  10045. queue.push({ obj: obj, prop: key });
  10046. refs.push(val);
  10047. }
  10048. }
  10049. }
  10050. compactQueue(queue);
  10051. return value;
  10052. };
  10053. var isRegExp = function isRegExp(obj) {
  10054. return Object.prototype.toString.call(obj) === '[object RegExp]';
  10055. };
  10056. var isBuffer$1 = function isBuffer(obj) {
  10057. if (!obj || typeof obj !== 'object') {
  10058. return false;
  10059. }
  10060. return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
  10061. };
  10062. var combine = function combine(a, b) {
  10063. return [].concat(a, b);
  10064. };
  10065. var utils$1 = {
  10066. arrayToObject: arrayToObject,
  10067. assign: assign$1,
  10068. combine: combine,
  10069. compact: compact,
  10070. decode: decode$2,
  10071. encode: encode$2,
  10072. isBuffer: isBuffer$1,
  10073. isRegExp: isRegExp,
  10074. merge: merge$1
  10075. };
  10076. var utils_1$1 = utils$1.arrayToObject;
  10077. var utils_2$1 = utils$1.assign;
  10078. var utils_3$1 = utils$1.combine;
  10079. var utils_4$1 = utils$1.compact;
  10080. var utils_5$1 = utils$1.decode;
  10081. var utils_6$1 = utils$1.encode;
  10082. var utils_7$1 = utils$1.isBuffer;
  10083. var utils_8$1 = utils$1.isRegExp;
  10084. var utils_9$1 = utils$1.merge;
  10085. 'use strict';
  10086. var replace = String.prototype.replace;
  10087. var percentTwenties = /%20/g;
  10088. var Format = {
  10089. RFC1738: 'RFC1738',
  10090. RFC3986: 'RFC3986'
  10091. };
  10092. var formats = utils$1.assign(
  10093. {
  10094. 'default': Format.RFC3986,
  10095. formatters: {
  10096. RFC1738: function (value) {
  10097. return replace.call(value, percentTwenties, '+');
  10098. },
  10099. RFC3986: function (value) {
  10100. return String(value);
  10101. }
  10102. }
  10103. },
  10104. Format
  10105. );
  10106. 'use strict';
  10107. var has$2 = Object.prototype.hasOwnProperty;
  10108. var arrayPrefixGenerators = {
  10109. brackets: function brackets(prefix) {
  10110. return prefix + '[]';
  10111. },
  10112. comma: 'comma',
  10113. indices: function indices(prefix, key) {
  10114. return prefix + '[' + key + ']';
  10115. },
  10116. repeat: function repeat(prefix) {
  10117. return prefix;
  10118. }
  10119. };
  10120. var isArray$2 = Array.isArray;
  10121. var push = Array.prototype.push;
  10122. var pushToArray = function (arr, valueOrArray) {
  10123. push.apply(arr, isArray$2(valueOrArray) ? valueOrArray : [valueOrArray]);
  10124. };
  10125. var toISO = Date.prototype.toISOString;
  10126. var defaultFormat = formats['default'];
  10127. var defaults$1 = {
  10128. addQueryPrefix: false,
  10129. allowDots: false,
  10130. charset: 'utf-8',
  10131. charsetSentinel: false,
  10132. delimiter: '&',
  10133. encode: true,
  10134. encoder: utils$1.encode,
  10135. encodeValuesOnly: false,
  10136. format: defaultFormat,
  10137. formatter: formats.formatters[defaultFormat],
  10138. // deprecated
  10139. indices: false,
  10140. serializeDate: function serializeDate(date) {
  10141. return toISO.call(date);
  10142. },
  10143. skipNulls: false,
  10144. strictNullHandling: false
  10145. };
  10146. var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
  10147. return typeof v === 'string'
  10148. || typeof v === 'number'
  10149. || typeof v === 'boolean'
  10150. || typeof v === 'symbol'
  10151. || typeof v === 'bigint';
  10152. };
  10153. var stringify$1 = function stringify(
  10154. object,
  10155. prefix,
  10156. generateArrayPrefix,
  10157. strictNullHandling,
  10158. skipNulls,
  10159. encoder,
  10160. filter,
  10161. sort,
  10162. allowDots,
  10163. serializeDate,
  10164. formatter,
  10165. encodeValuesOnly,
  10166. charset
  10167. ) {
  10168. var obj = object;
  10169. if (typeof filter === 'function') {
  10170. obj = filter(prefix, obj);
  10171. } else if (obj instanceof Date) {
  10172. obj = serializeDate(obj);
  10173. } else if (generateArrayPrefix === 'comma' && isArray$2(obj)) {
  10174. obj = obj.join(',');
  10175. }
  10176. if (obj === null) {
  10177. if (strictNullHandling) {
  10178. return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key') : prefix;
  10179. }
  10180. obj = '';
  10181. }
  10182. if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
  10183. if (encoder) {
  10184. var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key');
  10185. return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value'))];
  10186. }
  10187. return [formatter(prefix) + '=' + formatter(String(obj))];
  10188. }
  10189. var values = [];
  10190. if (typeof obj === 'undefined') {
  10191. return values;
  10192. }
  10193. var objKeys;
  10194. if (isArray$2(filter)) {
  10195. objKeys = filter;
  10196. } else {
  10197. var keys = Object.keys(obj);
  10198. objKeys = sort ? keys.sort(sort) : keys;
  10199. }
  10200. for (var i = 0; i < objKeys.length; ++i) {
  10201. var key = objKeys[i];
  10202. if (skipNulls && obj[key] === null) {
  10203. continue;
  10204. }
  10205. if (isArray$2(obj)) {
  10206. pushToArray(values, stringify(
  10207. obj[key],
  10208. typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,
  10209. generateArrayPrefix,
  10210. strictNullHandling,
  10211. skipNulls,
  10212. encoder,
  10213. filter,
  10214. sort,
  10215. allowDots,
  10216. serializeDate,
  10217. formatter,
  10218. encodeValuesOnly,
  10219. charset
  10220. ));
  10221. } else {
  10222. pushToArray(values, stringify(
  10223. obj[key],
  10224. prefix + (allowDots ? '.' + key : '[' + key + ']'),
  10225. generateArrayPrefix,
  10226. strictNullHandling,
  10227. skipNulls,
  10228. encoder,
  10229. filter,
  10230. sort,
  10231. allowDots,
  10232. serializeDate,
  10233. formatter,
  10234. encodeValuesOnly,
  10235. charset
  10236. ));
  10237. }
  10238. }
  10239. return values;
  10240. };
  10241. var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
  10242. if (!opts) {
  10243. return defaults$1;
  10244. }
  10245. if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
  10246. throw new TypeError('Encoder has to be a function.');
  10247. }
  10248. var charset = opts.charset || defaults$1.charset;
  10249. if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
  10250. throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
  10251. }
  10252. var format = formats['default'];
  10253. if (typeof opts.format !== 'undefined') {
  10254. if (!has$2.call(formats.formatters, opts.format)) {
  10255. throw new TypeError('Unknown format option provided.');
  10256. }
  10257. format = opts.format;
  10258. }
  10259. var formatter = formats.formatters[format];
  10260. var filter = defaults$1.filter;
  10261. if (typeof opts.filter === 'function' || isArray$2(opts.filter)) {
  10262. filter = opts.filter;
  10263. }
  10264. return {
  10265. addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
  10266. allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
  10267. charset: charset,
  10268. charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
  10269. delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
  10270. encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
  10271. encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
  10272. encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
  10273. filter: filter,
  10274. formatter: formatter,
  10275. serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
  10276. skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
  10277. sort: typeof opts.sort === 'function' ? opts.sort : null,
  10278. strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
  10279. };
  10280. };
  10281. var stringify_1 = function (object, opts) {
  10282. var obj = object;
  10283. var options = normalizeStringifyOptions(opts);
  10284. var objKeys;
  10285. var filter;
  10286. if (typeof options.filter === 'function') {
  10287. filter = options.filter;
  10288. obj = filter('', obj);
  10289. } else if (isArray$2(options.filter)) {
  10290. filter = options.filter;
  10291. objKeys = filter;
  10292. }
  10293. var keys = [];
  10294. if (typeof obj !== 'object' || obj === null) {
  10295. return '';
  10296. }
  10297. var arrayFormat;
  10298. if (opts && opts.arrayFormat in arrayPrefixGenerators) {
  10299. arrayFormat = opts.arrayFormat;
  10300. } else if (opts && 'indices' in opts) {
  10301. arrayFormat = opts.indices ? 'indices' : 'repeat';
  10302. } else {
  10303. arrayFormat = 'indices';
  10304. }
  10305. var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
  10306. if (!objKeys) {
  10307. objKeys = Object.keys(obj);
  10308. }
  10309. if (options.sort) {
  10310. objKeys.sort(options.sort);
  10311. }
  10312. for (var i = 0; i < objKeys.length; ++i) {
  10313. var key = objKeys[i];
  10314. if (options.skipNulls && obj[key] === null) {
  10315. continue;
  10316. }
  10317. pushToArray(keys, stringify$1(
  10318. obj[key],
  10319. key,
  10320. generateArrayPrefix,
  10321. options.strictNullHandling,
  10322. options.skipNulls,
  10323. options.encode ? options.encoder : null,
  10324. options.filter,
  10325. options.sort,
  10326. options.allowDots,
  10327. options.serializeDate,
  10328. options.formatter,
  10329. options.encodeValuesOnly,
  10330. options.charset
  10331. ));
  10332. }
  10333. var joined = keys.join(options.delimiter);
  10334. var prefix = options.addQueryPrefix === true ? '?' : '';
  10335. if (options.charsetSentinel) {
  10336. if (options.charset === 'iso-8859-1') {
  10337. // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
  10338. prefix += 'utf8=%26%2310003%3B&';
  10339. } else {
  10340. // encodeURIComponent('✓')
  10341. prefix += 'utf8=%E2%9C%93&';
  10342. }
  10343. }
  10344. return joined.length > 0 ? prefix + joined : '';
  10345. };
  10346. 'use strict';
  10347. var has$3 = Object.prototype.hasOwnProperty;
  10348. var isArray$3 = Array.isArray;
  10349. var defaults$2 = {
  10350. allowDots: false,
  10351. allowPrototypes: false,
  10352. arrayLimit: 20,
  10353. charset: 'utf-8',
  10354. charsetSentinel: false,
  10355. comma: false,
  10356. decoder: utils$1.decode,
  10357. delimiter: '&',
  10358. depth: 5,
  10359. ignoreQueryPrefix: false,
  10360. interpretNumericEntities: false,
  10361. parameterLimit: 1000,
  10362. parseArrays: true,
  10363. plainObjects: false,
  10364. strictNullHandling: false
  10365. };
  10366. var interpretNumericEntities = function (str) {
  10367. return str.replace(/&#(\d+);/g, function ($0, numberStr) {
  10368. return String.fromCharCode(parseInt(numberStr, 10));
  10369. });
  10370. };
  10371. // This is what browsers will submit when the ✓ character occurs in an
  10372. // application/x-www-form-urlencoded body and the encoding of the page containing
  10373. // the form is iso-8859-1, or when the submitted form has an accept-charset
  10374. // attribute of iso-8859-1. Presumably also with other charsets that do not contain
  10375. // the ✓ character, such as us-ascii.
  10376. var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
  10377. // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
  10378. var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
  10379. var parseValues = function parseQueryStringValues(str, options) {
  10380. var obj = {};
  10381. var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
  10382. var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
  10383. var parts = cleanStr.split(options.delimiter, limit);
  10384. var skipIndex = -1; // Keep track of where the utf8 sentinel was found
  10385. var i;
  10386. var charset = options.charset;
  10387. if (options.charsetSentinel) {
  10388. for (i = 0; i < parts.length; ++i) {
  10389. if (parts[i].indexOf('utf8=') === 0) {
  10390. if (parts[i] === charsetSentinel) {
  10391. charset = 'utf-8';
  10392. } else if (parts[i] === isoSentinel) {
  10393. charset = 'iso-8859-1';
  10394. }
  10395. skipIndex = i;
  10396. i = parts.length; // The eslint settings do not allow break;
  10397. }
  10398. }
  10399. }
  10400. for (i = 0; i < parts.length; ++i) {
  10401. if (i === skipIndex) {
  10402. continue;
  10403. }
  10404. var part = parts[i];
  10405. var bracketEqualsPos = part.indexOf(']=');
  10406. var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
  10407. var key, val;
  10408. if (pos === -1) {
  10409. key = options.decoder(part, defaults$2.decoder, charset, 'key');
  10410. val = options.strictNullHandling ? null : '';
  10411. } else {
  10412. key = options.decoder(part.slice(0, pos), defaults$2.decoder, charset, 'key');
  10413. val = options.decoder(part.slice(pos + 1), defaults$2.decoder, charset, 'value');
  10414. }
  10415. if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
  10416. val = interpretNumericEntities(val);
  10417. }
  10418. if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
  10419. val = val.split(',');
  10420. }
  10421. if (part.indexOf('[]=') > -1) {
  10422. val = isArray$3(val) ? [val] : val;
  10423. }
  10424. if (has$3.call(obj, key)) {
  10425. obj[key] = utils$1.combine(obj[key], val);
  10426. } else {
  10427. obj[key] = val;
  10428. }
  10429. }
  10430. return obj;
  10431. };
  10432. var parseObject = function (chain, val, options) {
  10433. var leaf = val;
  10434. for (var i = chain.length - 1; i >= 0; --i) {
  10435. var obj;
  10436. var root = chain[i];
  10437. if (root === '[]' && options.parseArrays) {
  10438. obj = [].concat(leaf);
  10439. } else {
  10440. obj = options.plainObjects ? Object.create(null) : {};
  10441. var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
  10442. var index = parseInt(cleanRoot, 10);
  10443. if (!options.parseArrays && cleanRoot === '') {
  10444. obj = { 0: leaf };
  10445. } else if (
  10446. !isNaN(index)
  10447. && root !== cleanRoot
  10448. && String(index) === cleanRoot
  10449. && index >= 0
  10450. && (options.parseArrays && index <= options.arrayLimit)
  10451. ) {
  10452. obj = [];
  10453. obj[index] = leaf;
  10454. } else {
  10455. obj[cleanRoot] = leaf;
  10456. }
  10457. }
  10458. leaf = obj;
  10459. }
  10460. return leaf;
  10461. };
  10462. var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
  10463. if (!givenKey) {
  10464. return;
  10465. }
  10466. // Transform dot notation to bracket notation
  10467. var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
  10468. // The regex chunks
  10469. var brackets = /(\[[^[\]]*])/;
  10470. var child = /(\[[^[\]]*])/g;
  10471. // Get the parent
  10472. var segment = options.depth > 0 && brackets.exec(key);
  10473. var parent = segment ? key.slice(0, segment.index) : key;
  10474. // Stash the parent if it exists
  10475. var keys = [];
  10476. if (parent) {
  10477. // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
  10478. if (!options.plainObjects && has$3.call(Object.prototype, parent)) {
  10479. if (!options.allowPrototypes) {
  10480. return;
  10481. }
  10482. }
  10483. keys.push(parent);
  10484. }
  10485. // Loop through children appending to the array until we hit depth
  10486. var i = 0;
  10487. while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
  10488. i += 1;
  10489. if (!options.plainObjects && has$3.call(Object.prototype, segment[1].slice(1, -1))) {
  10490. if (!options.allowPrototypes) {
  10491. return;
  10492. }
  10493. }
  10494. keys.push(segment[1]);
  10495. }
  10496. // If there's a remainder, just add whatever is left
  10497. if (segment) {
  10498. keys.push('[' + key.slice(segment.index) + ']');
  10499. }
  10500. return parseObject(keys, val, options);
  10501. };
  10502. var normalizeParseOptions = function normalizeParseOptions(opts) {
  10503. if (!opts) {
  10504. return defaults$2;
  10505. }
  10506. if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
  10507. throw new TypeError('Decoder has to be a function.');
  10508. }
  10509. if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
  10510. throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
  10511. }
  10512. var charset = typeof opts.charset === 'undefined' ? defaults$2.charset : opts.charset;
  10513. return {
  10514. allowDots: typeof opts.allowDots === 'undefined' ? defaults$2.allowDots : !!opts.allowDots,
  10515. allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$2.allowPrototypes,
  10516. arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$2.arrayLimit,
  10517. charset: charset,
  10518. charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
  10519. comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$2.comma,
  10520. decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$2.decoder,
  10521. delimiter: typeof opts.delimiter === 'string' || utils$1.isRegExp(opts.delimiter) ? opts.delimiter : defaults$2.delimiter,
  10522. // eslint-disable-next-line no-implicit-coercion, no-extra-parens
  10523. depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$2.depth,
  10524. ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
  10525. interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$2.interpretNumericEntities,
  10526. parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$2.parameterLimit,
  10527. parseArrays: opts.parseArrays !== false,
  10528. plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$2.plainObjects,
  10529. strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$2.strictNullHandling
  10530. };
  10531. };
  10532. var parse$1 = function (str, opts) {
  10533. var options = normalizeParseOptions(opts);
  10534. if (str === '' || str === null || typeof str === 'undefined') {
  10535. return options.plainObjects ? Object.create(null) : {};
  10536. }
  10537. var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
  10538. var obj = options.plainObjects ? Object.create(null) : {};
  10539. // Iterate over the keys and setup the new object
  10540. var keys = Object.keys(tempObj);
  10541. for (var i = 0; i < keys.length; ++i) {
  10542. var key = keys[i];
  10543. var newObj = parseKeys(key, tempObj[key], options);
  10544. obj = utils$1.merge(obj, newObj, options);
  10545. }
  10546. return utils$1.compact(obj);
  10547. };
  10548. 'use strict';
  10549. var lib = {
  10550. formats: formats,
  10551. parse: parse$1,
  10552. stringify: stringify_1
  10553. };
  10554. var lib_1 = lib.formats;
  10555. var lib_2 = lib.parse;
  10556. var lib_3 = lib.stringify;
  10557. var client = function(axios, { url, ...credentials }) {
  10558. const config = {
  10559. url,
  10560. method: 'post',
  10561. data: lib.stringify(credentials)
  10562. };
  10563. return () => axios(config).then(res => res.data);
  10564. };
  10565. function getMaxAge(res) {
  10566. return res.expires_in;
  10567. }
  10568. function headerFormatter(res) {
  10569. return 'Bearer ' + res.access_token;
  10570. }
  10571. var interceptor = function (tokenProvider, authenticate) {
  10572. const getToken = tokenProvider.tokenCache(authenticate, { getMaxAge });
  10573. return tokenProvider({ getToken, headerFormatter });
  10574. };
  10575. var src = {
  10576. client: client,
  10577. interceptor: interceptor
  10578. };
  10579. var src_1 = src.client;
  10580. var src_2 = src.interceptor;
  10581. 'use strict';
  10582. /**
  10583. * Check if we're required to add a port number.
  10584. *
  10585. * @see https://url.spec.whatwg.org/#default-port
  10586. * @param {Number|String} port Port number we need to check
  10587. * @param {String} protocol Protocol we need to check against.
  10588. * @returns {Boolean} Is it a default port for the given protocol
  10589. * @api private
  10590. */
  10591. var requiresPort = function required(port, protocol) {
  10592. protocol = protocol.split(':')[0];
  10593. port = +port;
  10594. if (!port) return false;
  10595. switch (protocol) {
  10596. case 'http':
  10597. case 'ws':
  10598. return port !== 80;
  10599. case 'https':
  10600. case 'wss':
  10601. return port !== 443;
  10602. case 'ftp':
  10603. return port !== 21;
  10604. case 'gopher':
  10605. return port !== 70;
  10606. case 'file':
  10607. return false;
  10608. }
  10609. return port !== 0;
  10610. };
  10611. 'use strict';
  10612. var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
  10613. , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i
  10614. , whitespace = '[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]'
  10615. , left = new RegExp('^'+ whitespace +'+');
  10616. /**
  10617. * Trim a given string.
  10618. *
  10619. * @param {String} str String to trim.
  10620. * @public
  10621. */
  10622. function trimLeft(str) {
  10623. return (str ? str : '').toString().replace(left, '');
  10624. }
  10625. /**
  10626. * These are the parse rules for the URL parser, it informs the parser
  10627. * about:
  10628. *
  10629. * 0. The char it Needs to parse, if it's a string it should be done using
  10630. * indexOf, RegExp using exec and NaN means set as current value.
  10631. * 1. The property we should set when parsing this value.
  10632. * 2. Indication if it's backwards or forward parsing, when set as number it's
  10633. * the value of extra chars that should be split off.
  10634. * 3. Inherit from location if non existing in the parser.
  10635. * 4. `toLowerCase` the resulting value.
  10636. */
  10637. var rules = [
  10638. ['#', 'hash'], // Extract from the back.
  10639. ['?', 'query'], // Extract from the back.
  10640. function sanitize(address) { // Sanitize what is left of the address
  10641. return address.replace('\\', '/');
  10642. },
  10643. ['/', 'pathname'], // Extract from the back.
  10644. ['@', 'auth', 1], // Extract from the front.
  10645. [NaN, 'host', undefined, 1, 1], // Set left over value.
  10646. [/:(\d+)$/, 'port', undefined, 1], // RegExp the back.
  10647. [NaN, 'hostname', undefined, 1, 1] // Set left over.
  10648. ];
  10649. /**
  10650. * These properties should not be copied or inherited from. This is only needed
  10651. * for all non blob URL's as a blob URL does not include a hash, only the
  10652. * origin.
  10653. *
  10654. * @type {Object}
  10655. * @private
  10656. */
  10657. var ignore = { hash: 1, query: 1 };
  10658. /**
  10659. * The location object differs when your code is loaded through a normal page,
  10660. * Worker or through a worker using a blob. And with the blobble begins the
  10661. * trouble as the location object will contain the URL of the blob, not the
  10662. * location of the page where our code is loaded in. The actual origin is
  10663. * encoded in the `pathname` so we can thankfully generate a good "default"
  10664. * location from it so we can generate proper relative URL's again.
  10665. *
  10666. * @param {Object|String} loc Optional default location object.
  10667. * @returns {Object} lolcation object.
  10668. * @public
  10669. */
  10670. function lolcation(loc) {
  10671. var globalVar;
  10672. if (typeof window !== 'undefined') globalVar = window;
  10673. else if (typeof commonjsGlobal !== 'undefined') globalVar = commonjsGlobal;
  10674. else if (typeof self !== 'undefined') globalVar = self;
  10675. else globalVar = {};
  10676. var location = globalVar.location || {};
  10677. loc = loc || location;
  10678. var finaldestination = {}
  10679. , type = typeof loc
  10680. , key;
  10681. if ('blob:' === loc.protocol) {
  10682. finaldestination = new Url(unescape(loc.pathname), {});
  10683. } else if ('string' === type) {
  10684. finaldestination = new Url(loc, {});
  10685. for (key in ignore) delete finaldestination[key];
  10686. } else if ('object' === type) {
  10687. for (key in loc) {
  10688. if (key in ignore) continue;
  10689. finaldestination[key] = loc[key];
  10690. }
  10691. if (finaldestination.slashes === undefined) {
  10692. finaldestination.slashes = slashes.test(loc.href);
  10693. }
  10694. }
  10695. return finaldestination;
  10696. }
  10697. /**
  10698. * @typedef ProtocolExtract
  10699. * @type Object
  10700. * @property {String} protocol Protocol matched in the URL, in lowercase.
  10701. * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
  10702. * @property {String} rest Rest of the URL that is not part of the protocol.
  10703. */
  10704. /**
  10705. * Extract protocol information from a URL with/without double slash ("//").
  10706. *
  10707. * @param {String} address URL we want to extract from.
  10708. * @return {ProtocolExtract} Extracted information.
  10709. * @private
  10710. */
  10711. function extractProtocol(address) {
  10712. address = trimLeft(address);
  10713. var match = protocolre.exec(address);
  10714. return {
  10715. protocol: match[1] ? match[1].toLowerCase() : '',
  10716. slashes: !!match[2],
  10717. rest: match[3]
  10718. };
  10719. }
  10720. /**
  10721. * Resolve a relative URL pathname against a base URL pathname.
  10722. *
  10723. * @param {String} relative Pathname of the relative URL.
  10724. * @param {String} base Pathname of the base URL.
  10725. * @return {String} Resolved pathname.
  10726. * @private
  10727. */
  10728. function resolve(relative, base) {
  10729. if (relative === '') return base;
  10730. var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
  10731. , i = path.length
  10732. , last = path[i - 1]
  10733. , unshift = false
  10734. , up = 0;
  10735. while (i--) {
  10736. if (path[i] === '.') {
  10737. path.splice(i, 1);
  10738. } else if (path[i] === '..') {
  10739. path.splice(i, 1);
  10740. up++;
  10741. } else if (up) {
  10742. if (i === 0) unshift = true;
  10743. path.splice(i, 1);
  10744. up--;
  10745. }
  10746. }
  10747. if (unshift) path.unshift('');
  10748. if (last === '.' || last === '..') path.push('');
  10749. return path.join('/');
  10750. }
  10751. /**
  10752. * The actual URL instance. Instead of returning an object we've opted-in to
  10753. * create an actual constructor as it's much more memory efficient and
  10754. * faster and it pleases my OCD.
  10755. *
  10756. * It is worth noting that we should not use `URL` as class name to prevent
  10757. * clashes with the global URL instance that got introduced in browsers.
  10758. *
  10759. * @constructor
  10760. * @param {String} address URL we want to parse.
  10761. * @param {Object|String} [location] Location defaults for relative paths.
  10762. * @param {Boolean|Function} [parser] Parser for the query string.
  10763. * @private
  10764. */
  10765. function Url(address, location, parser) {
  10766. address = trimLeft(address);
  10767. if (!(this instanceof Url)) {
  10768. return new Url(address, location, parser);
  10769. }
  10770. var relative, extracted, parse, instruction, index, key
  10771. , instructions = rules.slice()
  10772. , type = typeof location
  10773. , url = this
  10774. , i = 0;
  10775. //
  10776. // The following if statements allows this module two have compatibility with
  10777. // 2 different API:
  10778. //
  10779. // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
  10780. // where the boolean indicates that the query string should also be parsed.
  10781. //
  10782. // 2. The `URL` interface of the browser which accepts a URL, object as
  10783. // arguments. The supplied object will be used as default values / fall-back
  10784. // for relative paths.
  10785. //
  10786. if ('object' !== type && 'string' !== type) {
  10787. parser = location;
  10788. location = null;
  10789. }
  10790. if (parser && 'function' !== typeof parser) parser = querystringify_1.parse;
  10791. location = lolcation(location);
  10792. //
  10793. // Extract protocol information before running the instructions.
  10794. //
  10795. extracted = extractProtocol(address || '');
  10796. relative = !extracted.protocol && !extracted.slashes;
  10797. url.slashes = extracted.slashes || relative && location.slashes;
  10798. url.protocol = extracted.protocol || location.protocol || '';
  10799. address = extracted.rest;
  10800. //
  10801. // When the authority component is absent the URL starts with a path
  10802. // component.
  10803. //
  10804. if (!extracted.slashes) instructions[3] = [/(.*)/, 'pathname'];
  10805. for (; i < instructions.length; i++) {
  10806. instruction = instructions[i];
  10807. if (typeof instruction === 'function') {
  10808. address = instruction(address);
  10809. continue;
  10810. }
  10811. parse = instruction[0];
  10812. key = instruction[1];
  10813. if (parse !== parse) {
  10814. url[key] = address;
  10815. } else if ('string' === typeof parse) {
  10816. if (~(index = address.indexOf(parse))) {
  10817. if ('number' === typeof instruction[2]) {
  10818. url[key] = address.slice(0, index);
  10819. address = address.slice(index + instruction[2]);
  10820. } else {
  10821. url[key] = address.slice(index);
  10822. address = address.slice(0, index);
  10823. }
  10824. }
  10825. } else if ((index = parse.exec(address))) {
  10826. url[key] = index[1];
  10827. address = address.slice(0, index.index);
  10828. }
  10829. url[key] = url[key] || (
  10830. relative && instruction[3] ? location[key] || '' : ''
  10831. );
  10832. //
  10833. // Hostname, host and protocol should be lowercased so they can be used to
  10834. // create a proper `origin`.
  10835. //
  10836. if (instruction[4]) url[key] = url[key].toLowerCase();
  10837. }
  10838. //
  10839. // Also parse the supplied query string in to an object. If we're supplied
  10840. // with a custom parser as function use that instead of the default build-in
  10841. // parser.
  10842. //
  10843. if (parser) url.query = parser(url.query);
  10844. //
  10845. // If the URL is relative, resolve the pathname against the base URL.
  10846. //
  10847. if (
  10848. relative
  10849. && location.slashes
  10850. && url.pathname.charAt(0) !== '/'
  10851. && (url.pathname !== '' || location.pathname !== '')
  10852. ) {
  10853. url.pathname = resolve(url.pathname, location.pathname);
  10854. }
  10855. //
  10856. // We should not add port numbers if they are already the default port number
  10857. // for a given protocol. As the host also contains the port number we're going
  10858. // override it with the hostname which contains no port number.
  10859. //
  10860. if (!requiresPort(url.port, url.protocol)) {
  10861. url.host = url.hostname;
  10862. url.port = '';
  10863. }
  10864. //
  10865. // Parse down the `auth` for the username and password.
  10866. //
  10867. url.username = url.password = '';
  10868. if (url.auth) {
  10869. instruction = url.auth.split(':');
  10870. url.username = instruction[0] || '';
  10871. url.password = instruction[1] || '';
  10872. }
  10873. url.origin = url.protocol && url.host && url.protocol !== 'file:'
  10874. ? url.protocol +'//'+ url.host
  10875. : 'null';
  10876. //
  10877. // The href is just the compiled result.
  10878. //
  10879. url.href = url.toString();
  10880. }
  10881. /**
  10882. * This is convenience method for changing properties in the URL instance to
  10883. * insure that they all propagate correctly.
  10884. *
  10885. * @param {String} part Property we need to adjust.
  10886. * @param {Mixed} value The newly assigned value.
  10887. * @param {Boolean|Function} fn When setting the query, it will be the function
  10888. * used to parse the query.
  10889. * When setting the protocol, double slash will be
  10890. * removed from the final url if it is true.
  10891. * @returns {URL} URL instance for chaining.
  10892. * @public
  10893. */
  10894. function set(part, value, fn) {
  10895. var url = this;
  10896. switch (part) {
  10897. case 'query':
  10898. if ('string' === typeof value && value.length) {
  10899. value = (fn || querystringify_1.parse)(value);
  10900. }
  10901. url[part] = value;
  10902. break;
  10903. case 'port':
  10904. url[part] = value;
  10905. if (!requiresPort(value, url.protocol)) {
  10906. url.host = url.hostname;
  10907. url[part] = '';
  10908. } else if (value) {
  10909. url.host = url.hostname +':'+ value;
  10910. }
  10911. break;
  10912. case 'hostname':
  10913. url[part] = value;
  10914. if (url.port) value += ':'+ url.port;
  10915. url.host = value;
  10916. break;
  10917. case 'host':
  10918. url[part] = value;
  10919. if (/:\d+$/.test(value)) {
  10920. value = value.split(':');
  10921. url.port = value.pop();
  10922. url.hostname = value.join(':');
  10923. } else {
  10924. url.hostname = value;
  10925. url.port = '';
  10926. }
  10927. break;
  10928. case 'protocol':
  10929. url.protocol = value.toLowerCase();
  10930. url.slashes = !fn;
  10931. break;
  10932. case 'pathname':
  10933. case 'hash':
  10934. if (value) {
  10935. var char = part === 'pathname' ? '/' : '#';
  10936. url[part] = value.charAt(0) !== char ? char + value : value;
  10937. } else {
  10938. url[part] = value;
  10939. }
  10940. break;
  10941. default:
  10942. url[part] = value;
  10943. }
  10944. for (var i = 0; i < rules.length; i++) {
  10945. var ins = rules[i];
  10946. if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
  10947. }
  10948. url.origin = url.protocol && url.host && url.protocol !== 'file:'
  10949. ? url.protocol +'//'+ url.host
  10950. : 'null';
  10951. url.href = url.toString();
  10952. return url;
  10953. }
  10954. /**
  10955. * Transform the properties back in to a valid and full URL string.
  10956. *
  10957. * @param {Function} stringify Optional query stringify function.
  10958. * @returns {String} Compiled version of the URL.
  10959. * @public
  10960. */
  10961. function toString$1(stringify) {
  10962. if (!stringify || 'function' !== typeof stringify) stringify = querystringify_1.stringify;
  10963. var query
  10964. , url = this
  10965. , protocol = url.protocol;
  10966. if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
  10967. var result = protocol + (url.slashes ? '//' : '');
  10968. if (url.username) {
  10969. result += url.username;
  10970. if (url.password) result += ':'+ url.password;
  10971. result += '@';
  10972. }
  10973. result += url.host + url.pathname;
  10974. query = 'object' === typeof url.query ? stringify(url.query) : url.query;
  10975. if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
  10976. if (url.hash) result += url.hash;
  10977. return result;
  10978. }
  10979. Url.prototype = { set: set, toString: toString$1 };
  10980. //
  10981. // Expose the URL parser and some additional properties that might be useful for
  10982. // others or testing.
  10983. //
  10984. Url.extractProtocol = extractProtocol;
  10985. Url.location = lolcation;
  10986. Url.trimLeft = trimLeft;
  10987. Url.qs = querystringify_1;
  10988. var urlParse = Url;
  10989. var index_min = createCommonjsModule(function (module) {
  10990. module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n={statusCodes:[401]};t.default=function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=t.interceptors.response.use(function(e){return e},function(s){var i=o.hasOwnProperty("statusCodes")&&o.statusCodes.length?o.statusCodes:n.statusCodes;if(!s.response||s.response.status&&-1===i.indexOf(+s.response.status))return Promise.reject(s);t.interceptors.response.eject(u);var c=r(s),f=t.interceptors.request.use(function(e){return c.then(function(){return e})});return c.then(function(){return t.interceptors.request.eject(f),t(s.response.config)}).catch(function(e){return t.interceptors.request.eject(f),Promise.reject(e)}).finally(function(){return e(t,r,o)})});return t};}]);
  10991. });
  10992. var createAuthRefreshInterceptor = unwrapExports(index_min);
  10993. /* global DOMException */
  10994. var clipboardCopy_1 = clipboardCopy;
  10995. function clipboardCopy (text) {
  10996. // Use the Async Clipboard API when available. Requires a secure browing
  10997. // context (i.e. HTTPS)
  10998. if (navigator.clipboard) {
  10999. return navigator.clipboard.writeText(text).catch(function (err) {
  11000. throw (err !== undefined ? err : new DOMException('The request is not allowed', 'NotAllowedError'))
  11001. })
  11002. }
  11003. // ...Otherwise, use document.execCommand() fallback
  11004. // Put the text to copy into a <span>
  11005. var span = document.createElement('span');
  11006. span.textContent = text;
  11007. // Preserve consecutive spaces and newlines
  11008. span.style.whiteSpace = 'pre';
  11009. // Add the <span> to the page
  11010. document.body.appendChild(span);
  11011. // Make a selection object representing the range of text selected by the user
  11012. var selection = window.getSelection();
  11013. var range = window.document.createRange();
  11014. selection.removeAllRanges();
  11015. range.selectNode(span);
  11016. selection.addRange(range);
  11017. // Copy text to the clipboard
  11018. var success = false;
  11019. try {
  11020. success = window.document.execCommand('copy');
  11021. } catch (err) {
  11022. console.log('error', err);
  11023. }
  11024. // Cleanup
  11025. selection.removeAllRanges();
  11026. window.document.body.removeChild(span);
  11027. return success
  11028. ? Promise.resolve()
  11029. : Promise.reject(new DOMException('The request is not allowed', 'NotAllowedError'))
  11030. }
  11031. var core = createCommonjsModule(function (module, exports) {
  11032. ;(function (root, factory) {
  11033. if ('object' === "object") {
  11034. // CommonJS
  11035. module.exports = exports = factory();
  11036. }
  11037. else if (typeof undefined === "function" && undefined.amd) {
  11038. // AMD
  11039. undefined([], factory);
  11040. }
  11041. else {
  11042. // Global (browser)
  11043. root.CryptoJS = factory();
  11044. }
  11045. }(commonjsGlobal, function () {
  11046. /**
  11047. * CryptoJS core components.
  11048. */
  11049. var CryptoJS = CryptoJS || (function (Math, undefined$1) {
  11050. /*
  11051. * Local polyfil of Object.create
  11052. */
  11053. var create = Object.create || (function () {
  11054. function F() {};
  11055. return function (obj) {
  11056. var subtype;
  11057. F.prototype = obj;
  11058. subtype = new F();
  11059. F.prototype = null;
  11060. return subtype;
  11061. };
  11062. }());
  11063. /**
  11064. * CryptoJS namespace.
  11065. */
  11066. var C = {};
  11067. /**
  11068. * Library namespace.
  11069. */
  11070. var C_lib = C.lib = {};
  11071. /**
  11072. * Base object for prototypal inheritance.
  11073. */
  11074. var Base = C_lib.Base = (function () {
  11075. return {
  11076. /**
  11077. * Creates a new object that inherits from this object.
  11078. *
  11079. * @param {Object} overrides Properties to copy into the new object.
  11080. *
  11081. * @return {Object} The new object.
  11082. *
  11083. * @static
  11084. *
  11085. * @example
  11086. *
  11087. * var MyType = CryptoJS.lib.Base.extend({
  11088. * field: 'value',
  11089. *
  11090. * method: function () {
  11091. * }
  11092. * });
  11093. */
  11094. extend: function (overrides) {
  11095. // Spawn
  11096. var subtype = create(this);
  11097. // Augment
  11098. if (overrides) {
  11099. subtype.mixIn(overrides);
  11100. }
  11101. // Create default initializer
  11102. if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
  11103. subtype.init = function () {
  11104. subtype.$super.init.apply(this, arguments);
  11105. };
  11106. }
  11107. // Initializer's prototype is the subtype object
  11108. subtype.init.prototype = subtype;
  11109. // Reference supertype
  11110. subtype.$super = this;
  11111. return subtype;
  11112. },
  11113. /**
  11114. * Extends this object and runs the init method.
  11115. * Arguments to create() will be passed to init().
  11116. *
  11117. * @return {Object} The new object.
  11118. *
  11119. * @static
  11120. *
  11121. * @example
  11122. *
  11123. * var instance = MyType.create();
  11124. */
  11125. create: function () {
  11126. var instance = this.extend();
  11127. instance.init.apply(instance, arguments);
  11128. return instance;
  11129. },
  11130. /**
  11131. * Initializes a newly created object.
  11132. * Override this method to add some logic when your objects are created.
  11133. *
  11134. * @example
  11135. *
  11136. * var MyType = CryptoJS.lib.Base.extend({
  11137. * init: function () {
  11138. * // ...
  11139. * }
  11140. * });
  11141. */
  11142. init: function () {
  11143. },
  11144. /**
  11145. * Copies properties into this object.
  11146. *
  11147. * @param {Object} properties The properties to mix in.
  11148. *
  11149. * @example
  11150. *
  11151. * MyType.mixIn({
  11152. * field: 'value'
  11153. * });
  11154. */
  11155. mixIn: function (properties) {
  11156. for (var propertyName in properties) {
  11157. if (properties.hasOwnProperty(propertyName)) {
  11158. this[propertyName] = properties[propertyName];
  11159. }
  11160. }
  11161. // IE won't copy toString using the loop above
  11162. if (properties.hasOwnProperty('toString')) {
  11163. this.toString = properties.toString;
  11164. }
  11165. },
  11166. /**
  11167. * Creates a copy of this object.
  11168. *
  11169. * @return {Object} The clone.
  11170. *
  11171. * @example
  11172. *
  11173. * var clone = instance.clone();
  11174. */
  11175. clone: function () {
  11176. return this.init.prototype.extend(this);
  11177. }
  11178. };
  11179. }());
  11180. /**
  11181. * An array of 32-bit words.
  11182. *
  11183. * @property {Array} words The array of 32-bit words.
  11184. * @property {number} sigBytes The number of significant bytes in this word array.
  11185. */
  11186. var WordArray = C_lib.WordArray = Base.extend({
  11187. /**
  11188. * Initializes a newly created word array.
  11189. *
  11190. * @param {Array} words (Optional) An array of 32-bit words.
  11191. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  11192. *
  11193. * @example
  11194. *
  11195. * var wordArray = CryptoJS.lib.WordArray.create();
  11196. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  11197. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  11198. */
  11199. init: function (words, sigBytes) {
  11200. words = this.words = words || [];
  11201. if (sigBytes != undefined$1) {
  11202. this.sigBytes = sigBytes;
  11203. } else {
  11204. this.sigBytes = words.length * 4;
  11205. }
  11206. },
  11207. /**
  11208. * Converts this word array to a string.
  11209. *
  11210. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  11211. *
  11212. * @return {string} The stringified word array.
  11213. *
  11214. * @example
  11215. *
  11216. * var string = wordArray + '';
  11217. * var string = wordArray.toString();
  11218. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  11219. */
  11220. toString: function (encoder) {
  11221. return (encoder || Hex).stringify(this);
  11222. },
  11223. /**
  11224. * Concatenates a word array to this word array.
  11225. *
  11226. * @param {WordArray} wordArray The word array to append.
  11227. *
  11228. * @return {WordArray} This word array.
  11229. *
  11230. * @example
  11231. *
  11232. * wordArray1.concat(wordArray2);
  11233. */
  11234. concat: function (wordArray) {
  11235. // Shortcuts
  11236. var thisWords = this.words;
  11237. var thatWords = wordArray.words;
  11238. var thisSigBytes = this.sigBytes;
  11239. var thatSigBytes = wordArray.sigBytes;
  11240. // Clamp excess bits
  11241. this.clamp();
  11242. // Concat
  11243. if (thisSigBytes % 4) {
  11244. // Copy one byte at a time
  11245. for (var i = 0; i < thatSigBytes; i++) {
  11246. var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  11247. thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
  11248. }
  11249. } else {
  11250. // Copy one word at a time
  11251. for (var i = 0; i < thatSigBytes; i += 4) {
  11252. thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
  11253. }
  11254. }
  11255. this.sigBytes += thatSigBytes;
  11256. // Chainable
  11257. return this;
  11258. },
  11259. /**
  11260. * Removes insignificant bits.
  11261. *
  11262. * @example
  11263. *
  11264. * wordArray.clamp();
  11265. */
  11266. clamp: function () {
  11267. // Shortcuts
  11268. var words = this.words;
  11269. var sigBytes = this.sigBytes;
  11270. // Clamp
  11271. words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
  11272. words.length = Math.ceil(sigBytes / 4);
  11273. },
  11274. /**
  11275. * Creates a copy of this word array.
  11276. *
  11277. * @return {WordArray} The clone.
  11278. *
  11279. * @example
  11280. *
  11281. * var clone = wordArray.clone();
  11282. */
  11283. clone: function () {
  11284. var clone = Base.clone.call(this);
  11285. clone.words = this.words.slice(0);
  11286. return clone;
  11287. },
  11288. /**
  11289. * Creates a word array filled with random bytes.
  11290. *
  11291. * @param {number} nBytes The number of random bytes to generate.
  11292. *
  11293. * @return {WordArray} The random word array.
  11294. *
  11295. * @static
  11296. *
  11297. * @example
  11298. *
  11299. * var wordArray = CryptoJS.lib.WordArray.random(16);
  11300. */
  11301. random: function (nBytes) {
  11302. var words = [];
  11303. var r = (function (m_w) {
  11304. var m_w = m_w;
  11305. var m_z = 0x3ade68b1;
  11306. var mask = 0xffffffff;
  11307. return function () {
  11308. m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
  11309. m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
  11310. var result = ((m_z << 0x10) + m_w) & mask;
  11311. result /= 0x100000000;
  11312. result += 0.5;
  11313. return result * (Math.random() > .5 ? 1 : -1);
  11314. }
  11315. });
  11316. for (var i = 0, rcache; i < nBytes; i += 4) {
  11317. var _r = r((rcache || Math.random()) * 0x100000000);
  11318. rcache = _r() * 0x3ade67b7;
  11319. words.push((_r() * 0x100000000) | 0);
  11320. }
  11321. return new WordArray.init(words, nBytes);
  11322. }
  11323. });
  11324. /**
  11325. * Encoder namespace.
  11326. */
  11327. var C_enc = C.enc = {};
  11328. /**
  11329. * Hex encoding strategy.
  11330. */
  11331. var Hex = C_enc.Hex = {
  11332. /**
  11333. * Converts a word array to a hex string.
  11334. *
  11335. * @param {WordArray} wordArray The word array.
  11336. *
  11337. * @return {string} The hex string.
  11338. *
  11339. * @static
  11340. *
  11341. * @example
  11342. *
  11343. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  11344. */
  11345. stringify: function (wordArray) {
  11346. // Shortcuts
  11347. var words = wordArray.words;
  11348. var sigBytes = wordArray.sigBytes;
  11349. // Convert
  11350. var hexChars = [];
  11351. for (var i = 0; i < sigBytes; i++) {
  11352. var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  11353. hexChars.push((bite >>> 4).toString(16));
  11354. hexChars.push((bite & 0x0f).toString(16));
  11355. }
  11356. return hexChars.join('');
  11357. },
  11358. /**
  11359. * Converts a hex string to a word array.
  11360. *
  11361. * @param {string} hexStr The hex string.
  11362. *
  11363. * @return {WordArray} The word array.
  11364. *
  11365. * @static
  11366. *
  11367. * @example
  11368. *
  11369. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  11370. */
  11371. parse: function (hexStr) {
  11372. // Shortcut
  11373. var hexStrLength = hexStr.length;
  11374. // Convert
  11375. var words = [];
  11376. for (var i = 0; i < hexStrLength; i += 2) {
  11377. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
  11378. }
  11379. return new WordArray.init(words, hexStrLength / 2);
  11380. }
  11381. };
  11382. /**
  11383. * Latin1 encoding strategy.
  11384. */
  11385. var Latin1 = C_enc.Latin1 = {
  11386. /**
  11387. * Converts a word array to a Latin1 string.
  11388. *
  11389. * @param {WordArray} wordArray The word array.
  11390. *
  11391. * @return {string} The Latin1 string.
  11392. *
  11393. * @static
  11394. *
  11395. * @example
  11396. *
  11397. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  11398. */
  11399. stringify: function (wordArray) {
  11400. // Shortcuts
  11401. var words = wordArray.words;
  11402. var sigBytes = wordArray.sigBytes;
  11403. // Convert
  11404. var latin1Chars = [];
  11405. for (var i = 0; i < sigBytes; i++) {
  11406. var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  11407. latin1Chars.push(String.fromCharCode(bite));
  11408. }
  11409. return latin1Chars.join('');
  11410. },
  11411. /**
  11412. * Converts a Latin1 string to a word array.
  11413. *
  11414. * @param {string} latin1Str The Latin1 string.
  11415. *
  11416. * @return {WordArray} The word array.
  11417. *
  11418. * @static
  11419. *
  11420. * @example
  11421. *
  11422. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  11423. */
  11424. parse: function (latin1Str) {
  11425. // Shortcut
  11426. var latin1StrLength = latin1Str.length;
  11427. // Convert
  11428. var words = [];
  11429. for (var i = 0; i < latin1StrLength; i++) {
  11430. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
  11431. }
  11432. return new WordArray.init(words, latin1StrLength);
  11433. }
  11434. };
  11435. /**
  11436. * UTF-8 encoding strategy.
  11437. */
  11438. var Utf8 = C_enc.Utf8 = {
  11439. /**
  11440. * Converts a word array to a UTF-8 string.
  11441. *
  11442. * @param {WordArray} wordArray The word array.
  11443. *
  11444. * @return {string} The UTF-8 string.
  11445. *
  11446. * @static
  11447. *
  11448. * @example
  11449. *
  11450. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  11451. */
  11452. stringify: function (wordArray) {
  11453. try {
  11454. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  11455. } catch (e) {
  11456. throw new Error('Malformed UTF-8 data');
  11457. }
  11458. },
  11459. /**
  11460. * Converts a UTF-8 string to a word array.
  11461. *
  11462. * @param {string} utf8Str The UTF-8 string.
  11463. *
  11464. * @return {WordArray} The word array.
  11465. *
  11466. * @static
  11467. *
  11468. * @example
  11469. *
  11470. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  11471. */
  11472. parse: function (utf8Str) {
  11473. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  11474. }
  11475. };
  11476. /**
  11477. * Abstract buffered block algorithm template.
  11478. *
  11479. * The property blockSize must be implemented in a concrete subtype.
  11480. *
  11481. * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
  11482. */
  11483. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  11484. /**
  11485. * Resets this block algorithm's data buffer to its initial state.
  11486. *
  11487. * @example
  11488. *
  11489. * bufferedBlockAlgorithm.reset();
  11490. */
  11491. reset: function () {
  11492. // Initial values
  11493. this._data = new WordArray.init();
  11494. this._nDataBytes = 0;
  11495. },
  11496. /**
  11497. * Adds new data to this block algorithm's buffer.
  11498. *
  11499. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  11500. *
  11501. * @example
  11502. *
  11503. * bufferedBlockAlgorithm._append('data');
  11504. * bufferedBlockAlgorithm._append(wordArray);
  11505. */
  11506. _append: function (data) {
  11507. // Convert string to WordArray, else assume WordArray already
  11508. if (typeof data == 'string') {
  11509. data = Utf8.parse(data);
  11510. }
  11511. // Append
  11512. this._data.concat(data);
  11513. this._nDataBytes += data.sigBytes;
  11514. },
  11515. /**
  11516. * Processes available data blocks.
  11517. *
  11518. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  11519. *
  11520. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  11521. *
  11522. * @return {WordArray} The processed data.
  11523. *
  11524. * @example
  11525. *
  11526. * var processedData = bufferedBlockAlgorithm._process();
  11527. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  11528. */
  11529. _process: function (doFlush) {
  11530. // Shortcuts
  11531. var data = this._data;
  11532. var dataWords = data.words;
  11533. var dataSigBytes = data.sigBytes;
  11534. var blockSize = this.blockSize;
  11535. var blockSizeBytes = blockSize * 4;
  11536. // Count blocks ready
  11537. var nBlocksReady = dataSigBytes / blockSizeBytes;
  11538. if (doFlush) {
  11539. // Round up to include partial blocks
  11540. nBlocksReady = Math.ceil(nBlocksReady);
  11541. } else {
  11542. // Round down to include only full blocks,
  11543. // less the number of blocks that must remain in the buffer
  11544. nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
  11545. }
  11546. // Count words ready
  11547. var nWordsReady = nBlocksReady * blockSize;
  11548. // Count bytes ready
  11549. var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
  11550. // Process blocks
  11551. if (nWordsReady) {
  11552. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  11553. // Perform concrete-algorithm logic
  11554. this._doProcessBlock(dataWords, offset);
  11555. }
  11556. // Remove processed words
  11557. var processedWords = dataWords.splice(0, nWordsReady);
  11558. data.sigBytes -= nBytesReady;
  11559. }
  11560. // Return processed words
  11561. return new WordArray.init(processedWords, nBytesReady);
  11562. },
  11563. /**
  11564. * Creates a copy of this object.
  11565. *
  11566. * @return {Object} The clone.
  11567. *
  11568. * @example
  11569. *
  11570. * var clone = bufferedBlockAlgorithm.clone();
  11571. */
  11572. clone: function () {
  11573. var clone = Base.clone.call(this);
  11574. clone._data = this._data.clone();
  11575. return clone;
  11576. },
  11577. _minBufferSize: 0
  11578. });
  11579. /**
  11580. * Abstract hasher template.
  11581. *
  11582. * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
  11583. */
  11584. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  11585. /**
  11586. * Configuration options.
  11587. */
  11588. cfg: Base.extend(),
  11589. /**
  11590. * Initializes a newly created hasher.
  11591. *
  11592. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  11593. *
  11594. * @example
  11595. *
  11596. * var hasher = CryptoJS.algo.SHA256.create();
  11597. */
  11598. init: function (cfg) {
  11599. // Apply config defaults
  11600. this.cfg = this.cfg.extend(cfg);
  11601. // Set initial values
  11602. this.reset();
  11603. },
  11604. /**
  11605. * Resets this hasher to its initial state.
  11606. *
  11607. * @example
  11608. *
  11609. * hasher.reset();
  11610. */
  11611. reset: function () {
  11612. // Reset data buffer
  11613. BufferedBlockAlgorithm.reset.call(this);
  11614. // Perform concrete-hasher logic
  11615. this._doReset();
  11616. },
  11617. /**
  11618. * Updates this hasher with a message.
  11619. *
  11620. * @param {WordArray|string} messageUpdate The message to append.
  11621. *
  11622. * @return {Hasher} This hasher.
  11623. *
  11624. * @example
  11625. *
  11626. * hasher.update('message');
  11627. * hasher.update(wordArray);
  11628. */
  11629. update: function (messageUpdate) {
  11630. // Append
  11631. this._append(messageUpdate);
  11632. // Update the hash
  11633. this._process();
  11634. // Chainable
  11635. return this;
  11636. },
  11637. /**
  11638. * Finalizes the hash computation.
  11639. * Note that the finalize operation is effectively a destructive, read-once operation.
  11640. *
  11641. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  11642. *
  11643. * @return {WordArray} The hash.
  11644. *
  11645. * @example
  11646. *
  11647. * var hash = hasher.finalize();
  11648. * var hash = hasher.finalize('message');
  11649. * var hash = hasher.finalize(wordArray);
  11650. */
  11651. finalize: function (messageUpdate) {
  11652. // Final message update
  11653. if (messageUpdate) {
  11654. this._append(messageUpdate);
  11655. }
  11656. // Perform concrete-hasher logic
  11657. var hash = this._doFinalize();
  11658. return hash;
  11659. },
  11660. blockSize: 512/32,
  11661. /**
  11662. * Creates a shortcut function to a hasher's object interface.
  11663. *
  11664. * @param {Hasher} hasher The hasher to create a helper for.
  11665. *
  11666. * @return {Function} The shortcut function.
  11667. *
  11668. * @static
  11669. *
  11670. * @example
  11671. *
  11672. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  11673. */
  11674. _createHelper: function (hasher) {
  11675. return function (message, cfg) {
  11676. return new hasher.init(cfg).finalize(message);
  11677. };
  11678. },
  11679. /**
  11680. * Creates a shortcut function to the HMAC's object interface.
  11681. *
  11682. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  11683. *
  11684. * @return {Function} The shortcut function.
  11685. *
  11686. * @static
  11687. *
  11688. * @example
  11689. *
  11690. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  11691. */
  11692. _createHmacHelper: function (hasher) {
  11693. return function (message, key) {
  11694. return new C_algo.HMAC.init(hasher, key).finalize(message);
  11695. };
  11696. }
  11697. });
  11698. /**
  11699. * Algorithm namespace.
  11700. */
  11701. var C_algo = C.algo = {};
  11702. return C;
  11703. }(Math));
  11704. return CryptoJS;
  11705. }));
  11706. });
  11707. var sha256 = createCommonjsModule(function (module, exports) {
  11708. ;(function (root, factory) {
  11709. if ('object' === "object") {
  11710. // CommonJS
  11711. module.exports = exports = factory(core);
  11712. }
  11713. else if (typeof undefined === "function" && undefined.amd) {
  11714. // AMD
  11715. undefined(["./core"], factory);
  11716. }
  11717. else {
  11718. // Global (browser)
  11719. factory(root.CryptoJS);
  11720. }
  11721. }(commonjsGlobal, function (CryptoJS) {
  11722. (function (Math) {
  11723. // Shortcuts
  11724. var C = CryptoJS;
  11725. var C_lib = C.lib;
  11726. var WordArray = C_lib.WordArray;
  11727. var Hasher = C_lib.Hasher;
  11728. var C_algo = C.algo;
  11729. // Initialization and round constants tables
  11730. var H = [];
  11731. var K = [];
  11732. // Compute constants
  11733. (function () {
  11734. function isPrime(n) {
  11735. var sqrtN = Math.sqrt(n);
  11736. for (var factor = 2; factor <= sqrtN; factor++) {
  11737. if (!(n % factor)) {
  11738. return false;
  11739. }
  11740. }
  11741. return true;
  11742. }
  11743. function getFractionalBits(n) {
  11744. return ((n - (n | 0)) * 0x100000000) | 0;
  11745. }
  11746. var n = 2;
  11747. var nPrime = 0;
  11748. while (nPrime < 64) {
  11749. if (isPrime(n)) {
  11750. if (nPrime < 8) {
  11751. H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
  11752. }
  11753. K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
  11754. nPrime++;
  11755. }
  11756. n++;
  11757. }
  11758. }());
  11759. // Reusable object
  11760. var W = [];
  11761. /**
  11762. * SHA-256 hash algorithm.
  11763. */
  11764. var SHA256 = C_algo.SHA256 = Hasher.extend({
  11765. _doReset: function () {
  11766. this._hash = new WordArray.init(H.slice(0));
  11767. },
  11768. _doProcessBlock: function (M, offset) {
  11769. // Shortcut
  11770. var H = this._hash.words;
  11771. // Working variables
  11772. var a = H[0];
  11773. var b = H[1];
  11774. var c = H[2];
  11775. var d = H[3];
  11776. var e = H[4];
  11777. var f = H[5];
  11778. var g = H[6];
  11779. var h = H[7];
  11780. // Computation
  11781. for (var i = 0; i < 64; i++) {
  11782. if (i < 16) {
  11783. W[i] = M[offset + i] | 0;
  11784. } else {
  11785. var gamma0x = W[i - 15];
  11786. var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
  11787. ((gamma0x << 14) | (gamma0x >>> 18)) ^
  11788. (gamma0x >>> 3);
  11789. var gamma1x = W[i - 2];
  11790. var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
  11791. ((gamma1x << 13) | (gamma1x >>> 19)) ^
  11792. (gamma1x >>> 10);
  11793. W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
  11794. }
  11795. var ch = (e & f) ^ (~e & g);
  11796. var maj = (a & b) ^ (a & c) ^ (b & c);
  11797. var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
  11798. var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
  11799. var t1 = h + sigma1 + ch + K[i] + W[i];
  11800. var t2 = sigma0 + maj;
  11801. h = g;
  11802. g = f;
  11803. f = e;
  11804. e = (d + t1) | 0;
  11805. d = c;
  11806. c = b;
  11807. b = a;
  11808. a = (t1 + t2) | 0;
  11809. }
  11810. // Intermediate hash value
  11811. H[0] = (H[0] + a) | 0;
  11812. H[1] = (H[1] + b) | 0;
  11813. H[2] = (H[2] + c) | 0;
  11814. H[3] = (H[3] + d) | 0;
  11815. H[4] = (H[4] + e) | 0;
  11816. H[5] = (H[5] + f) | 0;
  11817. H[6] = (H[6] + g) | 0;
  11818. H[7] = (H[7] + h) | 0;
  11819. },
  11820. _doFinalize: function () {
  11821. // Shortcuts
  11822. var data = this._data;
  11823. var dataWords = data.words;
  11824. var nBitsTotal = this._nDataBytes * 8;
  11825. var nBitsLeft = data.sigBytes * 8;
  11826. // Add padding
  11827. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  11828. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  11829. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
  11830. data.sigBytes = dataWords.length * 4;
  11831. // Hash final blocks
  11832. this._process();
  11833. // Return final computed hash
  11834. return this._hash;
  11835. },
  11836. clone: function () {
  11837. var clone = Hasher.clone.call(this);
  11838. clone._hash = this._hash.clone();
  11839. return clone;
  11840. }
  11841. });
  11842. /**
  11843. * Shortcut function to the hasher's object interface.
  11844. *
  11845. * @param {WordArray|string} message The message to hash.
  11846. *
  11847. * @return {WordArray} The hash.
  11848. *
  11849. * @static
  11850. *
  11851. * @example
  11852. *
  11853. * var hash = CryptoJS.SHA256('message');
  11854. * var hash = CryptoJS.SHA256(wordArray);
  11855. */
  11856. C.SHA256 = Hasher._createHelper(SHA256);
  11857. /**
  11858. * Shortcut function to the HMAC's object interface.
  11859. *
  11860. * @param {WordArray|string} message The message to hash.
  11861. * @param {WordArray|string} key The secret key.
  11862. *
  11863. * @return {WordArray} The HMAC.
  11864. *
  11865. * @static
  11866. *
  11867. * @example
  11868. *
  11869. * var hmac = CryptoJS.HmacSHA256(message, key);
  11870. */
  11871. C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
  11872. }(Math));
  11873. return CryptoJS.SHA256;
  11874. }));
  11875. });
  11876. var encBase64 = createCommonjsModule(function (module, exports) {
  11877. ;(function (root, factory) {
  11878. if ('object' === "object") {
  11879. // CommonJS
  11880. module.exports = exports = factory(core);
  11881. }
  11882. else if (typeof undefined === "function" && undefined.amd) {
  11883. // AMD
  11884. undefined(["./core"], factory);
  11885. }
  11886. else {
  11887. // Global (browser)
  11888. factory(root.CryptoJS);
  11889. }
  11890. }(commonjsGlobal, function (CryptoJS) {
  11891. (function () {
  11892. // Shortcuts
  11893. var C = CryptoJS;
  11894. var C_lib = C.lib;
  11895. var WordArray = C_lib.WordArray;
  11896. var C_enc = C.enc;
  11897. /**
  11898. * Base64 encoding strategy.
  11899. */
  11900. var Base64 = C_enc.Base64 = {
  11901. /**
  11902. * Converts a word array to a Base64 string.
  11903. *
  11904. * @param {WordArray} wordArray The word array.
  11905. *
  11906. * @return {string} The Base64 string.
  11907. *
  11908. * @static
  11909. *
  11910. * @example
  11911. *
  11912. * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
  11913. */
  11914. stringify: function (wordArray) {
  11915. // Shortcuts
  11916. var words = wordArray.words;
  11917. var sigBytes = wordArray.sigBytes;
  11918. var map = this._map;
  11919. // Clamp excess bits
  11920. wordArray.clamp();
  11921. // Convert
  11922. var base64Chars = [];
  11923. for (var i = 0; i < sigBytes; i += 3) {
  11924. var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  11925. var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
  11926. var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
  11927. var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
  11928. for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
  11929. base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
  11930. }
  11931. }
  11932. // Add padding
  11933. var paddingChar = map.charAt(64);
  11934. if (paddingChar) {
  11935. while (base64Chars.length % 4) {
  11936. base64Chars.push(paddingChar);
  11937. }
  11938. }
  11939. return base64Chars.join('');
  11940. },
  11941. /**
  11942. * Converts a Base64 string to a word array.
  11943. *
  11944. * @param {string} base64Str The Base64 string.
  11945. *
  11946. * @return {WordArray} The word array.
  11947. *
  11948. * @static
  11949. *
  11950. * @example
  11951. *
  11952. * var wordArray = CryptoJS.enc.Base64.parse(base64String);
  11953. */
  11954. parse: function (base64Str) {
  11955. // Shortcuts
  11956. var base64StrLength = base64Str.length;
  11957. var map = this._map;
  11958. var reverseMap = this._reverseMap;
  11959. if (!reverseMap) {
  11960. reverseMap = this._reverseMap = [];
  11961. for (var j = 0; j < map.length; j++) {
  11962. reverseMap[map.charCodeAt(j)] = j;
  11963. }
  11964. }
  11965. // Ignore padding
  11966. var paddingChar = map.charAt(64);
  11967. if (paddingChar) {
  11968. var paddingIndex = base64Str.indexOf(paddingChar);
  11969. if (paddingIndex !== -1) {
  11970. base64StrLength = paddingIndex;
  11971. }
  11972. }
  11973. // Convert
  11974. return parseLoop(base64Str, base64StrLength, reverseMap);
  11975. },
  11976. _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
  11977. };
  11978. function parseLoop(base64Str, base64StrLength, reverseMap) {
  11979. var words = [];
  11980. var nBytes = 0;
  11981. for (var i = 0; i < base64StrLength; i++) {
  11982. if (i % 4) {
  11983. var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
  11984. var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
  11985. words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
  11986. nBytes++;
  11987. }
  11988. }
  11989. return WordArray.create(words, nBytes);
  11990. }
  11991. }());
  11992. return CryptoJS.enc.Base64;
  11993. }));
  11994. });
  11995. var _nodeResolve_empty = {};
  11996. var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
  11997. __proto__: null,
  11998. 'default': _nodeResolve_empty
  11999. });
  12000. var require$$0 = getCjsExportFromNamespace(_nodeResolve_empty$1);
  12001. var secureRandom = createCommonjsModule(function (module) {
  12002. !function(globals){
  12003. 'use strict';
  12004. //*** UMD BEGIN
  12005. if (typeof undefined !== 'undefined' && undefined.amd) { //require.js / AMD
  12006. undefined([], function() {
  12007. return secureRandom
  12008. });
  12009. } else if ('object' !== 'undefined' && module.exports) { //CommonJS
  12010. module.exports = secureRandom;
  12011. } else { //script / browser
  12012. globals.secureRandom = secureRandom;
  12013. }
  12014. //*** UMD END
  12015. //options.type is the only valid option
  12016. function secureRandom(count, options) {
  12017. options = options || {type: 'Array'};
  12018. //we check for process.pid to prevent browserify from tricking us
  12019. if (
  12020. typeof process != 'undefined'
  12021. && typeof process.pid == 'number'
  12022. && process.versions
  12023. && process.versions.node
  12024. ) {
  12025. return nodeRandom(count, options)
  12026. } else {
  12027. var crypto = window.crypto || window.msCrypto;
  12028. if (!crypto) throw new Error("Your browser does not support window.crypto.")
  12029. return browserRandom(count, options)
  12030. }
  12031. }
  12032. function nodeRandom(count, options) {
  12033. var crypto = require$$0;
  12034. var buf = crypto.randomBytes(count);
  12035. switch (options.type) {
  12036. case 'Array':
  12037. return [].slice.call(buf)
  12038. case 'Buffer':
  12039. return buf
  12040. case 'Uint8Array':
  12041. var arr = new Uint8Array(count);
  12042. for (var i = 0; i < count; ++i) { arr[i] = buf.readUInt8(i); }
  12043. return arr
  12044. default:
  12045. throw new Error(options.type + " is unsupported.")
  12046. }
  12047. }
  12048. function browserRandom(count, options) {
  12049. var nativeArr = new Uint8Array(count);
  12050. var crypto = window.crypto || window.msCrypto;
  12051. crypto.getRandomValues(nativeArr);
  12052. switch (options.type) {
  12053. case 'Array':
  12054. return [].slice.call(nativeArr)
  12055. case 'Buffer':
  12056. try { var b = new Buffer(1); } catch(e) { throw new Error('Buffer not supported in this environment. Use Node.js or Browserify for browser support.')}
  12057. return new Buffer(nativeArr)
  12058. case 'Uint8Array':
  12059. return nativeArr
  12060. default:
  12061. throw new Error(options.type + " is unsupported.")
  12062. }
  12063. }
  12064. secureRandom.randomArray = function(byteCount) {
  12065. return secureRandom(byteCount, {type: 'Array'})
  12066. };
  12067. secureRandom.randomUint8Array = function(byteCount) {
  12068. return secureRandom(byteCount, {type: 'Uint8Array'})
  12069. };
  12070. secureRandom.randomBuffer = function(byteCount) {
  12071. return secureRandom(byteCount, {type: 'Buffer'})
  12072. };
  12073. }(commonjsGlobal);
  12074. });
  12075. var lib$1 = createCommonjsModule(function (module, exports) {
  12076. "use strict";
  12077. exports.__esModule = true;
  12078. var mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
  12079. function random(size) {
  12080. var value = "";
  12081. var bytes = secureRandom(size);
  12082. var scale = 256 / mask.length; // 256 = 0 to 0xFF (randomBytes)
  12083. for (var i = 0; i < size; i++) {
  12084. value += mask.charAt(Math.floor(bytes[i] / scale));
  12085. }
  12086. return value;
  12087. }
  12088. exports.random = random;
  12089. function hash(str) {
  12090. return encBase64.stringify(sha256(str));
  12091. }
  12092. function base64url(str) {
  12093. return str
  12094. .replace(/=/g, "")
  12095. .replace(/\+/g, "-")
  12096. .replace(/\//g, "_");
  12097. }
  12098. function createVerifier(length) {
  12099. if (length === void 0) { length = 128; }
  12100. if (length < 43 || length > 128) {
  12101. throw new Error("expected length " + length + " between 43 and 128");
  12102. }
  12103. return random(length);
  12104. }
  12105. exports.createVerifier = createVerifier;
  12106. function createChallenge(verifier) {
  12107. return base64url(hash(verifier));
  12108. }
  12109. exports.createChallenge = createChallenge;
  12110. function create(length) {
  12111. if (length === void 0) { length = 128; }
  12112. var verifier = createVerifier(length);
  12113. var challenge = createChallenge(verifier);
  12114. return {
  12115. codeVerifier: verifier,
  12116. codeChallenge: challenge
  12117. };
  12118. }
  12119. exports.create = create;
  12120. });
  12121. var pkce = unwrapExports(lib$1);
  12122. var lib_1$1 = lib$1.random;
  12123. var lib_2$1 = lib$1.createVerifier;
  12124. var lib_3$1 = lib$1.createChallenge;
  12125. var lib_4 = lib$1.create;
  12126. const env = writable("");
  12127. const token$1 = writable("");
  12128. env.subscribe(val => {
  12129. if (val != "") {
  12130. store2.set("env", val);
  12131. }
  12132. });
  12133. function unique(value, index, self) {
  12134. return self.indexOf(value) === index;
  12135. }
  12136. function add(data, val) {
  12137. const arr = data.split(";");
  12138. arr.push(val);
  12139. return arr
  12140. .filter(unique)
  12141. .filter(String)
  12142. .join(";");
  12143. }
  12144. function remove(data, val) {
  12145. return data
  12146. .split(";")
  12147. .filter(v => v != val)
  12148. .join(";");
  12149. }
  12150. function createAuth() {
  12151. const { subscribe, update } = writable("");
  12152. return {
  12153. subscribe,
  12154. add: val => update(data => add(data, val)),
  12155. remove: val => update(data => remove(data, val))
  12156. };
  12157. }
  12158. const auth = createAuth();
  12159. prism.languages.json = {
  12160. property: {
  12161. pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
  12162. greedy: true
  12163. },
  12164. string: {
  12165. pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
  12166. greedy: true
  12167. },
  12168. comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
  12169. number: /-?\d+\.?\d*(e[+-]?\d+)?/i,
  12170. punctuation: /[{}[\],]/,
  12171. operator: /:/,
  12172. boolean: /\b(?:true|false)\b/,
  12173. null: {
  12174. pattern: /\bnull\b/,
  12175. alias: "keyword"
  12176. }
  12177. };
  12178. const highlight = function(code, lang) {
  12179. const supported = ["xml", "json"];
  12180. if (!supported.includes(lang)) {
  12181. lang = "markup";
  12182. }
  12183. return prism.highlight(code, prism.languages[lang], lang);
  12184. };
  12185. marked.setOptions({
  12186. highlight
  12187. });
  12188. const renderer = new marked.Renderer();
  12189. renderer.pre = renderer.code;
  12190. renderer.code = function(code, infostring, escaped) {
  12191. const out = this.pre(code, infostring, escaped);
  12192. return out.replace("<pre>", `<pre class="language-${infostring}">`);
  12193. };
  12194. const markdown = function(source) {
  12195. return source ? marked(source, { renderer: renderer }) : "";
  12196. };
  12197. const toc = function(source) {
  12198. if (!source) {
  12199. return [];
  12200. }
  12201. const tokens = marked.lexer(source);
  12202. const headings = tokens.filter(elem => elem.type === "heading");
  12203. const depths = headings.map(head => head.depth);
  12204. const minDepth = Math.min(...depths);
  12205. return headings.map(head => ({
  12206. text: head.text,
  12207. level: head.depth - minDepth
  12208. }));
  12209. };
  12210. const colorize = function(str, prefix = "is-") {
  12211. switch (str) {
  12212. case "get":
  12213. return `${prefix}success`;
  12214. case "post":
  12215. return `${prefix}link`;
  12216. case "put":
  12217. return `${prefix}primary`;
  12218. case "patch":
  12219. return `${prefix}info`;
  12220. case "delete":
  12221. return `${prefix}danger`;
  12222. case 200:
  12223. case 201:
  12224. case 202:
  12225. case 204:
  12226. return `${prefix}info`;
  12227. case 401:
  12228. case 403:
  12229. case 404:
  12230. case 422:
  12231. return `${prefix}warning`;
  12232. case 500:
  12233. return `${prefix}danger`;
  12234. }
  12235. };
  12236. const slugify = function(str) {
  12237. return speakingurl$1(str, "-");
  12238. };
  12239. const alias = str => {
  12240. return str && str.match("json") ? "json" : "markup";
  12241. };
  12242. const stringify$2 = obj => {
  12243. if (typeof obj === "string") {
  12244. return obj;
  12245. }
  12246. if (obj) {
  12247. return JSON.stringify(obj, null, " ");
  12248. }
  12249. return "";
  12250. };
  12251. const expandUrl = (uri, obj) => {
  12252. const tpl = uritemplate.parse(uri);
  12253. return tpl.expand(obj);
  12254. };
  12255. const actionFilter = (act, regex) => {
  12256. return (
  12257. act.path.match(regex) || act.method.match(regex) || act.title.match(regex)
  12258. );
  12259. };
  12260. const filteredItem = (title, key, items) => {
  12261. if (items.length === 0) {
  12262. return false;
  12263. }
  12264. return { title: title, [key]: items };
  12265. };
  12266. function escape$2(text) {
  12267. return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  12268. }
  12269. const filterActions = (tagActions, query) => {
  12270. if (query.startsWith("g:")) {
  12271. const slugs = query.substr(2).split("~");
  12272. return tagActions
  12273. .map(tag => {
  12274. const children = tag.children.filter(child => {
  12275. return (
  12276. slugify(child.title) === slugs[1] && slugify(tag.title) === slugs[0]
  12277. );
  12278. });
  12279. return filteredItem(tag.title, "children", children.filter(Boolean));
  12280. })
  12281. .filter(Boolean);
  12282. }
  12283. if (query.startsWith("rg:")) {
  12284. return tagActions
  12285. .map(tag => {
  12286. const children = tag.children.filter(
  12287. () => slugify(tag.title) === query.substr(3)
  12288. );
  12289. return filteredItem(tag.title, "children", children.filter(Boolean));
  12290. })
  12291. .filter(Boolean);
  12292. }
  12293. const regex = new RegExp(escape$2(query), "gi");
  12294. return tagActions
  12295. .map(tag => {
  12296. const children = tag.children.map(child => {
  12297. const actions = child.actions.filter(act => actionFilter(act, regex));
  12298. return filteredItem(child.title, "actions", actions);
  12299. });
  12300. return filteredItem(tag.title, "children", children.filter(Boolean));
  12301. })
  12302. .filter(Boolean);
  12303. };
  12304. const tokenStore = store2.namespace("token");
  12305. const setToken = (env, token) => tokenStore.set(env, token);
  12306. const getToken = env => tokenStore.get(env);
  12307. const removeToken = env => tokenStore.remove(env);
  12308. const refreshTokenStore = store2.namespace("refresh-token");
  12309. const setRefreshToken = (env, token) => refreshTokenStore.set(env, token);
  12310. const getRefreshToken = env => refreshTokenStore.get(env);
  12311. const removeRefreshToken = env => refreshTokenStore.remove(env);
  12312. const isAuth = (environment, name) => {
  12313. return environment.auth && environment.auth.name === name;
  12314. };
  12315. const isPKCE = environment => {
  12316. if (isAuth(environment, "oauth2")) {
  12317. return environment.auth.options.clientSecret === undefined;
  12318. }
  12319. return false;
  12320. };
  12321. const requestToken = async (client, options) => {
  12322. const authRequest = src.client(client, options);
  12323. const authCode = await authRequest();
  12324. if (typeof authCode === "string") {
  12325. const authParsed = querystringify_1.parse(authCode);
  12326. return {
  12327. accessToken: authParsed.access_token,
  12328. refreshToken: authParsed.refresh_token
  12329. };
  12330. }
  12331. return {
  12332. accessToken: authCode.access_token,
  12333. refreshToken: authCode.refresh_token
  12334. };
  12335. };
  12336. const exchangeToken = async (code, options, isPKCE, pkceChallenge) => {
  12337. if (isPKCE) {
  12338. return requestToken(axios$1.create(), {
  12339. url: options.tokenUrl,
  12340. grant_type: "authorization_code",
  12341. state: getState(),
  12342. client_id: options.clientId,
  12343. redirect_uri: options.callbackUrl,
  12344. code: code,
  12345. code_verifier: pkceChallenge.codeVerifier
  12346. });
  12347. }
  12348. return requestToken(axios$1.create(), {
  12349. url: options.tokenUrl,
  12350. grant_type: "authorization_code",
  12351. state: getState(),
  12352. client_id: options.clientId,
  12353. client_secret: options.clientSecret,
  12354. redirect_uri: options.callbackUrl,
  12355. code: code
  12356. });
  12357. };
  12358. const populate = arr => {
  12359. return arr
  12360. .filter(Boolean)
  12361. .filter(obj => obj.used)
  12362. .reduce((prev, cur) => {
  12363. prev[cur.name] = cur.value;
  12364. return prev;
  12365. }, {});
  12366. };
  12367. const allowBody = action => {
  12368. return ["put", "post", "patch"].includes(action.method);
  12369. };
  12370. const refreshInterceptor = (env, options) => {
  12371. const refreshToken = getRefreshToken(env);
  12372. return async failedRequest => {
  12373. const {
  12374. accessToken: newAccessToken,
  12375. refreshToken: newRefreshToken
  12376. } = await requestToken(axios$1, {
  12377. url: options.tokenUrl,
  12378. grant_type: "refresh_token",
  12379. state: getState(),
  12380. client_id: options.clientId,
  12381. client_secret: options.clientSecret,
  12382. refresh_token: refreshToken
  12383. });
  12384. if (newAccessToken) {
  12385. token$1.set(newAccessToken);
  12386. setToken(env, newAccessToken);
  12387. }
  12388. if (newRefreshToken) {
  12389. setRefreshToken(env, newRefreshToken);
  12390. }
  12391. failedRequest.response.config.headers[
  12392. "Authorization"
  12393. ] = `Bearer ${newAccessToken}`;
  12394. };
  12395. };
  12396. const sendRequest = (
  12397. env,
  12398. environment,
  12399. action,
  12400. { headers, parameters, body }
  12401. ) => {
  12402. const client = axios$1.create({
  12403. baseURL: environment.url
  12404. });
  12405. const options = {
  12406. method: action.method,
  12407. headers: populate(headers)
  12408. };
  12409. const expandedUrl = expandUrl(action.pathTemplate, populate(parameters));
  12410. const destUrl = urlParse(expandedUrl, true);
  12411. options.params = destUrl.query;
  12412. options.url = destUrl.pathname;
  12413. if (allowBody(action)) {
  12414. options.data = body;
  12415. }
  12416. if (isAuth(environment, "oauth2")) {
  12417. createAuthRefreshInterceptor(
  12418. client,
  12419. refreshInterceptor(env, environment.auth.options)
  12420. );
  12421. }
  12422. return client.request(options);
  12423. };
  12424. const copyUrl = (url, parameters) => {
  12425. const expandedUrl = expandUrl(url.pathname, populate(parameters));
  12426. clipboardCopy_1(url.origin + expandedUrl);
  12427. };
  12428. const getEnv = () => store2.get("env");
  12429. const pkceStore = store2.namespace("pkce");
  12430. const getPKCE = () => {
  12431. const existing = pkceStore.getAll();
  12432. if (Object.keys(existing).length === 0) {
  12433. const challengePair = pkce.create();
  12434. pkceStore.setAll(challengePair);
  12435. return challengePair;
  12436. }
  12437. return existing;
  12438. };
  12439. const getState = () => {
  12440. const existing = store2.get("state");
  12441. if (existing) return existing;
  12442. const state = pkce.random(16);
  12443. store2.set("state", state);
  12444. return state;
  12445. };
  12446. const clearPKCE = () => pkceStore.clear();
  12447. const clearState = () => store2.remove("state");
  12448. const buildHref = path => {
  12449. const pathname = window.location.pathname;
  12450. if (!path) {
  12451. return pathname;
  12452. }
  12453. return `${pathname}${path}`.replace("//", "/");
  12454. };
  12455. const handleLink = event => {
  12456. const pathname = window.location.pathname;
  12457. let href = event.target.getAttribute("href");
  12458. if (!href) {
  12459. href = event.target.parentElement.getAttribute("href");
  12460. }
  12461. const cleanHref = href.replace(pathname, "");
  12462. navigateTo(cleanHref);
  12463. };
  12464. /* usr/local/lib/node_modules/snowboard/templates/winter/pages/Home.svelte generated by Svelte v3.19.2 */
  12465. function create_fragment$3(ctx) {
  12466. let h1;
  12467. let t0;
  12468. let t1;
  12469. let div;
  12470. let raw_value = markdown(/*description*/ ctx[1]) + "";
  12471. return {
  12472. c() {
  12473. h1 = element("h1");
  12474. t0 = text(/*title*/ ctx[0]);
  12475. t1 = space();
  12476. div = element("div");
  12477. attr(h1, "class", "title");
  12478. attr(div, "class", "content");
  12479. },
  12480. m(target, anchor) {
  12481. insert(target, h1, anchor);
  12482. append(h1, t0);
  12483. insert(target, t1, anchor);
  12484. insert(target, div, anchor);
  12485. div.innerHTML = raw_value;
  12486. },
  12487. p(ctx, [dirty]) {
  12488. if (dirty & /*title*/ 1) set_data(t0, /*title*/ ctx[0]);
  12489. if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;;
  12490. },
  12491. i: noop,
  12492. o: noop,
  12493. d(detaching) {
  12494. if (detaching) detach(h1);
  12495. if (detaching) detach(t1);
  12496. if (detaching) detach(div);
  12497. }
  12498. };
  12499. }
  12500. function instance$3($$self, $$props, $$invalidate) {
  12501. let { title } = $$props;
  12502. let { description } = $$props;
  12503. $$self.$set = $$props => {
  12504. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  12505. if ("description" in $$props) $$invalidate(1, description = $$props.description);
  12506. };
  12507. return [title, description];
  12508. }
  12509. class Home extends SvelteComponent {
  12510. constructor(options) {
  12511. super();
  12512. init(this, options, instance$3, create_fragment$3, safe_not_equal, { title: 0, description: 1 });
  12513. }
  12514. }
  12515. var uint32 = createCommonjsModule(function (module) {
  12516. /**
  12517. C-like unsigned 32 bits integers in Javascript
  12518. Copyright (C) 2013, Pierre Curto
  12519. MIT license
  12520. */
  12521. ;(function (root) {
  12522. // Local cache for typical radices
  12523. var radixPowerCache = {
  12524. 36: UINT32( Math.pow(36, 5) )
  12525. , 16: UINT32( Math.pow(16, 7) )
  12526. , 10: UINT32( Math.pow(10, 9) )
  12527. , 2: UINT32( Math.pow(2, 30) )
  12528. };
  12529. var radixCache = {
  12530. 36: UINT32(36)
  12531. , 16: UINT32(16)
  12532. , 10: UINT32(10)
  12533. , 2: UINT32(2)
  12534. };
  12535. /**
  12536. * Represents an unsigned 32 bits integer
  12537. * @constructor
  12538. * @param {Number|String|Number} low bits | integer as a string | integer as a number
  12539. * @param {Number|Number|Undefined} high bits | radix (optional, default=10)
  12540. * @return
  12541. */
  12542. function UINT32 (l, h) {
  12543. if ( !(this instanceof UINT32) )
  12544. return new UINT32(l, h)
  12545. this._low = 0;
  12546. this._high = 0;
  12547. this.remainder = null;
  12548. if (typeof h == 'undefined')
  12549. return fromNumber.call(this, l)
  12550. if (typeof l == 'string')
  12551. return fromString.call(this, l, h)
  12552. fromBits.call(this, l, h);
  12553. }
  12554. /**
  12555. * Set the current _UINT32_ object with its low and high bits
  12556. * @method fromBits
  12557. * @param {Number} low bits
  12558. * @param {Number} high bits
  12559. * @return ThisExpression
  12560. */
  12561. function fromBits (l, h) {
  12562. this._low = l | 0;
  12563. this._high = h | 0;
  12564. return this
  12565. }
  12566. UINT32.prototype.fromBits = fromBits;
  12567. /**
  12568. * Set the current _UINT32_ object from a number
  12569. * @method fromNumber
  12570. * @param {Number} number
  12571. * @return ThisExpression
  12572. */
  12573. function fromNumber (value) {
  12574. this._low = value & 0xFFFF;
  12575. this._high = value >>> 16;
  12576. return this
  12577. }
  12578. UINT32.prototype.fromNumber = fromNumber;
  12579. /**
  12580. * Set the current _UINT32_ object from a string
  12581. * @method fromString
  12582. * @param {String} integer as a string
  12583. * @param {Number} radix (optional, default=10)
  12584. * @return ThisExpression
  12585. */
  12586. function fromString (s, radix) {
  12587. var value = parseInt(s, radix || 10);
  12588. this._low = value & 0xFFFF;
  12589. this._high = value >>> 16;
  12590. return this
  12591. }
  12592. UINT32.prototype.fromString = fromString;
  12593. /**
  12594. * Convert this _UINT32_ to a number
  12595. * @method toNumber
  12596. * @return {Number} the converted UINT32
  12597. */
  12598. UINT32.prototype.toNumber = function () {
  12599. return (this._high * 65536) + this._low
  12600. };
  12601. /**
  12602. * Convert this _UINT32_ to a string
  12603. * @method toString
  12604. * @param {Number} radix (optional, default=10)
  12605. * @return {String} the converted UINT32
  12606. */
  12607. UINT32.prototype.toString = function (radix) {
  12608. return this.toNumber().toString(radix || 10)
  12609. };
  12610. /**
  12611. * Add two _UINT32_. The current _UINT32_ stores the result
  12612. * @method add
  12613. * @param {Object} other UINT32
  12614. * @return ThisExpression
  12615. */
  12616. UINT32.prototype.add = function (other) {
  12617. var a00 = this._low + other._low;
  12618. var a16 = a00 >>> 16;
  12619. a16 += this._high + other._high;
  12620. this._low = a00 & 0xFFFF;
  12621. this._high = a16 & 0xFFFF;
  12622. return this
  12623. };
  12624. /**
  12625. * Subtract two _UINT32_. The current _UINT32_ stores the result
  12626. * @method subtract
  12627. * @param {Object} other UINT32
  12628. * @return ThisExpression
  12629. */
  12630. UINT32.prototype.subtract = function (other) {
  12631. //TODO inline
  12632. return this.add( other.clone().negate() )
  12633. };
  12634. /**
  12635. * Multiply two _UINT32_. The current _UINT32_ stores the result
  12636. * @method multiply
  12637. * @param {Object} other UINT32
  12638. * @return ThisExpression
  12639. */
  12640. UINT32.prototype.multiply = function (other) {
  12641. /*
  12642. a = a00 + a16
  12643. b = b00 + b16
  12644. a*b = (a00 + a16)(b00 + b16)
  12645. = a00b00 + a00b16 + a16b00 + a16b16
  12646. a16b16 overflows the 32bits
  12647. */
  12648. var a16 = this._high;
  12649. var a00 = this._low;
  12650. var b16 = other._high;
  12651. var b00 = other._low;
  12652. /* Removed to increase speed under normal circumstances (i.e. not multiplying by 0 or 1)
  12653. // this == 0 or other == 1: nothing to do
  12654. if ((a00 == 0 && a16 == 0) || (b00 == 1 && b16 == 0)) return this
  12655. // other == 0 or this == 1: this = other
  12656. if ((b00 == 0 && b16 == 0) || (a00 == 1 && a16 == 0)) {
  12657. this._low = other._low
  12658. this._high = other._high
  12659. return this
  12660. }
  12661. */
  12662. var c16, c00;
  12663. c00 = a00 * b00;
  12664. c16 = c00 >>> 16;
  12665. c16 += a16 * b00;
  12666. c16 &= 0xFFFF; // Not required but improves performance
  12667. c16 += a00 * b16;
  12668. this._low = c00 & 0xFFFF;
  12669. this._high = c16 & 0xFFFF;
  12670. return this
  12671. };
  12672. /**
  12673. * Divide two _UINT32_. The current _UINT32_ stores the result.
  12674. * The remainder is made available as the _remainder_ property on
  12675. * the _UINT32_ object. It can be null, meaning there are no remainder.
  12676. * @method div
  12677. * @param {Object} other UINT32
  12678. * @return ThisExpression
  12679. */
  12680. UINT32.prototype.div = function (other) {
  12681. if ( (other._low == 0) && (other._high == 0) ) throw Error('division by zero')
  12682. // other == 1
  12683. if (other._high == 0 && other._low == 1) {
  12684. this.remainder = new UINT32(0);
  12685. return this
  12686. }
  12687. // other > this: 0
  12688. if ( other.gt(this) ) {
  12689. this.remainder = this.clone();
  12690. this._low = 0;
  12691. this._high = 0;
  12692. return this
  12693. }
  12694. // other == this: 1
  12695. if ( this.eq(other) ) {
  12696. this.remainder = new UINT32(0);
  12697. this._low = 1;
  12698. this._high = 0;
  12699. return this
  12700. }
  12701. // Shift the divisor left until it is higher than the dividend
  12702. var _other = other.clone();
  12703. var i = -1;
  12704. while ( !this.lt(_other) ) {
  12705. // High bit can overflow the default 16bits
  12706. // Its ok since we right shift after this loop
  12707. // The overflown bit must be kept though
  12708. _other.shiftLeft(1, true);
  12709. i++;
  12710. }
  12711. // Set the remainder
  12712. this.remainder = this.clone();
  12713. // Initialize the current result to 0
  12714. this._low = 0;
  12715. this._high = 0;
  12716. for (; i >= 0; i--) {
  12717. _other.shiftRight(1);
  12718. // If shifted divisor is smaller than the dividend
  12719. // then subtract it from the dividend
  12720. if ( !this.remainder.lt(_other) ) {
  12721. this.remainder.subtract(_other);
  12722. // Update the current result
  12723. if (i >= 16) {
  12724. this._high |= 1 << (i - 16);
  12725. } else {
  12726. this._low |= 1 << i;
  12727. }
  12728. }
  12729. }
  12730. return this
  12731. };
  12732. /**
  12733. * Negate the current _UINT32_
  12734. * @method negate
  12735. * @return ThisExpression
  12736. */
  12737. UINT32.prototype.negate = function () {
  12738. var v = ( ~this._low & 0xFFFF ) + 1;
  12739. this._low = v & 0xFFFF;
  12740. this._high = (~this._high + (v >>> 16)) & 0xFFFF;
  12741. return this
  12742. };
  12743. /**
  12744. * Equals
  12745. * @method eq
  12746. * @param {Object} other UINT32
  12747. * @return {Boolean}
  12748. */
  12749. UINT32.prototype.equals = UINT32.prototype.eq = function (other) {
  12750. return (this._low == other._low) && (this._high == other._high)
  12751. };
  12752. /**
  12753. * Greater than (strict)
  12754. * @method gt
  12755. * @param {Object} other UINT32
  12756. * @return {Boolean}
  12757. */
  12758. UINT32.prototype.greaterThan = UINT32.prototype.gt = function (other) {
  12759. if (this._high > other._high) return true
  12760. if (this._high < other._high) return false
  12761. return this._low > other._low
  12762. };
  12763. /**
  12764. * Less than (strict)
  12765. * @method lt
  12766. * @param {Object} other UINT32
  12767. * @return {Boolean}
  12768. */
  12769. UINT32.prototype.lessThan = UINT32.prototype.lt = function (other) {
  12770. if (this._high < other._high) return true
  12771. if (this._high > other._high) return false
  12772. return this._low < other._low
  12773. };
  12774. /**
  12775. * Bitwise OR
  12776. * @method or
  12777. * @param {Object} other UINT32
  12778. * @return ThisExpression
  12779. */
  12780. UINT32.prototype.or = function (other) {
  12781. this._low |= other._low;
  12782. this._high |= other._high;
  12783. return this
  12784. };
  12785. /**
  12786. * Bitwise AND
  12787. * @method and
  12788. * @param {Object} other UINT32
  12789. * @return ThisExpression
  12790. */
  12791. UINT32.prototype.and = function (other) {
  12792. this._low &= other._low;
  12793. this._high &= other._high;
  12794. return this
  12795. };
  12796. /**
  12797. * Bitwise NOT
  12798. * @method not
  12799. * @return ThisExpression
  12800. */
  12801. UINT32.prototype.not = function() {
  12802. this._low = ~this._low & 0xFFFF;
  12803. this._high = ~this._high & 0xFFFF;
  12804. return this
  12805. };
  12806. /**
  12807. * Bitwise XOR
  12808. * @method xor
  12809. * @param {Object} other UINT32
  12810. * @return ThisExpression
  12811. */
  12812. UINT32.prototype.xor = function (other) {
  12813. this._low ^= other._low;
  12814. this._high ^= other._high;
  12815. return this
  12816. };
  12817. /**
  12818. * Bitwise shift right
  12819. * @method shiftRight
  12820. * @param {Number} number of bits to shift
  12821. * @return ThisExpression
  12822. */
  12823. UINT32.prototype.shiftRight = UINT32.prototype.shiftr = function (n) {
  12824. if (n > 16) {
  12825. this._low = this._high >> (n - 16);
  12826. this._high = 0;
  12827. } else if (n == 16) {
  12828. this._low = this._high;
  12829. this._high = 0;
  12830. } else {
  12831. this._low = (this._low >> n) | ( (this._high << (16-n)) & 0xFFFF );
  12832. this._high >>= n;
  12833. }
  12834. return this
  12835. };
  12836. /**
  12837. * Bitwise shift left
  12838. * @method shiftLeft
  12839. * @param {Number} number of bits to shift
  12840. * @param {Boolean} allow overflow
  12841. * @return ThisExpression
  12842. */
  12843. UINT32.prototype.shiftLeft = UINT32.prototype.shiftl = function (n, allowOverflow) {
  12844. if (n > 16) {
  12845. this._high = this._low << (n - 16);
  12846. this._low = 0;
  12847. if (!allowOverflow) {
  12848. this._high &= 0xFFFF;
  12849. }
  12850. } else if (n == 16) {
  12851. this._high = this._low;
  12852. this._low = 0;
  12853. } else {
  12854. this._high = (this._high << n) | (this._low >> (16-n));
  12855. this._low = (this._low << n) & 0xFFFF;
  12856. if (!allowOverflow) {
  12857. // Overflow only allowed on the high bits...
  12858. this._high &= 0xFFFF;
  12859. }
  12860. }
  12861. return this
  12862. };
  12863. /**
  12864. * Bitwise rotate left
  12865. * @method rotl
  12866. * @param {Number} number of bits to rotate
  12867. * @return ThisExpression
  12868. */
  12869. UINT32.prototype.rotateLeft = UINT32.prototype.rotl = function (n) {
  12870. var v = (this._high << 16) | this._low;
  12871. v = (v << n) | (v >>> (32 - n));
  12872. this._low = v & 0xFFFF;
  12873. this._high = v >>> 16;
  12874. return this
  12875. };
  12876. /**
  12877. * Bitwise rotate right
  12878. * @method rotr
  12879. * @param {Number} number of bits to rotate
  12880. * @return ThisExpression
  12881. */
  12882. UINT32.prototype.rotateRight = UINT32.prototype.rotr = function (n) {
  12883. var v = (this._high << 16) | this._low;
  12884. v = (v >>> n) | (v << (32 - n));
  12885. this._low = v & 0xFFFF;
  12886. this._high = v >>> 16;
  12887. return this
  12888. };
  12889. /**
  12890. * Clone the current _UINT32_
  12891. * @method clone
  12892. * @return {Object} cloned UINT32
  12893. */
  12894. UINT32.prototype.clone = function () {
  12895. return new UINT32(this._low, this._high)
  12896. };
  12897. if (typeof undefined != 'undefined' && undefined.amd) {
  12898. // AMD / RequireJS
  12899. undefined([], function () {
  12900. return UINT32
  12901. });
  12902. } else if ('object' != 'undefined' && module.exports) {
  12903. // Node.js
  12904. module.exports = UINT32;
  12905. } else {
  12906. // Browser
  12907. root['UINT32'] = UINT32;
  12908. }
  12909. })(commonjsGlobal);
  12910. });
  12911. var uint64 = createCommonjsModule(function (module) {
  12912. /**
  12913. C-like unsigned 64 bits integers in Javascript
  12914. Copyright (C) 2013, Pierre Curto
  12915. MIT license
  12916. */
  12917. ;(function (root) {
  12918. // Local cache for typical radices
  12919. var radixPowerCache = {
  12920. 16: UINT64( Math.pow(16, 5) )
  12921. , 10: UINT64( Math.pow(10, 5) )
  12922. , 2: UINT64( Math.pow(2, 5) )
  12923. };
  12924. var radixCache = {
  12925. 16: UINT64(16)
  12926. , 10: UINT64(10)
  12927. , 2: UINT64(2)
  12928. };
  12929. /**
  12930. * Represents an unsigned 64 bits integer
  12931. * @constructor
  12932. * @param {Number} first low bits (8)
  12933. * @param {Number} second low bits (8)
  12934. * @param {Number} first high bits (8)
  12935. * @param {Number} second high bits (8)
  12936. * or
  12937. * @param {Number} low bits (32)
  12938. * @param {Number} high bits (32)
  12939. * or
  12940. * @param {String|Number} integer as a string | integer as a number
  12941. * @param {Number|Undefined} radix (optional, default=10)
  12942. * @return
  12943. */
  12944. function UINT64 (a00, a16, a32, a48) {
  12945. if ( !(this instanceof UINT64) )
  12946. return new UINT64(a00, a16, a32, a48)
  12947. this.remainder = null;
  12948. if (typeof a00 == 'string')
  12949. return fromString.call(this, a00, a16)
  12950. if (typeof a16 == 'undefined')
  12951. return fromNumber.call(this, a00)
  12952. fromBits.apply(this, arguments);
  12953. }
  12954. /**
  12955. * Set the current _UINT64_ object with its low and high bits
  12956. * @method fromBits
  12957. * @param {Number} first low bits (8)
  12958. * @param {Number} second low bits (8)
  12959. * @param {Number} first high bits (8)
  12960. * @param {Number} second high bits (8)
  12961. * or
  12962. * @param {Number} low bits (32)
  12963. * @param {Number} high bits (32)
  12964. * @return ThisExpression
  12965. */
  12966. function fromBits (a00, a16, a32, a48) {
  12967. if (typeof a32 == 'undefined') {
  12968. this._a00 = a00 & 0xFFFF;
  12969. this._a16 = a00 >>> 16;
  12970. this._a32 = a16 & 0xFFFF;
  12971. this._a48 = a16 >>> 16;
  12972. return this
  12973. }
  12974. this._a00 = a00 | 0;
  12975. this._a16 = a16 | 0;
  12976. this._a32 = a32 | 0;
  12977. this._a48 = a48 | 0;
  12978. return this
  12979. }
  12980. UINT64.prototype.fromBits = fromBits;
  12981. /**
  12982. * Set the current _UINT64_ object from a number
  12983. * @method fromNumber
  12984. * @param {Number} number
  12985. * @return ThisExpression
  12986. */
  12987. function fromNumber (value) {
  12988. this._a00 = value & 0xFFFF;
  12989. this._a16 = value >>> 16;
  12990. this._a32 = 0;
  12991. this._a48 = 0;
  12992. return this
  12993. }
  12994. UINT64.prototype.fromNumber = fromNumber;
  12995. /**
  12996. * Set the current _UINT64_ object from a string
  12997. * @method fromString
  12998. * @param {String} integer as a string
  12999. * @param {Number} radix (optional, default=10)
  13000. * @return ThisExpression
  13001. */
  13002. function fromString (s, radix) {
  13003. radix = radix || 10;
  13004. this._a00 = 0;
  13005. this._a16 = 0;
  13006. this._a32 = 0;
  13007. this._a48 = 0;
  13008. /*
  13009. In Javascript, bitwise operators only operate on the first 32 bits
  13010. of a number, even though parseInt() encodes numbers with a 53 bits
  13011. mantissa.
  13012. Therefore UINT64(<Number>) can only work on 32 bits.
  13013. The radix maximum value is 36 (as per ECMA specs) (26 letters + 10 digits)
  13014. maximum input value is m = 32bits as 1 = 2^32 - 1
  13015. So the maximum substring length n is:
  13016. 36^(n+1) - 1 = 2^32 - 1
  13017. 36^(n+1) = 2^32
  13018. (n+1)ln(36) = 32ln(2)
  13019. n = 32ln(2)/ln(36) - 1
  13020. n = 5.189644915687692
  13021. n = 5
  13022. */
  13023. var radixUint = radixPowerCache[radix] || new UINT64( Math.pow(radix, 5) );
  13024. for (var i = 0, len = s.length; i < len; i += 5) {
  13025. var size = Math.min(5, len - i);
  13026. var value = parseInt( s.slice(i, i + size), radix );
  13027. this.multiply(
  13028. size < 5
  13029. ? new UINT64( Math.pow(radix, size) )
  13030. : radixUint
  13031. )
  13032. .add( new UINT64(value) );
  13033. }
  13034. return this
  13035. }
  13036. UINT64.prototype.fromString = fromString;
  13037. /**
  13038. * Convert this _UINT64_ to a number (last 32 bits are dropped)
  13039. * @method toNumber
  13040. * @return {Number} the converted UINT64
  13041. */
  13042. UINT64.prototype.toNumber = function () {
  13043. return (this._a16 * 65536) + this._a00
  13044. };
  13045. /**
  13046. * Convert this _UINT64_ to a string
  13047. * @method toString
  13048. * @param {Number} radix (optional, default=10)
  13049. * @return {String} the converted UINT64
  13050. */
  13051. UINT64.prototype.toString = function (radix) {
  13052. radix = radix || 10;
  13053. var radixUint = radixCache[radix] || new UINT64(radix);
  13054. if ( !this.gt(radixUint) ) return this.toNumber().toString(radix)
  13055. var self = this.clone();
  13056. var res = new Array(64);
  13057. for (var i = 63; i >= 0; i--) {
  13058. self.div(radixUint);
  13059. res[i] = self.remainder.toNumber().toString(radix);
  13060. if ( !self.gt(radixUint) ) break
  13061. }
  13062. res[i-1] = self.toNumber().toString(radix);
  13063. return res.join('')
  13064. };
  13065. /**
  13066. * Add two _UINT64_. The current _UINT64_ stores the result
  13067. * @method add
  13068. * @param {Object} other UINT64
  13069. * @return ThisExpression
  13070. */
  13071. UINT64.prototype.add = function (other) {
  13072. var a00 = this._a00 + other._a00;
  13073. var a16 = a00 >>> 16;
  13074. a16 += this._a16 + other._a16;
  13075. var a32 = a16 >>> 16;
  13076. a32 += this._a32 + other._a32;
  13077. var a48 = a32 >>> 16;
  13078. a48 += this._a48 + other._a48;
  13079. this._a00 = a00 & 0xFFFF;
  13080. this._a16 = a16 & 0xFFFF;
  13081. this._a32 = a32 & 0xFFFF;
  13082. this._a48 = a48 & 0xFFFF;
  13083. return this
  13084. };
  13085. /**
  13086. * Subtract two _UINT64_. The current _UINT64_ stores the result
  13087. * @method subtract
  13088. * @param {Object} other UINT64
  13089. * @return ThisExpression
  13090. */
  13091. UINT64.prototype.subtract = function (other) {
  13092. return this.add( other.clone().negate() )
  13093. };
  13094. /**
  13095. * Multiply two _UINT64_. The current _UINT64_ stores the result
  13096. * @method multiply
  13097. * @param {Object} other UINT64
  13098. * @return ThisExpression
  13099. */
  13100. UINT64.prototype.multiply = function (other) {
  13101. /*
  13102. a = a00 + a16 + a32 + a48
  13103. b = b00 + b16 + b32 + b48
  13104. a*b = (a00 + a16 + a32 + a48)(b00 + b16 + b32 + b48)
  13105. = a00b00 + a00b16 + a00b32 + a00b48
  13106. + a16b00 + a16b16 + a16b32 + a16b48
  13107. + a32b00 + a32b16 + a32b32 + a32b48
  13108. + a48b00 + a48b16 + a48b32 + a48b48
  13109. a16b48, a32b32, a48b16, a48b32 and a48b48 overflow the 64 bits
  13110. so it comes down to:
  13111. a*b = a00b00 + a00b16 + a00b32 + a00b48
  13112. + a16b00 + a16b16 + a16b32
  13113. + a32b00 + a32b16
  13114. + a48b00
  13115. = a00b00
  13116. + a00b16 + a16b00
  13117. + a00b32 + a16b16 + a32b00
  13118. + a00b48 + a16b32 + a32b16 + a48b00
  13119. */
  13120. var a00 = this._a00;
  13121. var a16 = this._a16;
  13122. var a32 = this._a32;
  13123. var a48 = this._a48;
  13124. var b00 = other._a00;
  13125. var b16 = other._a16;
  13126. var b32 = other._a32;
  13127. var b48 = other._a48;
  13128. var c00 = a00 * b00;
  13129. var c16 = c00 >>> 16;
  13130. c16 += a00 * b16;
  13131. var c32 = c16 >>> 16;
  13132. c16 &= 0xFFFF;
  13133. c16 += a16 * b00;
  13134. c32 += c16 >>> 16;
  13135. c32 += a00 * b32;
  13136. var c48 = c32 >>> 16;
  13137. c32 &= 0xFFFF;
  13138. c32 += a16 * b16;
  13139. c48 += c32 >>> 16;
  13140. c32 &= 0xFFFF;
  13141. c32 += a32 * b00;
  13142. c48 += c32 >>> 16;
  13143. c48 += a00 * b48;
  13144. c48 &= 0xFFFF;
  13145. c48 += a16 * b32;
  13146. c48 &= 0xFFFF;
  13147. c48 += a32 * b16;
  13148. c48 &= 0xFFFF;
  13149. c48 += a48 * b00;
  13150. this._a00 = c00 & 0xFFFF;
  13151. this._a16 = c16 & 0xFFFF;
  13152. this._a32 = c32 & 0xFFFF;
  13153. this._a48 = c48 & 0xFFFF;
  13154. return this
  13155. };
  13156. /**
  13157. * Divide two _UINT64_. The current _UINT64_ stores the result.
  13158. * The remainder is made available as the _remainder_ property on
  13159. * the _UINT64_ object. It can be null, meaning there are no remainder.
  13160. * @method div
  13161. * @param {Object} other UINT64
  13162. * @return ThisExpression
  13163. */
  13164. UINT64.prototype.div = function (other) {
  13165. if ( (other._a16 == 0) && (other._a32 == 0) && (other._a48 == 0) ) {
  13166. if (other._a00 == 0) throw Error('division by zero')
  13167. // other == 1: this
  13168. if (other._a00 == 1) {
  13169. this.remainder = new UINT64(0);
  13170. return this
  13171. }
  13172. }
  13173. // other > this: 0
  13174. if ( other.gt(this) ) {
  13175. this.remainder = this.clone();
  13176. this._a00 = 0;
  13177. this._a16 = 0;
  13178. this._a32 = 0;
  13179. this._a48 = 0;
  13180. return this
  13181. }
  13182. // other == this: 1
  13183. if ( this.eq(other) ) {
  13184. this.remainder = new UINT64(0);
  13185. this._a00 = 1;
  13186. this._a16 = 0;
  13187. this._a32 = 0;
  13188. this._a48 = 0;
  13189. return this
  13190. }
  13191. // Shift the divisor left until it is higher than the dividend
  13192. var _other = other.clone();
  13193. var i = -1;
  13194. while ( !this.lt(_other) ) {
  13195. // High bit can overflow the default 16bits
  13196. // Its ok since we right shift after this loop
  13197. // The overflown bit must be kept though
  13198. _other.shiftLeft(1, true);
  13199. i++;
  13200. }
  13201. // Set the remainder
  13202. this.remainder = this.clone();
  13203. // Initialize the current result to 0
  13204. this._a00 = 0;
  13205. this._a16 = 0;
  13206. this._a32 = 0;
  13207. this._a48 = 0;
  13208. for (; i >= 0; i--) {
  13209. _other.shiftRight(1);
  13210. // If shifted divisor is smaller than the dividend
  13211. // then subtract it from the dividend
  13212. if ( !this.remainder.lt(_other) ) {
  13213. this.remainder.subtract(_other);
  13214. // Update the current result
  13215. if (i >= 48) {
  13216. this._a48 |= 1 << (i - 48);
  13217. } else if (i >= 32) {
  13218. this._a32 |= 1 << (i - 32);
  13219. } else if (i >= 16) {
  13220. this._a16 |= 1 << (i - 16);
  13221. } else {
  13222. this._a00 |= 1 << i;
  13223. }
  13224. }
  13225. }
  13226. return this
  13227. };
  13228. /**
  13229. * Negate the current _UINT64_
  13230. * @method negate
  13231. * @return ThisExpression
  13232. */
  13233. UINT64.prototype.negate = function () {
  13234. var v = ( ~this._a00 & 0xFFFF ) + 1;
  13235. this._a00 = v & 0xFFFF;
  13236. v = (~this._a16 & 0xFFFF) + (v >>> 16);
  13237. this._a16 = v & 0xFFFF;
  13238. v = (~this._a32 & 0xFFFF) + (v >>> 16);
  13239. this._a32 = v & 0xFFFF;
  13240. this._a48 = (~this._a48 + (v >>> 16)) & 0xFFFF;
  13241. return this
  13242. };
  13243. /**
  13244. * @method eq
  13245. * @param {Object} other UINT64
  13246. * @return {Boolean}
  13247. */
  13248. UINT64.prototype.equals = UINT64.prototype.eq = function (other) {
  13249. return (this._a48 == other._a48) && (this._a00 == other._a00)
  13250. && (this._a32 == other._a32) && (this._a16 == other._a16)
  13251. };
  13252. /**
  13253. * Greater than (strict)
  13254. * @method gt
  13255. * @param {Object} other UINT64
  13256. * @return {Boolean}
  13257. */
  13258. UINT64.prototype.greaterThan = UINT64.prototype.gt = function (other) {
  13259. if (this._a48 > other._a48) return true
  13260. if (this._a48 < other._a48) return false
  13261. if (this._a32 > other._a32) return true
  13262. if (this._a32 < other._a32) return false
  13263. if (this._a16 > other._a16) return true
  13264. if (this._a16 < other._a16) return false
  13265. return this._a00 > other._a00
  13266. };
  13267. /**
  13268. * Less than (strict)
  13269. * @method lt
  13270. * @param {Object} other UINT64
  13271. * @return {Boolean}
  13272. */
  13273. UINT64.prototype.lessThan = UINT64.prototype.lt = function (other) {
  13274. if (this._a48 < other._a48) return true
  13275. if (this._a48 > other._a48) return false
  13276. if (this._a32 < other._a32) return true
  13277. if (this._a32 > other._a32) return false
  13278. if (this._a16 < other._a16) return true
  13279. if (this._a16 > other._a16) return false
  13280. return this._a00 < other._a00
  13281. };
  13282. /**
  13283. * Bitwise OR
  13284. * @method or
  13285. * @param {Object} other UINT64
  13286. * @return ThisExpression
  13287. */
  13288. UINT64.prototype.or = function (other) {
  13289. this._a00 |= other._a00;
  13290. this._a16 |= other._a16;
  13291. this._a32 |= other._a32;
  13292. this._a48 |= other._a48;
  13293. return this
  13294. };
  13295. /**
  13296. * Bitwise AND
  13297. * @method and
  13298. * @param {Object} other UINT64
  13299. * @return ThisExpression
  13300. */
  13301. UINT64.prototype.and = function (other) {
  13302. this._a00 &= other._a00;
  13303. this._a16 &= other._a16;
  13304. this._a32 &= other._a32;
  13305. this._a48 &= other._a48;
  13306. return this
  13307. };
  13308. /**
  13309. * Bitwise XOR
  13310. * @method xor
  13311. * @param {Object} other UINT64
  13312. * @return ThisExpression
  13313. */
  13314. UINT64.prototype.xor = function (other) {
  13315. this._a00 ^= other._a00;
  13316. this._a16 ^= other._a16;
  13317. this._a32 ^= other._a32;
  13318. this._a48 ^= other._a48;
  13319. return this
  13320. };
  13321. /**
  13322. * Bitwise NOT
  13323. * @method not
  13324. * @return ThisExpression
  13325. */
  13326. UINT64.prototype.not = function() {
  13327. this._a00 = ~this._a00 & 0xFFFF;
  13328. this._a16 = ~this._a16 & 0xFFFF;
  13329. this._a32 = ~this._a32 & 0xFFFF;
  13330. this._a48 = ~this._a48 & 0xFFFF;
  13331. return this
  13332. };
  13333. /**
  13334. * Bitwise shift right
  13335. * @method shiftRight
  13336. * @param {Number} number of bits to shift
  13337. * @return ThisExpression
  13338. */
  13339. UINT64.prototype.shiftRight = UINT64.prototype.shiftr = function (n) {
  13340. n %= 64;
  13341. if (n >= 48) {
  13342. this._a00 = this._a48 >> (n - 48);
  13343. this._a16 = 0;
  13344. this._a32 = 0;
  13345. this._a48 = 0;
  13346. } else if (n >= 32) {
  13347. n -= 32;
  13348. this._a00 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF;
  13349. this._a16 = (this._a48 >> n) & 0xFFFF;
  13350. this._a32 = 0;
  13351. this._a48 = 0;
  13352. } else if (n >= 16) {
  13353. n -= 16;
  13354. this._a00 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF;
  13355. this._a16 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF;
  13356. this._a32 = (this._a48 >> n) & 0xFFFF;
  13357. this._a48 = 0;
  13358. } else {
  13359. this._a00 = ( (this._a00 >> n) | (this._a16 << (16-n)) ) & 0xFFFF;
  13360. this._a16 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF;
  13361. this._a32 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF;
  13362. this._a48 = (this._a48 >> n) & 0xFFFF;
  13363. }
  13364. return this
  13365. };
  13366. /**
  13367. * Bitwise shift left
  13368. * @method shiftLeft
  13369. * @param {Number} number of bits to shift
  13370. * @param {Boolean} allow overflow
  13371. * @return ThisExpression
  13372. */
  13373. UINT64.prototype.shiftLeft = UINT64.prototype.shiftl = function (n, allowOverflow) {
  13374. n %= 64;
  13375. if (n >= 48) {
  13376. this._a48 = this._a00 << (n - 48);
  13377. this._a32 = 0;
  13378. this._a16 = 0;
  13379. this._a00 = 0;
  13380. } else if (n >= 32) {
  13381. n -= 32;
  13382. this._a48 = (this._a16 << n) | (this._a00 >> (16-n));
  13383. this._a32 = (this._a00 << n) & 0xFFFF;
  13384. this._a16 = 0;
  13385. this._a00 = 0;
  13386. } else if (n >= 16) {
  13387. n -= 16;
  13388. this._a48 = (this._a32 << n) | (this._a16 >> (16-n));
  13389. this._a32 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF;
  13390. this._a16 = (this._a00 << n) & 0xFFFF;
  13391. this._a00 = 0;
  13392. } else {
  13393. this._a48 = (this._a48 << n) | (this._a32 >> (16-n));
  13394. this._a32 = ( (this._a32 << n) | (this._a16 >> (16-n)) ) & 0xFFFF;
  13395. this._a16 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF;
  13396. this._a00 = (this._a00 << n) & 0xFFFF;
  13397. }
  13398. if (!allowOverflow) {
  13399. this._a48 &= 0xFFFF;
  13400. }
  13401. return this
  13402. };
  13403. /**
  13404. * Bitwise rotate left
  13405. * @method rotl
  13406. * @param {Number} number of bits to rotate
  13407. * @return ThisExpression
  13408. */
  13409. UINT64.prototype.rotateLeft = UINT64.prototype.rotl = function (n) {
  13410. n %= 64;
  13411. if (n == 0) return this
  13412. if (n >= 32) {
  13413. // A.B.C.D
  13414. // B.C.D.A rotl(16)
  13415. // C.D.A.B rotl(32)
  13416. var v = this._a00;
  13417. this._a00 = this._a32;
  13418. this._a32 = v;
  13419. v = this._a48;
  13420. this._a48 = this._a16;
  13421. this._a16 = v;
  13422. if (n == 32) return this
  13423. n -= 32;
  13424. }
  13425. var high = (this._a48 << 16) | this._a32;
  13426. var low = (this._a16 << 16) | this._a00;
  13427. var _high = (high << n) | (low >>> (32 - n));
  13428. var _low = (low << n) | (high >>> (32 - n));
  13429. this._a00 = _low & 0xFFFF;
  13430. this._a16 = _low >>> 16;
  13431. this._a32 = _high & 0xFFFF;
  13432. this._a48 = _high >>> 16;
  13433. return this
  13434. };
  13435. /**
  13436. * Bitwise rotate right
  13437. * @method rotr
  13438. * @param {Number} number of bits to rotate
  13439. * @return ThisExpression
  13440. */
  13441. UINT64.prototype.rotateRight = UINT64.prototype.rotr = function (n) {
  13442. n %= 64;
  13443. if (n == 0) return this
  13444. if (n >= 32) {
  13445. // A.B.C.D
  13446. // D.A.B.C rotr(16)
  13447. // C.D.A.B rotr(32)
  13448. var v = this._a00;
  13449. this._a00 = this._a32;
  13450. this._a32 = v;
  13451. v = this._a48;
  13452. this._a48 = this._a16;
  13453. this._a16 = v;
  13454. if (n == 32) return this
  13455. n -= 32;
  13456. }
  13457. var high = (this._a48 << 16) | this._a32;
  13458. var low = (this._a16 << 16) | this._a00;
  13459. var _high = (high >>> n) | (low << (32 - n));
  13460. var _low = (low >>> n) | (high << (32 - n));
  13461. this._a00 = _low & 0xFFFF;
  13462. this._a16 = _low >>> 16;
  13463. this._a32 = _high & 0xFFFF;
  13464. this._a48 = _high >>> 16;
  13465. return this
  13466. };
  13467. /**
  13468. * Clone the current _UINT64_
  13469. * @method clone
  13470. * @return {Object} cloned UINT64
  13471. */
  13472. UINT64.prototype.clone = function () {
  13473. return new UINT64(this._a00, this._a16, this._a32, this._a48)
  13474. };
  13475. if (typeof undefined != 'undefined' && undefined.amd) {
  13476. // AMD / RequireJS
  13477. undefined([], function () {
  13478. return UINT64
  13479. });
  13480. } else if ('object' != 'undefined' && module.exports) {
  13481. // Node.js
  13482. module.exports = UINT64;
  13483. } else {
  13484. // Browser
  13485. root['UINT64'] = UINT64;
  13486. }
  13487. })(commonjsGlobal);
  13488. });
  13489. var UINT32 = uint32;
  13490. var UINT64 = uint64;
  13491. var cuint = {
  13492. UINT32: UINT32,
  13493. UINT64: UINT64
  13494. };
  13495. /**
  13496. xxHash implementation in pure Javascript
  13497. Copyright (C) 2013, Pierre Curto
  13498. MIT license
  13499. */
  13500. var UINT32$1 = cuint.UINT32;
  13501. /*
  13502. Merged this sequence of method calls as it speeds up
  13503. the calculations by a factor of 2
  13504. */
  13505. // this.v1.add( other.multiply(PRIME32_2) ).rotl(13).multiply(PRIME32_1);
  13506. UINT32$1.prototype.xxh_update = function (low, high) {
  13507. var b00 = PRIME32_2._low;
  13508. var b16 = PRIME32_2._high;
  13509. var c16, c00;
  13510. c00 = low * b00;
  13511. c16 = c00 >>> 16;
  13512. c16 += high * b00;
  13513. c16 &= 0xFFFF; // Not required but improves performance
  13514. c16 += low * b16;
  13515. var a00 = this._low + (c00 & 0xFFFF);
  13516. var a16 = a00 >>> 16;
  13517. a16 += this._high + (c16 & 0xFFFF);
  13518. var v = (a16 << 16) | (a00 & 0xFFFF);
  13519. v = (v << 13) | (v >>> 19);
  13520. a00 = v & 0xFFFF;
  13521. a16 = v >>> 16;
  13522. b00 = PRIME32_1._low;
  13523. b16 = PRIME32_1._high;
  13524. c00 = a00 * b00;
  13525. c16 = c00 >>> 16;
  13526. c16 += a16 * b00;
  13527. c16 &= 0xFFFF; // Not required but improves performance
  13528. c16 += a00 * b16;
  13529. this._low = c00 & 0xFFFF;
  13530. this._high = c16 & 0xFFFF;
  13531. };
  13532. /*
  13533. * Constants
  13534. */
  13535. var PRIME32_1 = UINT32$1( '2654435761' );
  13536. var PRIME32_2 = UINT32$1( '2246822519' );
  13537. var PRIME32_3 = UINT32$1( '3266489917' );
  13538. var PRIME32_4 = UINT32$1( '668265263' );
  13539. var PRIME32_5 = UINT32$1( '374761393' );
  13540. /**
  13541. * Convert string to proper UTF-8 array
  13542. * @param str Input string
  13543. * @returns {Uint8Array} UTF8 array is returned as uint8 array
  13544. */
  13545. function toUTF8Array (str) {
  13546. var utf8 = [];
  13547. for (var i=0, n=str.length; i < n; i++) {
  13548. var charcode = str.charCodeAt(i);
  13549. if (charcode < 0x80) utf8.push(charcode);
  13550. else if (charcode < 0x800) {
  13551. utf8.push(0xc0 | (charcode >> 6),
  13552. 0x80 | (charcode & 0x3f));
  13553. }
  13554. else if (charcode < 0xd800 || charcode >= 0xe000) {
  13555. utf8.push(0xe0 | (charcode >> 12),
  13556. 0x80 | ((charcode>>6) & 0x3f),
  13557. 0x80 | (charcode & 0x3f));
  13558. }
  13559. // surrogate pair
  13560. else {
  13561. i++;
  13562. // UTF-16 encodes 0x10000-0x10FFFF by
  13563. // subtracting 0x10000 and splitting the
  13564. // 20 bits of 0x0-0xFFFFF into two halves
  13565. charcode = 0x10000 + (((charcode & 0x3ff)<<10)
  13566. | (str.charCodeAt(i) & 0x3ff));
  13567. utf8.push(0xf0 | (charcode >>18),
  13568. 0x80 | ((charcode>>12) & 0x3f),
  13569. 0x80 | ((charcode>>6) & 0x3f),
  13570. 0x80 | (charcode & 0x3f));
  13571. }
  13572. }
  13573. return new Uint8Array(utf8)
  13574. }
  13575. /**
  13576. * XXH object used as a constructor or a function
  13577. * @constructor
  13578. * or
  13579. * @param {Object|String} input data
  13580. * @param {Number|UINT32} seed
  13581. * @return ThisExpression
  13582. * or
  13583. * @return {UINT32} xxHash
  13584. */
  13585. function XXH () {
  13586. if (arguments.length == 2)
  13587. return new XXH( arguments[1] ).update( arguments[0] ).digest()
  13588. if (!(this instanceof XXH))
  13589. return new XXH( arguments[0] )
  13590. init$1.call(this, arguments[0]);
  13591. }
  13592. /**
  13593. * Initialize the XXH instance with the given seed
  13594. * @method init
  13595. * @param {Number|Object} seed as a number or an unsigned 32 bits integer
  13596. * @return ThisExpression
  13597. */
  13598. function init$1 (seed) {
  13599. this.seed = seed instanceof UINT32$1 ? seed.clone() : UINT32$1(seed);
  13600. this.v1 = this.seed.clone().add(PRIME32_1).add(PRIME32_2);
  13601. this.v2 = this.seed.clone().add(PRIME32_2);
  13602. this.v3 = this.seed.clone();
  13603. this.v4 = this.seed.clone().subtract(PRIME32_1);
  13604. this.total_len = 0;
  13605. this.memsize = 0;
  13606. this.memory = null;
  13607. return this
  13608. }
  13609. XXH.prototype.init = init$1;
  13610. /**
  13611. * Add data to be computed for the XXH hash
  13612. * @method update
  13613. * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer
  13614. * @return ThisExpression
  13615. */
  13616. XXH.prototype.update = function (input) {
  13617. var isString = typeof input == 'string';
  13618. var isArrayBuffer;
  13619. // Convert all strings to utf-8 first (issue #5)
  13620. if (isString) {
  13621. input = toUTF8Array(input);
  13622. isString = false;
  13623. isArrayBuffer = true;
  13624. }
  13625. if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer)
  13626. {
  13627. isArrayBuffer = true;
  13628. input = new Uint8Array(input);
  13629. }
  13630. var p = 0;
  13631. var len = input.length;
  13632. var bEnd = p + len;
  13633. if (len == 0) return this
  13634. this.total_len += len;
  13635. if (this.memsize == 0)
  13636. {
  13637. if (isString) {
  13638. this.memory = '';
  13639. } else if (isArrayBuffer) {
  13640. this.memory = new Uint8Array(16);
  13641. } else {
  13642. this.memory = new Buffer(16);
  13643. }
  13644. }
  13645. if (this.memsize + len < 16) // fill in tmp buffer
  13646. {
  13647. // XXH_memcpy(this.memory + this.memsize, input, len)
  13648. if (isString) {
  13649. this.memory += input;
  13650. } else if (isArrayBuffer) {
  13651. this.memory.set( input.subarray(0, len), this.memsize );
  13652. } else {
  13653. input.copy( this.memory, this.memsize, 0, len );
  13654. }
  13655. this.memsize += len;
  13656. return this
  13657. }
  13658. if (this.memsize > 0) // some data left from previous update
  13659. {
  13660. // XXH_memcpy(this.memory + this.memsize, input, 16-this.memsize);
  13661. if (isString) {
  13662. this.memory += input.slice(0, 16 - this.memsize);
  13663. } else if (isArrayBuffer) {
  13664. this.memory.set( input.subarray(0, 16 - this.memsize), this.memsize );
  13665. } else {
  13666. input.copy( this.memory, this.memsize, 0, 16 - this.memsize );
  13667. }
  13668. var p32 = 0;
  13669. if (isString) {
  13670. this.v1.xxh_update(
  13671. (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32)
  13672. , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2)
  13673. );
  13674. p32 += 4;
  13675. this.v2.xxh_update(
  13676. (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32)
  13677. , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2)
  13678. );
  13679. p32 += 4;
  13680. this.v3.xxh_update(
  13681. (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32)
  13682. , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2)
  13683. );
  13684. p32 += 4;
  13685. this.v4.xxh_update(
  13686. (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32)
  13687. , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2)
  13688. );
  13689. } else {
  13690. this.v1.xxh_update(
  13691. (this.memory[p32+1] << 8) | this.memory[p32]
  13692. , (this.memory[p32+3] << 8) | this.memory[p32+2]
  13693. );
  13694. p32 += 4;
  13695. this.v2.xxh_update(
  13696. (this.memory[p32+1] << 8) | this.memory[p32]
  13697. , (this.memory[p32+3] << 8) | this.memory[p32+2]
  13698. );
  13699. p32 += 4;
  13700. this.v3.xxh_update(
  13701. (this.memory[p32+1] << 8) | this.memory[p32]
  13702. , (this.memory[p32+3] << 8) | this.memory[p32+2]
  13703. );
  13704. p32 += 4;
  13705. this.v4.xxh_update(
  13706. (this.memory[p32+1] << 8) | this.memory[p32]
  13707. , (this.memory[p32+3] << 8) | this.memory[p32+2]
  13708. );
  13709. }
  13710. p += 16 - this.memsize;
  13711. this.memsize = 0;
  13712. if (isString) this.memory = '';
  13713. }
  13714. if (p <= bEnd - 16)
  13715. {
  13716. var limit = bEnd - 16;
  13717. do
  13718. {
  13719. if (isString) {
  13720. this.v1.xxh_update(
  13721. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  13722. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  13723. );
  13724. p += 4;
  13725. this.v2.xxh_update(
  13726. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  13727. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  13728. );
  13729. p += 4;
  13730. this.v3.xxh_update(
  13731. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  13732. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  13733. );
  13734. p += 4;
  13735. this.v4.xxh_update(
  13736. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  13737. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  13738. );
  13739. } else {
  13740. this.v1.xxh_update(
  13741. (input[p+1] << 8) | input[p]
  13742. , (input[p+3] << 8) | input[p+2]
  13743. );
  13744. p += 4;
  13745. this.v2.xxh_update(
  13746. (input[p+1] << 8) | input[p]
  13747. , (input[p+3] << 8) | input[p+2]
  13748. );
  13749. p += 4;
  13750. this.v3.xxh_update(
  13751. (input[p+1] << 8) | input[p]
  13752. , (input[p+3] << 8) | input[p+2]
  13753. );
  13754. p += 4;
  13755. this.v4.xxh_update(
  13756. (input[p+1] << 8) | input[p]
  13757. , (input[p+3] << 8) | input[p+2]
  13758. );
  13759. }
  13760. p += 4;
  13761. } while (p <= limit)
  13762. }
  13763. if (p < bEnd)
  13764. {
  13765. // XXH_memcpy(this.memory, p, bEnd-p);
  13766. if (isString) {
  13767. this.memory += input.slice(p);
  13768. } else if (isArrayBuffer) {
  13769. this.memory.set( input.subarray(p, bEnd), this.memsize );
  13770. } else {
  13771. input.copy( this.memory, this.memsize, p, bEnd );
  13772. }
  13773. this.memsize = bEnd - p;
  13774. }
  13775. return this
  13776. };
  13777. /**
  13778. * Finalize the XXH computation. The XXH instance is ready for reuse for the given seed
  13779. * @method digest
  13780. * @return {UINT32} xxHash
  13781. */
  13782. XXH.prototype.digest = function () {
  13783. var input = this.memory;
  13784. var isString = typeof input == 'string';
  13785. var p = 0;
  13786. var bEnd = this.memsize;
  13787. var h32, h;
  13788. var u = new UINT32$1;
  13789. if (this.total_len >= 16)
  13790. {
  13791. h32 = this.v1.rotl(1).add( this.v2.rotl(7).add( this.v3.rotl(12).add( this.v4.rotl(18) ) ) );
  13792. }
  13793. else
  13794. {
  13795. h32 = this.seed.clone().add( PRIME32_5 );
  13796. }
  13797. h32.add( u.fromNumber(this.total_len) );
  13798. while (p <= bEnd - 4)
  13799. {
  13800. if (isString) {
  13801. u.fromBits(
  13802. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  13803. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  13804. );
  13805. } else {
  13806. u.fromBits(
  13807. (input[p+1] << 8) | input[p]
  13808. , (input[p+3] << 8) | input[p+2]
  13809. );
  13810. }
  13811. h32
  13812. .add( u.multiply(PRIME32_3) )
  13813. .rotl(17)
  13814. .multiply( PRIME32_4 );
  13815. p += 4;
  13816. }
  13817. while (p < bEnd)
  13818. {
  13819. u.fromBits( isString ? input.charCodeAt(p++) : input[p++], 0 );
  13820. h32
  13821. .add( u.multiply(PRIME32_5) )
  13822. .rotl(11)
  13823. .multiply(PRIME32_1);
  13824. }
  13825. h = h32.clone().shiftRight(15);
  13826. h32.xor(h).multiply(PRIME32_2);
  13827. h = h32.clone().shiftRight(13);
  13828. h32.xor(h).multiply(PRIME32_3);
  13829. h = h32.clone().shiftRight(16);
  13830. h32.xor(h);
  13831. // Reset the state
  13832. this.init( this.seed );
  13833. return h32
  13834. };
  13835. var xxhash = XXH;
  13836. /**
  13837. xxHash64 implementation in pure Javascript
  13838. Copyright (C) 2016, Pierre Curto
  13839. MIT license
  13840. */
  13841. var UINT64$1 = cuint.UINT64;
  13842. /*
  13843. * Constants
  13844. */
  13845. var PRIME64_1 = UINT64$1( '11400714785074694791' );
  13846. var PRIME64_2 = UINT64$1( '14029467366897019727' );
  13847. var PRIME64_3 = UINT64$1( '1609587929392839161' );
  13848. var PRIME64_4 = UINT64$1( '9650029242287828579' );
  13849. var PRIME64_5 = UINT64$1( '2870177450012600261' );
  13850. /**
  13851. * Convert string to proper UTF-8 array
  13852. * @param str Input string
  13853. * @returns {Uint8Array} UTF8 array is returned as uint8 array
  13854. */
  13855. function toUTF8Array$1 (str) {
  13856. var utf8 = [];
  13857. for (var i=0, n=str.length; i < n; i++) {
  13858. var charcode = str.charCodeAt(i);
  13859. if (charcode < 0x80) utf8.push(charcode);
  13860. else if (charcode < 0x800) {
  13861. utf8.push(0xc0 | (charcode >> 6),
  13862. 0x80 | (charcode & 0x3f));
  13863. }
  13864. else if (charcode < 0xd800 || charcode >= 0xe000) {
  13865. utf8.push(0xe0 | (charcode >> 12),
  13866. 0x80 | ((charcode>>6) & 0x3f),
  13867. 0x80 | (charcode & 0x3f));
  13868. }
  13869. // surrogate pair
  13870. else {
  13871. i++;
  13872. // UTF-16 encodes 0x10000-0x10FFFF by
  13873. // subtracting 0x10000 and splitting the
  13874. // 20 bits of 0x0-0xFFFFF into two halves
  13875. charcode = 0x10000 + (((charcode & 0x3ff)<<10)
  13876. | (str.charCodeAt(i) & 0x3ff));
  13877. utf8.push(0xf0 | (charcode >>18),
  13878. 0x80 | ((charcode>>12) & 0x3f),
  13879. 0x80 | ((charcode>>6) & 0x3f),
  13880. 0x80 | (charcode & 0x3f));
  13881. }
  13882. }
  13883. return new Uint8Array(utf8)
  13884. }
  13885. /**
  13886. * XXH64 object used as a constructor or a function
  13887. * @constructor
  13888. * or
  13889. * @param {Object|String} input data
  13890. * @param {Number|UINT64} seed
  13891. * @return ThisExpression
  13892. * or
  13893. * @return {UINT64} xxHash
  13894. */
  13895. function XXH64 () {
  13896. if (arguments.length == 2)
  13897. return new XXH64( arguments[1] ).update( arguments[0] ).digest()
  13898. if (!(this instanceof XXH64))
  13899. return new XXH64( arguments[0] )
  13900. init$2.call(this, arguments[0]);
  13901. }
  13902. /**
  13903. * Initialize the XXH64 instance with the given seed
  13904. * @method init
  13905. * @param {Number|Object} seed as a number or an unsigned 32 bits integer
  13906. * @return ThisExpression
  13907. */
  13908. function init$2 (seed) {
  13909. this.seed = seed instanceof UINT64$1 ? seed.clone() : UINT64$1(seed);
  13910. this.v1 = this.seed.clone().add(PRIME64_1).add(PRIME64_2);
  13911. this.v2 = this.seed.clone().add(PRIME64_2);
  13912. this.v3 = this.seed.clone();
  13913. this.v4 = this.seed.clone().subtract(PRIME64_1);
  13914. this.total_len = 0;
  13915. this.memsize = 0;
  13916. this.memory = null;
  13917. return this
  13918. }
  13919. XXH64.prototype.init = init$2;
  13920. /**
  13921. * Add data to be computed for the XXH64 hash
  13922. * @method update
  13923. * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer
  13924. * @return ThisExpression
  13925. */
  13926. XXH64.prototype.update = function (input) {
  13927. var isString = typeof input == 'string';
  13928. var isArrayBuffer;
  13929. // Convert all strings to utf-8 first (issue #5)
  13930. if (isString) {
  13931. input = toUTF8Array$1(input);
  13932. isString = false;
  13933. isArrayBuffer = true;
  13934. }
  13935. if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer)
  13936. {
  13937. isArrayBuffer = true;
  13938. input = new Uint8Array(input);
  13939. }
  13940. var p = 0;
  13941. var len = input.length;
  13942. var bEnd = p + len;
  13943. if (len == 0) return this
  13944. this.total_len += len;
  13945. if (this.memsize == 0)
  13946. {
  13947. if (isString) {
  13948. this.memory = '';
  13949. } else if (isArrayBuffer) {
  13950. this.memory = new Uint8Array(32);
  13951. } else {
  13952. this.memory = new Buffer(32);
  13953. }
  13954. }
  13955. if (this.memsize + len < 32) // fill in tmp buffer
  13956. {
  13957. // XXH64_memcpy(this.memory + this.memsize, input, len)
  13958. if (isString) {
  13959. this.memory += input;
  13960. } else if (isArrayBuffer) {
  13961. this.memory.set( input.subarray(0, len), this.memsize );
  13962. } else {
  13963. input.copy( this.memory, this.memsize, 0, len );
  13964. }
  13965. this.memsize += len;
  13966. return this
  13967. }
  13968. if (this.memsize > 0) // some data left from previous update
  13969. {
  13970. // XXH64_memcpy(this.memory + this.memsize, input, 16-this.memsize);
  13971. if (isString) {
  13972. this.memory += input.slice(0, 32 - this.memsize);
  13973. } else if (isArrayBuffer) {
  13974. this.memory.set( input.subarray(0, 32 - this.memsize), this.memsize );
  13975. } else {
  13976. input.copy( this.memory, this.memsize, 0, 32 - this.memsize );
  13977. }
  13978. var p64 = 0;
  13979. if (isString) {
  13980. var other;
  13981. other = UINT64$1(
  13982. (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64)
  13983. , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2)
  13984. , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4)
  13985. , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6)
  13986. );
  13987. this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  13988. p64 += 8;
  13989. other = UINT64$1(
  13990. (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64)
  13991. , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2)
  13992. , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4)
  13993. , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6)
  13994. );
  13995. this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  13996. p64 += 8;
  13997. other = UINT64$1(
  13998. (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64)
  13999. , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2)
  14000. , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4)
  14001. , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6)
  14002. );
  14003. this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14004. p64 += 8;
  14005. other = UINT64$1(
  14006. (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64)
  14007. , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2)
  14008. , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4)
  14009. , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6)
  14010. );
  14011. this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14012. } else {
  14013. var other;
  14014. other = UINT64$1(
  14015. (this.memory[p64+1] << 8) | this.memory[p64]
  14016. , (this.memory[p64+3] << 8) | this.memory[p64+2]
  14017. , (this.memory[p64+5] << 8) | this.memory[p64+4]
  14018. , (this.memory[p64+7] << 8) | this.memory[p64+6]
  14019. );
  14020. this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14021. p64 += 8;
  14022. other = UINT64$1(
  14023. (this.memory[p64+1] << 8) | this.memory[p64]
  14024. , (this.memory[p64+3] << 8) | this.memory[p64+2]
  14025. , (this.memory[p64+5] << 8) | this.memory[p64+4]
  14026. , (this.memory[p64+7] << 8) | this.memory[p64+6]
  14027. );
  14028. this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14029. p64 += 8;
  14030. other = UINT64$1(
  14031. (this.memory[p64+1] << 8) | this.memory[p64]
  14032. , (this.memory[p64+3] << 8) | this.memory[p64+2]
  14033. , (this.memory[p64+5] << 8) | this.memory[p64+4]
  14034. , (this.memory[p64+7] << 8) | this.memory[p64+6]
  14035. );
  14036. this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14037. p64 += 8;
  14038. other = UINT64$1(
  14039. (this.memory[p64+1] << 8) | this.memory[p64]
  14040. , (this.memory[p64+3] << 8) | this.memory[p64+2]
  14041. , (this.memory[p64+5] << 8) | this.memory[p64+4]
  14042. , (this.memory[p64+7] << 8) | this.memory[p64+6]
  14043. );
  14044. this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14045. }
  14046. p += 32 - this.memsize;
  14047. this.memsize = 0;
  14048. if (isString) this.memory = '';
  14049. }
  14050. if (p <= bEnd - 32)
  14051. {
  14052. var limit = bEnd - 32;
  14053. do
  14054. {
  14055. if (isString) {
  14056. var other;
  14057. other = UINT64$1(
  14058. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  14059. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  14060. , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4)
  14061. , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6)
  14062. );
  14063. this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14064. p += 8;
  14065. other = UINT64$1(
  14066. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  14067. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  14068. , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4)
  14069. , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6)
  14070. );
  14071. this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14072. p += 8;
  14073. other = UINT64$1(
  14074. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  14075. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  14076. , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4)
  14077. , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6)
  14078. );
  14079. this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14080. p += 8;
  14081. other = UINT64$1(
  14082. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  14083. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  14084. , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4)
  14085. , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6)
  14086. );
  14087. this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14088. } else {
  14089. var other;
  14090. other = UINT64$1(
  14091. (input[p+1] << 8) | input[p]
  14092. , (input[p+3] << 8) | input[p+2]
  14093. , (input[p+5] << 8) | input[p+4]
  14094. , (input[p+7] << 8) | input[p+6]
  14095. );
  14096. this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14097. p += 8;
  14098. other = UINT64$1(
  14099. (input[p+1] << 8) | input[p]
  14100. , (input[p+3] << 8) | input[p+2]
  14101. , (input[p+5] << 8) | input[p+4]
  14102. , (input[p+7] << 8) | input[p+6]
  14103. );
  14104. this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14105. p += 8;
  14106. other = UINT64$1(
  14107. (input[p+1] << 8) | input[p]
  14108. , (input[p+3] << 8) | input[p+2]
  14109. , (input[p+5] << 8) | input[p+4]
  14110. , (input[p+7] << 8) | input[p+6]
  14111. );
  14112. this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14113. p += 8;
  14114. other = UINT64$1(
  14115. (input[p+1] << 8) | input[p]
  14116. , (input[p+3] << 8) | input[p+2]
  14117. , (input[p+5] << 8) | input[p+4]
  14118. , (input[p+7] << 8) | input[p+6]
  14119. );
  14120. this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1);
  14121. }
  14122. p += 8;
  14123. } while (p <= limit)
  14124. }
  14125. if (p < bEnd)
  14126. {
  14127. // XXH64_memcpy(this.memory, p, bEnd-p);
  14128. if (isString) {
  14129. this.memory += input.slice(p);
  14130. } else if (isArrayBuffer) {
  14131. this.memory.set( input.subarray(p, bEnd), this.memsize );
  14132. } else {
  14133. input.copy( this.memory, this.memsize, p, bEnd );
  14134. }
  14135. this.memsize = bEnd - p;
  14136. }
  14137. return this
  14138. };
  14139. /**
  14140. * Finalize the XXH64 computation. The XXH64 instance is ready for reuse for the given seed
  14141. * @method digest
  14142. * @return {UINT64} xxHash
  14143. */
  14144. XXH64.prototype.digest = function () {
  14145. var input = this.memory;
  14146. var isString = typeof input == 'string';
  14147. var p = 0;
  14148. var bEnd = this.memsize;
  14149. var h64, h;
  14150. var u = new UINT64$1;
  14151. if (this.total_len >= 32)
  14152. {
  14153. h64 = this.v1.clone().rotl(1);
  14154. h64.add( this.v2.clone().rotl(7) );
  14155. h64.add( this.v3.clone().rotl(12) );
  14156. h64.add( this.v4.clone().rotl(18) );
  14157. h64.xor( this.v1.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) );
  14158. h64.multiply(PRIME64_1).add(PRIME64_4);
  14159. h64.xor( this.v2.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) );
  14160. h64.multiply(PRIME64_1).add(PRIME64_4);
  14161. h64.xor( this.v3.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) );
  14162. h64.multiply(PRIME64_1).add(PRIME64_4);
  14163. h64.xor( this.v4.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) );
  14164. h64.multiply(PRIME64_1).add(PRIME64_4);
  14165. }
  14166. else
  14167. {
  14168. h64 = this.seed.clone().add( PRIME64_5 );
  14169. }
  14170. h64.add( u.fromNumber(this.total_len) );
  14171. while (p <= bEnd - 8)
  14172. {
  14173. if (isString) {
  14174. u.fromBits(
  14175. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  14176. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  14177. , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4)
  14178. , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6)
  14179. );
  14180. } else {
  14181. u.fromBits(
  14182. (input[p+1] << 8) | input[p]
  14183. , (input[p+3] << 8) | input[p+2]
  14184. , (input[p+5] << 8) | input[p+4]
  14185. , (input[p+7] << 8) | input[p+6]
  14186. );
  14187. }
  14188. u.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1);
  14189. h64
  14190. .xor(u)
  14191. .rotl(27)
  14192. .multiply( PRIME64_1 )
  14193. .add( PRIME64_4 );
  14194. p += 8;
  14195. }
  14196. if (p + 4 <= bEnd) {
  14197. if (isString) {
  14198. u.fromBits(
  14199. (input.charCodeAt(p+1) << 8) | input.charCodeAt(p)
  14200. , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2)
  14201. , 0
  14202. , 0
  14203. );
  14204. } else {
  14205. u.fromBits(
  14206. (input[p+1] << 8) | input[p]
  14207. , (input[p+3] << 8) | input[p+2]
  14208. , 0
  14209. , 0
  14210. );
  14211. }
  14212. h64
  14213. .xor( u.multiply(PRIME64_1) )
  14214. .rotl(23)
  14215. .multiply( PRIME64_2 )
  14216. .add( PRIME64_3 );
  14217. p += 4;
  14218. }
  14219. while (p < bEnd)
  14220. {
  14221. u.fromBits( isString ? input.charCodeAt(p++) : input[p++], 0, 0, 0 );
  14222. h64
  14223. .xor( u.multiply(PRIME64_5) )
  14224. .rotl(11)
  14225. .multiply(PRIME64_1);
  14226. }
  14227. h = h64.clone().shiftRight(33);
  14228. h64.xor(h).multiply(PRIME64_2);
  14229. h = h64.clone().shiftRight(29);
  14230. h64.xor(h).multiply(PRIME64_3);
  14231. h = h64.clone().shiftRight(32);
  14232. h64.xor(h);
  14233. // Reset the state
  14234. this.init( this.seed );
  14235. return h64
  14236. };
  14237. var xxhash64 = XXH64;
  14238. var lib$2 = {
  14239. h32: xxhash
  14240. , h64: xxhash64
  14241. };
  14242. var lib_1$2 = lib$2.h32;
  14243. var lib_2$2 = lib$2.h64;
  14244. 'use strict';
  14245. var fastJsonStableStringify = function (data, opts) {
  14246. if (!opts) opts = {};
  14247. if (typeof opts === 'function') opts = { cmp: opts };
  14248. var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
  14249. var cmp = opts.cmp && (function (f) {
  14250. return function (node) {
  14251. return function (a, b) {
  14252. var aobj = { key: a, value: node[a] };
  14253. var bobj = { key: b, value: node[b] };
  14254. return f(aobj, bobj);
  14255. };
  14256. };
  14257. })(opts.cmp);
  14258. var seen = [];
  14259. return (function stringify (node) {
  14260. if (node && node.toJSON && typeof node.toJSON === 'function') {
  14261. node = node.toJSON();
  14262. }
  14263. if (node === undefined) return;
  14264. if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
  14265. if (typeof node !== 'object') return JSON.stringify(node);
  14266. var i, out;
  14267. if (Array.isArray(node)) {
  14268. out = '[';
  14269. for (i = 0; i < node.length; i++) {
  14270. if (i) out += ',';
  14271. out += stringify(node[i]) || 'null';
  14272. }
  14273. return out + ']';
  14274. }
  14275. if (node === null) return 'null';
  14276. if (seen.indexOf(node) !== -1) {
  14277. if (cycles) return JSON.stringify('__cycle__');
  14278. throw new TypeError('Converting circular structure to JSON');
  14279. }
  14280. var seenIndex = seen.push(node) - 1;
  14281. var keys = Object.keys(node).sort(cmp && cmp(node));
  14282. out = '';
  14283. for (i = 0; i < keys.length; i++) {
  14284. var key = keys[i];
  14285. var value = stringify(node[key]);
  14286. if (!value) continue;
  14287. if (out) out += ',';
  14288. out += JSON.stringify(key) + ':' + value;
  14289. }
  14290. seen.splice(seenIndex, 1);
  14291. return '{' + out + '}';
  14292. })(data);
  14293. };
  14294. /* usr/local/lib/node_modules/snowboard/templates/winter/tables/ParameterTable.svelte generated by Svelte v3.19.2 */
  14295. function get_each_context(ctx, list, i) {
  14296. const child_ctx = ctx.slice();
  14297. child_ctx[2] = list[i].name;
  14298. child_ctx[3] = list[i].example;
  14299. child_ctx[4] = list[i].required;
  14300. child_ctx[5] = list[i].description;
  14301. child_ctx[6] = list[i].schema;
  14302. return child_ctx;
  14303. }
  14304. // (36:10) {:else}
  14305. function create_else_block$2(ctx) {
  14306. let div;
  14307. return {
  14308. c() {
  14309. div = element("div");
  14310. div.textContent = "-";
  14311. attr(div, "class", "content");
  14312. },
  14313. m(target, anchor) {
  14314. insert(target, div, anchor);
  14315. },
  14316. p: noop,
  14317. d(detaching) {
  14318. if (detaching) detach(div);
  14319. }
  14320. };
  14321. }
  14322. // (32:10) {#if description}
  14323. function create_if_block_2$1(ctx) {
  14324. let div;
  14325. let raw_value = markdown(/*description*/ ctx[5]) + "";
  14326. return {
  14327. c() {
  14328. div = element("div");
  14329. attr(div, "class", "content");
  14330. },
  14331. m(target, anchor) {
  14332. insert(target, div, anchor);
  14333. div.innerHTML = raw_value;
  14334. },
  14335. p(ctx, dirty) {
  14336. if (dirty & /*parameters*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[5]) + "")) div.innerHTML = raw_value;;
  14337. },
  14338. d(detaching) {
  14339. if (detaching) detach(div);
  14340. }
  14341. };
  14342. }
  14343. // (40:10) {#if example}
  14344. function create_if_block_1$2(ctx) {
  14345. let div;
  14346. let span;
  14347. let t1;
  14348. let code;
  14349. let t2_value = /*example*/ ctx[3] + "";
  14350. let t2;
  14351. return {
  14352. c() {
  14353. div = element("div");
  14354. span = element("span");
  14355. span.textContent = "Example:";
  14356. t1 = space();
  14357. code = element("code");
  14358. t2 = text(t2_value);
  14359. attr(code, "class", "tag");
  14360. },
  14361. m(target, anchor) {
  14362. insert(target, div, anchor);
  14363. append(div, span);
  14364. append(div, t1);
  14365. append(div, code);
  14366. append(code, t2);
  14367. },
  14368. p(ctx, dirty) {
  14369. if (dirty & /*parameters*/ 2 && t2_value !== (t2_value = /*example*/ ctx[3] + "")) set_data(t2, t2_value);
  14370. },
  14371. d(detaching) {
  14372. if (detaching) detach(div);
  14373. }
  14374. };
  14375. }
  14376. // (47:10) {#if schema.enum}
  14377. function create_if_block$3(ctx) {
  14378. let div;
  14379. let span;
  14380. let t1;
  14381. let code;
  14382. let t2_value = /*schema*/ ctx[6].enum + "";
  14383. let t2;
  14384. return {
  14385. c() {
  14386. div = element("div");
  14387. span = element("span");
  14388. span.textContent = "Values:";
  14389. t1 = space();
  14390. code = element("code");
  14391. t2 = text(t2_value);
  14392. },
  14393. m(target, anchor) {
  14394. insert(target, div, anchor);
  14395. append(div, span);
  14396. append(div, t1);
  14397. append(div, code);
  14398. append(code, t2);
  14399. },
  14400. p(ctx, dirty) {
  14401. if (dirty & /*parameters*/ 2 && t2_value !== (t2_value = /*schema*/ ctx[6].enum + "")) set_data(t2, t2_value);
  14402. },
  14403. d(detaching) {
  14404. if (detaching) detach(div);
  14405. }
  14406. };
  14407. }
  14408. // (15:4) {#each parameters as { name, example, required, description, schema }}
  14409. function create_each_block(ctx) {
  14410. let tr;
  14411. let td0;
  14412. let code;
  14413. let t0_value = /*name*/ ctx[2] + "";
  14414. let t0;
  14415. let t1;
  14416. let td1;
  14417. let div;
  14418. let span0;
  14419. let t2_value = /*schema*/ ctx[6].type + "";
  14420. let t2;
  14421. let t3;
  14422. let span1;
  14423. let t4_value = (/*required*/ ctx[4] ? "required" : "optional") + "";
  14424. let t4;
  14425. let t5;
  14426. let td2;
  14427. let t6;
  14428. let t7;
  14429. let t8;
  14430. function select_block_type(ctx, dirty) {
  14431. if (/*description*/ ctx[5]) return create_if_block_2$1;
  14432. return create_else_block$2;
  14433. }
  14434. let current_block_type = select_block_type(ctx, -1);
  14435. let if_block0 = current_block_type(ctx);
  14436. let if_block1 = /*example*/ ctx[3] && create_if_block_1$2(ctx);
  14437. let if_block2 = /*schema*/ ctx[6].enum && create_if_block$3(ctx);
  14438. return {
  14439. c() {
  14440. tr = element("tr");
  14441. td0 = element("td");
  14442. code = element("code");
  14443. t0 = text(t0_value);
  14444. t1 = space();
  14445. td1 = element("td");
  14446. div = element("div");
  14447. span0 = element("span");
  14448. t2 = text(t2_value);
  14449. t3 = space();
  14450. span1 = element("span");
  14451. t4 = text(t4_value);
  14452. t5 = space();
  14453. td2 = element("td");
  14454. if_block0.c();
  14455. t6 = space();
  14456. if (if_block1) if_block1.c();
  14457. t7 = space();
  14458. if (if_block2) if_block2.c();
  14459. t8 = space();
  14460. attr(span0, "class", "tag");
  14461. attr(span1, "class", "tag");
  14462. toggle_class(span1, "is-dark", /*required*/ ctx[4]);
  14463. toggle_class(span1, "is-white", !/*required*/ ctx[4]);
  14464. attr(div, "class", "tags has-addons");
  14465. },
  14466. m(target, anchor) {
  14467. insert(target, tr, anchor);
  14468. append(tr, td0);
  14469. append(td0, code);
  14470. append(code, t0);
  14471. append(tr, t1);
  14472. append(tr, td1);
  14473. append(td1, div);
  14474. append(div, span0);
  14475. append(span0, t2);
  14476. append(div, t3);
  14477. append(div, span1);
  14478. append(span1, t4);
  14479. append(tr, t5);
  14480. append(tr, td2);
  14481. if_block0.m(td2, null);
  14482. append(td2, t6);
  14483. if (if_block1) if_block1.m(td2, null);
  14484. append(td2, t7);
  14485. if (if_block2) if_block2.m(td2, null);
  14486. append(tr, t8);
  14487. },
  14488. p(ctx, dirty) {
  14489. if (dirty & /*parameters*/ 2 && t0_value !== (t0_value = /*name*/ ctx[2] + "")) set_data(t0, t0_value);
  14490. if (dirty & /*parameters*/ 2 && t2_value !== (t2_value = /*schema*/ ctx[6].type + "")) set_data(t2, t2_value);
  14491. if (dirty & /*parameters*/ 2 && t4_value !== (t4_value = (/*required*/ ctx[4] ? "required" : "optional") + "")) set_data(t4, t4_value);
  14492. if (dirty & /*parameters*/ 2) {
  14493. toggle_class(span1, "is-dark", /*required*/ ctx[4]);
  14494. }
  14495. if (dirty & /*parameters*/ 2) {
  14496. toggle_class(span1, "is-white", !/*required*/ ctx[4]);
  14497. }
  14498. if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) {
  14499. if_block0.p(ctx, dirty);
  14500. } else {
  14501. if_block0.d(1);
  14502. if_block0 = current_block_type(ctx);
  14503. if (if_block0) {
  14504. if_block0.c();
  14505. if_block0.m(td2, t6);
  14506. }
  14507. }
  14508. if (/*example*/ ctx[3]) {
  14509. if (if_block1) {
  14510. if_block1.p(ctx, dirty);
  14511. } else {
  14512. if_block1 = create_if_block_1$2(ctx);
  14513. if_block1.c();
  14514. if_block1.m(td2, t7);
  14515. }
  14516. } else if (if_block1) {
  14517. if_block1.d(1);
  14518. if_block1 = null;
  14519. }
  14520. if (/*schema*/ ctx[6].enum) {
  14521. if (if_block2) {
  14522. if_block2.p(ctx, dirty);
  14523. } else {
  14524. if_block2 = create_if_block$3(ctx);
  14525. if_block2.c();
  14526. if_block2.m(td2, null);
  14527. }
  14528. } else if (if_block2) {
  14529. if_block2.d(1);
  14530. if_block2 = null;
  14531. }
  14532. },
  14533. d(detaching) {
  14534. if (detaching) detach(tr);
  14535. if_block0.d();
  14536. if (if_block1) if_block1.d();
  14537. if (if_block2) if_block2.d();
  14538. }
  14539. };
  14540. }
  14541. function create_fragment$4(ctx) {
  14542. let table;
  14543. let thead;
  14544. let tr;
  14545. let th;
  14546. let t0;
  14547. let t1;
  14548. let tbody;
  14549. let each_value = /*parameters*/ ctx[1];
  14550. let each_blocks = [];
  14551. for (let i = 0; i < each_value.length; i += 1) {
  14552. each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
  14553. }
  14554. return {
  14555. c() {
  14556. table = element("table");
  14557. thead = element("thead");
  14558. tr = element("tr");
  14559. th = element("th");
  14560. t0 = text(/*title*/ ctx[0]);
  14561. t1 = space();
  14562. tbody = element("tbody");
  14563. for (let i = 0; i < each_blocks.length; i += 1) {
  14564. each_blocks[i].c();
  14565. }
  14566. attr(th, "colspan", "3");
  14567. attr(table, "class", "table table-bordered is-bordered is-fullwidth");
  14568. },
  14569. m(target, anchor) {
  14570. insert(target, table, anchor);
  14571. append(table, thead);
  14572. append(thead, tr);
  14573. append(tr, th);
  14574. append(th, t0);
  14575. append(table, t1);
  14576. append(table, tbody);
  14577. for (let i = 0; i < each_blocks.length; i += 1) {
  14578. each_blocks[i].m(tbody, null);
  14579. }
  14580. },
  14581. p(ctx, [dirty]) {
  14582. if (dirty & /*title*/ 1) set_data(t0, /*title*/ ctx[0]);
  14583. if (dirty & /*parameters, markdown*/ 2) {
  14584. each_value = /*parameters*/ ctx[1];
  14585. let i;
  14586. for (i = 0; i < each_value.length; i += 1) {
  14587. const child_ctx = get_each_context(ctx, each_value, i);
  14588. if (each_blocks[i]) {
  14589. each_blocks[i].p(child_ctx, dirty);
  14590. } else {
  14591. each_blocks[i] = create_each_block(child_ctx);
  14592. each_blocks[i].c();
  14593. each_blocks[i].m(tbody, null);
  14594. }
  14595. }
  14596. for (; i < each_blocks.length; i += 1) {
  14597. each_blocks[i].d(1);
  14598. }
  14599. each_blocks.length = each_value.length;
  14600. }
  14601. },
  14602. i: noop,
  14603. o: noop,
  14604. d(detaching) {
  14605. if (detaching) detach(table);
  14606. destroy_each(each_blocks, detaching);
  14607. }
  14608. };
  14609. }
  14610. function instance$4($$self, $$props, $$invalidate) {
  14611. let { title } = $$props;
  14612. let { parameters } = $$props;
  14613. $$self.$set = $$props => {
  14614. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  14615. if ("parameters" in $$props) $$invalidate(1, parameters = $$props.parameters);
  14616. };
  14617. return [title, parameters];
  14618. }
  14619. class ParameterTable extends SvelteComponent {
  14620. constructor(options) {
  14621. super();
  14622. init(this, options, instance$4, create_fragment$4, safe_not_equal, { title: 0, parameters: 1 });
  14623. }
  14624. }
  14625. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ParameterPanel.svelte generated by Svelte v3.19.2 */
  14626. function create_if_block_1$3(ctx) {
  14627. let current;
  14628. const parametertable = new ParameterTable({
  14629. props: {
  14630. parameters: /*pathParameters*/ ctx[0],
  14631. title: "Path Parameters"
  14632. }
  14633. });
  14634. return {
  14635. c() {
  14636. create_component(parametertable.$$.fragment);
  14637. },
  14638. m(target, anchor) {
  14639. mount_component(parametertable, target, anchor);
  14640. current = true;
  14641. },
  14642. p(ctx, dirty) {
  14643. const parametertable_changes = {};
  14644. if (dirty & /*pathParameters*/ 1) parametertable_changes.parameters = /*pathParameters*/ ctx[0];
  14645. parametertable.$set(parametertable_changes);
  14646. },
  14647. i(local) {
  14648. if (current) return;
  14649. transition_in(parametertable.$$.fragment, local);
  14650. current = true;
  14651. },
  14652. o(local) {
  14653. transition_out(parametertable.$$.fragment, local);
  14654. current = false;
  14655. },
  14656. d(detaching) {
  14657. destroy_component(parametertable, detaching);
  14658. }
  14659. };
  14660. }
  14661. // (14:0) {#if queryParameters.length > 0}
  14662. function create_if_block$4(ctx) {
  14663. let current;
  14664. const parametertable = new ParameterTable({
  14665. props: {
  14666. parameters: /*queryParameters*/ ctx[1],
  14667. title: "Query Parameters"
  14668. }
  14669. });
  14670. return {
  14671. c() {
  14672. create_component(parametertable.$$.fragment);
  14673. },
  14674. m(target, anchor) {
  14675. mount_component(parametertable, target, anchor);
  14676. current = true;
  14677. },
  14678. p(ctx, dirty) {
  14679. const parametertable_changes = {};
  14680. if (dirty & /*queryParameters*/ 2) parametertable_changes.parameters = /*queryParameters*/ ctx[1];
  14681. parametertable.$set(parametertable_changes);
  14682. },
  14683. i(local) {
  14684. if (current) return;
  14685. transition_in(parametertable.$$.fragment, local);
  14686. current = true;
  14687. },
  14688. o(local) {
  14689. transition_out(parametertable.$$.fragment, local);
  14690. current = false;
  14691. },
  14692. d(detaching) {
  14693. destroy_component(parametertable, detaching);
  14694. }
  14695. };
  14696. }
  14697. function create_fragment$5(ctx) {
  14698. let t;
  14699. let if_block1_anchor;
  14700. let current;
  14701. let if_block0 = /*pathParameters*/ ctx[0].length > 0 && create_if_block_1$3(ctx);
  14702. let if_block1 = /*queryParameters*/ ctx[1].length > 0 && create_if_block$4(ctx);
  14703. return {
  14704. c() {
  14705. if (if_block0) if_block0.c();
  14706. t = space();
  14707. if (if_block1) if_block1.c();
  14708. if_block1_anchor = empty();
  14709. },
  14710. m(target, anchor) {
  14711. if (if_block0) if_block0.m(target, anchor);
  14712. insert(target, t, anchor);
  14713. if (if_block1) if_block1.m(target, anchor);
  14714. insert(target, if_block1_anchor, anchor);
  14715. current = true;
  14716. },
  14717. p(ctx, [dirty]) {
  14718. if (/*pathParameters*/ ctx[0].length > 0) {
  14719. if (if_block0) {
  14720. if_block0.p(ctx, dirty);
  14721. transition_in(if_block0, 1);
  14722. } else {
  14723. if_block0 = create_if_block_1$3(ctx);
  14724. if_block0.c();
  14725. transition_in(if_block0, 1);
  14726. if_block0.m(t.parentNode, t);
  14727. }
  14728. } else if (if_block0) {
  14729. group_outros();
  14730. transition_out(if_block0, 1, 1, () => {
  14731. if_block0 = null;
  14732. });
  14733. check_outros();
  14734. }
  14735. if (/*queryParameters*/ ctx[1].length > 0) {
  14736. if (if_block1) {
  14737. if_block1.p(ctx, dirty);
  14738. transition_in(if_block1, 1);
  14739. } else {
  14740. if_block1 = create_if_block$4(ctx);
  14741. if_block1.c();
  14742. transition_in(if_block1, 1);
  14743. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  14744. }
  14745. } else if (if_block1) {
  14746. group_outros();
  14747. transition_out(if_block1, 1, 1, () => {
  14748. if_block1 = null;
  14749. });
  14750. check_outros();
  14751. }
  14752. },
  14753. i(local) {
  14754. if (current) return;
  14755. transition_in(if_block0);
  14756. transition_in(if_block1);
  14757. current = true;
  14758. },
  14759. o(local) {
  14760. transition_out(if_block0);
  14761. transition_out(if_block1);
  14762. current = false;
  14763. },
  14764. d(detaching) {
  14765. if (if_block0) if_block0.d(detaching);
  14766. if (detaching) detach(t);
  14767. if (if_block1) if_block1.d(detaching);
  14768. if (detaching) detach(if_block1_anchor);
  14769. }
  14770. };
  14771. }
  14772. function instance$5($$self, $$props, $$invalidate) {
  14773. let { parameters = [] } = $$props;
  14774. $$self.$set = $$props => {
  14775. if ("parameters" in $$props) $$invalidate(2, parameters = $$props.parameters);
  14776. };
  14777. let pathParameters;
  14778. let queryParameters;
  14779. $$self.$$.update = () => {
  14780. if ($$self.$$.dirty & /*parameters*/ 4) {
  14781. $$invalidate(0, pathParameters = parameters.filter(param => param.location === "path"));
  14782. }
  14783. if ($$self.$$.dirty & /*parameters*/ 4) {
  14784. $$invalidate(1, queryParameters = parameters.filter(param => param.location === "query"));
  14785. }
  14786. };
  14787. return [pathParameters, queryParameters, parameters];
  14788. }
  14789. class ParameterPanel extends SvelteComponent {
  14790. constructor(options) {
  14791. super();
  14792. init(this, options, instance$5, create_fragment$5, safe_not_equal, { parameters: 2 });
  14793. }
  14794. }
  14795. /* usr/local/lib/node_modules/snowboard/templates/winter/components/ToggleIcon.svelte generated by Svelte v3.19.2 */
  14796. function add_css$2() {
  14797. var style = element("style");
  14798. style.id = "svelte-o7a14x-style";
  14799. style.textContent = ".toggle-icon.svelte-o7a14x{cursor:pointer}";
  14800. append(document.head, style);
  14801. }
  14802. function create_fragment$6(ctx) {
  14803. let span;
  14804. let i;
  14805. let span_class_value;
  14806. let dispose;
  14807. return {
  14808. c() {
  14809. span = element("span");
  14810. i = element("i");
  14811. attr(i, "class", "fas");
  14812. toggle_class(i, "fa-chevron-up", !/*show*/ ctx[0]);
  14813. toggle_class(i, "fa-chevron-down", /*show*/ ctx[0]);
  14814. attr(span, "class", span_class_value = "toggle-icon icon " + /*additionalClass*/ ctx[2] + " svelte-o7a14x");
  14815. toggle_class(span, "has-text-grey", !/*dark*/ ctx[1]);
  14816. },
  14817. m(target, anchor) {
  14818. insert(target, span, anchor);
  14819. append(span, i);
  14820. dispose = listen(span, "click", /*toggle*/ ctx[3]);
  14821. },
  14822. p(ctx, [dirty]) {
  14823. if (dirty & /*show*/ 1) {
  14824. toggle_class(i, "fa-chevron-up", !/*show*/ ctx[0]);
  14825. }
  14826. if (dirty & /*show*/ 1) {
  14827. toggle_class(i, "fa-chevron-down", /*show*/ ctx[0]);
  14828. }
  14829. if (dirty & /*additionalClass*/ 4 && span_class_value !== (span_class_value = "toggle-icon icon " + /*additionalClass*/ ctx[2] + " svelte-o7a14x")) {
  14830. attr(span, "class", span_class_value);
  14831. }
  14832. if (dirty & /*additionalClass, dark*/ 6) {
  14833. toggle_class(span, "has-text-grey", !/*dark*/ ctx[1]);
  14834. }
  14835. },
  14836. i: noop,
  14837. o: noop,
  14838. d(detaching) {
  14839. if (detaching) detach(span);
  14840. dispose();
  14841. }
  14842. };
  14843. }
  14844. function instance$6($$self, $$props, $$invalidate) {
  14845. let { dark = false } = $$props;
  14846. let { show = false } = $$props;
  14847. let { additionalClass = "" } = $$props;
  14848. let { handleClick } = $$props;
  14849. function toggle(event) {
  14850. $$invalidate(0, show = !show);
  14851. handleClick(event);
  14852. }
  14853. $$self.$set = $$props => {
  14854. if ("dark" in $$props) $$invalidate(1, dark = $$props.dark);
  14855. if ("show" in $$props) $$invalidate(0, show = $$props.show);
  14856. if ("additionalClass" in $$props) $$invalidate(2, additionalClass = $$props.additionalClass);
  14857. if ("handleClick" in $$props) $$invalidate(4, handleClick = $$props.handleClick);
  14858. };
  14859. return [show, dark, additionalClass, toggle, handleClick];
  14860. }
  14861. class ToggleIcon extends SvelteComponent {
  14862. constructor(options) {
  14863. super();
  14864. if (!document.getElementById("svelte-o7a14x-style")) add_css$2();
  14865. init(this, options, instance$6, create_fragment$6, safe_not_equal, {
  14866. dark: 1,
  14867. show: 0,
  14868. additionalClass: 2,
  14869. handleClick: 4
  14870. });
  14871. }
  14872. }
  14873. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CollapsiblePanel.svelte generated by Svelte v3.19.2 */
  14874. function add_css$3() {
  14875. var style = element("style");
  14876. style.id = "svelte-1hkyt70-style";
  14877. style.textContent = ".panel-section.svelte-1hkyt70{padding:1em;border:1px solid #dbdbdb;border-top:none}.panel-button.svelte-1hkyt70{border-radius:4px}.panel-dark.svelte-1hkyt70{border:1px solid #363636}.panel-section.is-darkmode.svelte-1hkyt70{background-color:#222 !important;border-color:#333}";
  14878. append(document.head, style);
  14879. }
  14880. const get_body_slot_changes = dirty => ({});
  14881. const get_body_slot_context = ctx => ({});
  14882. const get_heading_slot_changes = dirty => ({});
  14883. const get_heading_slot_context = ctx => ({});
  14884. function create_fragment$7(ctx) {
  14885. let div2;
  14886. let div0;
  14887. let t0;
  14888. let t1;
  14889. let div1;
  14890. let current;
  14891. const heading_slot_template = /*$$slots*/ ctx[4].heading;
  14892. const heading_slot = create_slot(heading_slot_template, ctx, /*$$scope*/ ctx[3], get_heading_slot_context);
  14893. const toggleicon = new ToggleIcon({
  14894. props: {
  14895. dark: /*dark*/ ctx[1],
  14896. show: /*show*/ ctx[0],
  14897. additionalClass: "is-pulled-right",
  14898. handleClick: /*func*/ ctx[5]
  14899. }
  14900. });
  14901. const body_slot_template = /*$$slots*/ ctx[4].body;
  14902. const body_slot = create_slot(body_slot_template, ctx, /*$$scope*/ ctx[3], get_body_slot_context);
  14903. return {
  14904. c() {
  14905. div2 = element("div");
  14906. div0 = element("div");
  14907. if (heading_slot) heading_slot.c();
  14908. t0 = space();
  14909. create_component(toggleicon.$$.fragment);
  14910. t1 = space();
  14911. div1 = element("div");
  14912. if (body_slot) body_slot.c();
  14913. attr(div0, "class", "panel-heading svelte-1hkyt70");
  14914. toggle_class(div0, "has-background-dark", /*dark*/ ctx[1]);
  14915. toggle_class(div0, "has-text-white", /*dark*/ ctx[1]);
  14916. toggle_class(div0, "panel-dark", /*dark*/ ctx[1]);
  14917. toggle_class(div0, "panel-button", !/*show*/ ctx[0]);
  14918. attr(div1, "class", "panel-section has-background-white svelte-1hkyt70");
  14919. toggle_class(div1, "is-hidden", !/*show*/ ctx[0]);
  14920. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[2]);
  14921. attr(div2, "class", "panel");
  14922. },
  14923. m(target, anchor) {
  14924. insert(target, div2, anchor);
  14925. append(div2, div0);
  14926. if (heading_slot) {
  14927. heading_slot.m(div0, null);
  14928. }
  14929. append(div0, t0);
  14930. mount_component(toggleicon, div0, null);
  14931. append(div2, t1);
  14932. append(div2, div1);
  14933. if (body_slot) {
  14934. body_slot.m(div1, null);
  14935. }
  14936. current = true;
  14937. },
  14938. p(ctx, [dirty]) {
  14939. if (heading_slot && heading_slot.p && dirty & /*$$scope*/ 8) {
  14940. heading_slot.p(get_slot_context(heading_slot_template, ctx, /*$$scope*/ ctx[3], get_heading_slot_context), get_slot_changes(heading_slot_template, /*$$scope*/ ctx[3], dirty, get_heading_slot_changes));
  14941. }
  14942. const toggleicon_changes = {};
  14943. if (dirty & /*dark*/ 2) toggleicon_changes.dark = /*dark*/ ctx[1];
  14944. if (dirty & /*show*/ 1) toggleicon_changes.show = /*show*/ ctx[0];
  14945. if (dirty & /*show*/ 1) toggleicon_changes.handleClick = /*func*/ ctx[5];
  14946. toggleicon.$set(toggleicon_changes);
  14947. if (dirty & /*dark*/ 2) {
  14948. toggle_class(div0, "has-background-dark", /*dark*/ ctx[1]);
  14949. }
  14950. if (dirty & /*dark*/ 2) {
  14951. toggle_class(div0, "has-text-white", /*dark*/ ctx[1]);
  14952. }
  14953. if (dirty & /*dark*/ 2) {
  14954. toggle_class(div0, "panel-dark", /*dark*/ ctx[1]);
  14955. }
  14956. if (dirty & /*show*/ 1) {
  14957. toggle_class(div0, "panel-button", !/*show*/ ctx[0]);
  14958. }
  14959. if (body_slot && body_slot.p && dirty & /*$$scope*/ 8) {
  14960. body_slot.p(get_slot_context(body_slot_template, ctx, /*$$scope*/ ctx[3], get_body_slot_context), get_slot_changes(body_slot_template, /*$$scope*/ ctx[3], dirty, get_body_slot_changes));
  14961. }
  14962. if (dirty & /*show*/ 1) {
  14963. toggle_class(div1, "is-hidden", !/*show*/ ctx[0]);
  14964. }
  14965. if (dirty & /*isDarkmode*/ 4) {
  14966. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[2]);
  14967. }
  14968. },
  14969. i(local) {
  14970. if (current) return;
  14971. transition_in(heading_slot, local);
  14972. transition_in(toggleicon.$$.fragment, local);
  14973. transition_in(body_slot, local);
  14974. current = true;
  14975. },
  14976. o(local) {
  14977. transition_out(heading_slot, local);
  14978. transition_out(toggleicon.$$.fragment, local);
  14979. transition_out(body_slot, local);
  14980. current = false;
  14981. },
  14982. d(detaching) {
  14983. if (detaching) detach(div2);
  14984. if (heading_slot) heading_slot.d(detaching);
  14985. destroy_component(toggleicon);
  14986. if (body_slot) body_slot.d(detaching);
  14987. }
  14988. };
  14989. }
  14990. function instance$7($$self, $$props, $$invalidate) {
  14991. let { dark = false } = $$props;
  14992. let { show = false } = $$props;
  14993. let { isDarkmode } = $$props;
  14994. let { $$slots = {}, $$scope } = $$props;
  14995. const func = () => $$invalidate(0, show = !show);
  14996. $$self.$set = $$props => {
  14997. if ("dark" in $$props) $$invalidate(1, dark = $$props.dark);
  14998. if ("show" in $$props) $$invalidate(0, show = $$props.show);
  14999. if ("isDarkmode" in $$props) $$invalidate(2, isDarkmode = $$props.isDarkmode);
  15000. if ("$$scope" in $$props) $$invalidate(3, $$scope = $$props.$$scope);
  15001. };
  15002. return [show, dark, isDarkmode, $$scope, $$slots, func];
  15003. }
  15004. class CollapsiblePanel extends SvelteComponent {
  15005. constructor(options) {
  15006. super();
  15007. if (!document.getElementById("svelte-1hkyt70-style")) add_css$3();
  15008. init(this, options, instance$7, create_fragment$7, safe_not_equal, { dark: 1, show: 0, isDarkmode: 2 });
  15009. }
  15010. }
  15011. /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldDisabled.svelte generated by Svelte v3.19.2 */
  15012. function add_css$4() {
  15013. var style = element("style");
  15014. style.id = "svelte-a7ak6u-style";
  15015. style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}";
  15016. append(document.head, style);
  15017. }
  15018. function create_fragment$8(ctx) {
  15019. let div;
  15020. let p0;
  15021. let input0;
  15022. let input0_id_value;
  15023. let t0;
  15024. let label;
  15025. let label_for_value;
  15026. let t1;
  15027. let p1;
  15028. let input1;
  15029. let t2;
  15030. let p2;
  15031. let input2;
  15032. return {
  15033. c() {
  15034. div = element("div");
  15035. p0 = element("p");
  15036. input0 = element("input");
  15037. t0 = space();
  15038. label = element("label");
  15039. t1 = space();
  15040. p1 = element("p");
  15041. input1 = element("input");
  15042. t2 = space();
  15043. p2 = element("p");
  15044. input2 = element("input");
  15045. attr(input0, "class", "switch is-rounded is-success");
  15046. attr(input0, "id", input0_id_value = "h-" + /*name*/ ctx[0]);
  15047. attr(input0, "type", "checkbox");
  15048. input0.checked = true;
  15049. input0.disabled = true;
  15050. attr(label, "for", label_for_value = "h-" + /*name*/ ctx[0]);
  15051. attr(p0, "class", "control control-switch svelte-a7ak6u");
  15052. attr(input1, "class", "input is-rounded has-border svelte-a7ak6u");
  15053. attr(input1, "type", "text");
  15054. attr(input1, "placeholder", /*placeholder*/ ctx[1]);
  15055. input1.disabled = true;
  15056. attr(p1, "class", "control");
  15057. attr(input2, "class", "input is-rounded has-border is-family-code svelte-a7ak6u");
  15058. attr(input2, "type", "text");
  15059. input2.value = /*value*/ ctx[2];
  15060. input2.disabled = true;
  15061. attr(p2, "class", "control is-expanded");
  15062. attr(div, "class", "field has-addons");
  15063. },
  15064. m(target, anchor) {
  15065. insert(target, div, anchor);
  15066. append(div, p0);
  15067. append(p0, input0);
  15068. append(p0, t0);
  15069. append(p0, label);
  15070. append(div, t1);
  15071. append(div, p1);
  15072. append(p1, input1);
  15073. append(div, t2);
  15074. append(div, p2);
  15075. append(p2, input2);
  15076. },
  15077. p(ctx, [dirty]) {
  15078. if (dirty & /*name*/ 1 && input0_id_value !== (input0_id_value = "h-" + /*name*/ ctx[0])) {
  15079. attr(input0, "id", input0_id_value);
  15080. }
  15081. if (dirty & /*name*/ 1 && label_for_value !== (label_for_value = "h-" + /*name*/ ctx[0])) {
  15082. attr(label, "for", label_for_value);
  15083. }
  15084. if (dirty & /*placeholder*/ 2) {
  15085. attr(input1, "placeholder", /*placeholder*/ ctx[1]);
  15086. }
  15087. if (dirty & /*value*/ 4 && input2.value !== /*value*/ ctx[2]) {
  15088. input2.value = /*value*/ ctx[2];
  15089. }
  15090. },
  15091. i: noop,
  15092. o: noop,
  15093. d(detaching) {
  15094. if (detaching) detach(div);
  15095. }
  15096. };
  15097. }
  15098. function instance$8($$self, $$props, $$invalidate) {
  15099. let { name } = $$props;
  15100. let { placeholder } = $$props;
  15101. let { value } = $$props;
  15102. $$self.$set = $$props => {
  15103. if ("name" in $$props) $$invalidate(0, name = $$props.name);
  15104. if ("placeholder" in $$props) $$invalidate(1, placeholder = $$props.placeholder);
  15105. if ("value" in $$props) $$invalidate(2, value = $$props.value);
  15106. };
  15107. return [name, placeholder, value];
  15108. }
  15109. class FieldDisabled extends SvelteComponent {
  15110. constructor(options) {
  15111. super();
  15112. if (!document.getElementById("svelte-a7ak6u-style")) add_css$4();
  15113. init(this, options, instance$8, create_fragment$8, safe_not_equal, { name: 0, placeholder: 1, value: 2 });
  15114. }
  15115. }
  15116. /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldSwitch.svelte generated by Svelte v3.19.2 */
  15117. function add_css$5() {
  15118. var style = element("style");
  15119. style.id = "svelte-a7ak6u-style";
  15120. style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}";
  15121. append(document.head, style);
  15122. }
  15123. function create_fragment$9(ctx) {
  15124. let div;
  15125. let p0;
  15126. let input0;
  15127. let input0_id_value;
  15128. let t0;
  15129. let label;
  15130. let label_for_value;
  15131. let t1;
  15132. let p1;
  15133. let input1;
  15134. let t2;
  15135. let p2;
  15136. let input2;
  15137. let dispose;
  15138. return {
  15139. c() {
  15140. div = element("div");
  15141. p0 = element("p");
  15142. input0 = element("input");
  15143. t0 = space();
  15144. label = element("label");
  15145. t1 = space();
  15146. p1 = element("p");
  15147. input1 = element("input");
  15148. t2 = space();
  15149. p2 = element("p");
  15150. input2 = element("input");
  15151. attr(input0, "class", "switch is-rounded is-success");
  15152. attr(input0, "id", input0_id_value = "p-" + /*name*/ ctx[3]);
  15153. attr(input0, "type", "checkbox");
  15154. input0.disabled = /*required*/ ctx[2];
  15155. attr(label, "for", label_for_value = "p-" + /*name*/ ctx[3]);
  15156. attr(p0, "class", "control control-switch svelte-a7ak6u");
  15157. attr(input1, "class", "input is-rounded has-border svelte-a7ak6u");
  15158. attr(input1, "type", "text");
  15159. attr(input1, "placeholder", /*name*/ ctx[3]);
  15160. input1.disabled = true;
  15161. attr(p1, "class", "control");
  15162. attr(input2, "class", "input has-border is-family-code svelte-a7ak6u");
  15163. attr(input2, "type", "text");
  15164. toggle_class(input2, "is-rounded", /*rounded*/ ctx[4]);
  15165. attr(p2, "class", "control is-expanded");
  15166. attr(div, "class", "field has-addons");
  15167. },
  15168. m(target, anchor) {
  15169. insert(target, div, anchor);
  15170. append(div, p0);
  15171. append(p0, input0);
  15172. input0.checked = /*used*/ ctx[0];
  15173. append(p0, t0);
  15174. append(p0, label);
  15175. append(div, t1);
  15176. append(div, p1);
  15177. append(p1, input1);
  15178. append(div, t2);
  15179. append(div, p2);
  15180. append(p2, input2);
  15181. set_input_value(input2, /*value*/ ctx[1]);
  15182. dispose = [
  15183. listen(input0, "change", /*input0_change_handler*/ ctx[5]),
  15184. listen(input2, "input", /*input2_input_handler*/ ctx[6])
  15185. ];
  15186. },
  15187. p(ctx, [dirty]) {
  15188. if (dirty & /*name*/ 8 && input0_id_value !== (input0_id_value = "p-" + /*name*/ ctx[3])) {
  15189. attr(input0, "id", input0_id_value);
  15190. }
  15191. if (dirty & /*required*/ 4) {
  15192. input0.disabled = /*required*/ ctx[2];
  15193. }
  15194. if (dirty & /*used*/ 1) {
  15195. input0.checked = /*used*/ ctx[0];
  15196. }
  15197. if (dirty & /*name*/ 8 && label_for_value !== (label_for_value = "p-" + /*name*/ ctx[3])) {
  15198. attr(label, "for", label_for_value);
  15199. }
  15200. if (dirty & /*name*/ 8) {
  15201. attr(input1, "placeholder", /*name*/ ctx[3]);
  15202. }
  15203. if (dirty & /*value*/ 2 && input2.value !== /*value*/ ctx[1]) {
  15204. set_input_value(input2, /*value*/ ctx[1]);
  15205. }
  15206. if (dirty & /*rounded*/ 16) {
  15207. toggle_class(input2, "is-rounded", /*rounded*/ ctx[4]);
  15208. }
  15209. },
  15210. i: noop,
  15211. o: noop,
  15212. d(detaching) {
  15213. if (detaching) detach(div);
  15214. run_all(dispose);
  15215. }
  15216. };
  15217. }
  15218. function instance$9($$self, $$props, $$invalidate) {
  15219. let { used } = $$props;
  15220. let { required } = $$props;
  15221. let { name } = $$props;
  15222. let { value } = $$props;
  15223. let { rounded } = $$props;
  15224. function input0_change_handler() {
  15225. used = this.checked;
  15226. $$invalidate(0, used);
  15227. }
  15228. function input2_input_handler() {
  15229. value = this.value;
  15230. $$invalidate(1, value);
  15231. }
  15232. $$self.$set = $$props => {
  15233. if ("used" in $$props) $$invalidate(0, used = $$props.used);
  15234. if ("required" in $$props) $$invalidate(2, required = $$props.required);
  15235. if ("name" in $$props) $$invalidate(3, name = $$props.name);
  15236. if ("value" in $$props) $$invalidate(1, value = $$props.value);
  15237. if ("rounded" in $$props) $$invalidate(4, rounded = $$props.rounded);
  15238. };
  15239. return [
  15240. used,
  15241. value,
  15242. required,
  15243. name,
  15244. rounded,
  15245. input0_change_handler,
  15246. input2_input_handler
  15247. ];
  15248. }
  15249. class FieldSwitch extends SvelteComponent {
  15250. constructor(options) {
  15251. super();
  15252. if (!document.getElementById("svelte-a7ak6u-style")) add_css$5();
  15253. init(this, options, instance$9, create_fragment$9, safe_not_equal, {
  15254. used: 0,
  15255. required: 2,
  15256. name: 3,
  15257. value: 1,
  15258. rounded: 4
  15259. });
  15260. }
  15261. }
  15262. /* usr/local/lib/node_modules/snowboard/templates/winter/components/CodeBlock.svelte generated by Svelte v3.19.2 */
  15263. function create_if_block$5(ctx) {
  15264. let pre;
  15265. let code;
  15266. let raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + "";
  15267. let code_class_value;
  15268. let pre_class_value;
  15269. return {
  15270. c() {
  15271. pre = element("pre");
  15272. code = element("code");
  15273. attr(code, "class", code_class_value = "language-" + /*mime*/ ctx[1]);
  15274. attr(pre, "class", pre_class_value = "language-" + /*mime*/ ctx[1]);
  15275. },
  15276. m(target, anchor) {
  15277. insert(target, pre, anchor);
  15278. append(pre, code);
  15279. code.innerHTML = raw_value;
  15280. },
  15281. p(ctx, dirty) {
  15282. if (dirty & /*body, mime*/ 3 && raw_value !== (raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + "")) code.innerHTML = raw_value;;
  15283. if (dirty & /*mime*/ 2 && code_class_value !== (code_class_value = "language-" + /*mime*/ ctx[1])) {
  15284. attr(code, "class", code_class_value);
  15285. }
  15286. if (dirty & /*mime*/ 2 && pre_class_value !== (pre_class_value = "language-" + /*mime*/ ctx[1])) {
  15287. attr(pre, "class", pre_class_value);
  15288. }
  15289. },
  15290. d(detaching) {
  15291. if (detaching) detach(pre);
  15292. }
  15293. };
  15294. }
  15295. function create_fragment$a(ctx) {
  15296. let if_block_anchor;
  15297. let if_block = /*body*/ ctx[0] && create_if_block$5(ctx);
  15298. return {
  15299. c() {
  15300. if (if_block) if_block.c();
  15301. if_block_anchor = empty();
  15302. },
  15303. m(target, anchor) {
  15304. if (if_block) if_block.m(target, anchor);
  15305. insert(target, if_block_anchor, anchor);
  15306. },
  15307. p(ctx, [dirty]) {
  15308. if (/*body*/ ctx[0]) {
  15309. if (if_block) {
  15310. if_block.p(ctx, dirty);
  15311. } else {
  15312. if_block = create_if_block$5(ctx);
  15313. if_block.c();
  15314. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  15315. }
  15316. } else if (if_block) {
  15317. if_block.d(1);
  15318. if_block = null;
  15319. }
  15320. },
  15321. i: noop,
  15322. o: noop,
  15323. d(detaching) {
  15324. if (if_block) if_block.d(detaching);
  15325. if (detaching) detach(if_block_anchor);
  15326. }
  15327. };
  15328. }
  15329. function instance$a($$self, $$props, $$invalidate) {
  15330. let { type } = $$props;
  15331. let { body } = $$props;
  15332. $$self.$set = $$props => {
  15333. if ("type" in $$props) $$invalidate(2, type = $$props.type);
  15334. if ("body" in $$props) $$invalidate(0, body = $$props.body);
  15335. };
  15336. let mime;
  15337. $$self.$$.update = () => {
  15338. if ($$self.$$.dirty & /*type*/ 4) {
  15339. $$invalidate(1, mime = alias(type));
  15340. }
  15341. };
  15342. return [body, mime, type];
  15343. }
  15344. class CodeBlock extends SvelteComponent {
  15345. constructor(options) {
  15346. super();
  15347. init(this, options, instance$a, create_fragment$a, safe_not_equal, { type: 2, body: 0 });
  15348. }
  15349. }
  15350. /* usr/local/lib/node_modules/snowboard/templates/winter/components/LoginButton.svelte generated by Svelte v3.19.2 */
  15351. function create_fragment$b(ctx) {
  15352. let a;
  15353. let span0;
  15354. let t0;
  15355. let span1;
  15356. return {
  15357. c() {
  15358. a = element("a");
  15359. span0 = element("span");
  15360. span0.innerHTML = `<i class="fas fa-sign-in-alt" aria-hidden="true"></i>`;
  15361. t0 = space();
  15362. span1 = element("span");
  15363. span1.textContent = "Login";
  15364. attr(span0, "class", "icon");
  15365. attr(a, "href", /*authorizeUrl*/ ctx[1]);
  15366. attr(a, "class", "button is-dark is-rounded");
  15367. toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]);
  15368. },
  15369. m(target, anchor) {
  15370. insert(target, a, anchor);
  15371. append(a, span0);
  15372. append(a, t0);
  15373. append(a, span1);
  15374. },
  15375. p(ctx, [dirty]) {
  15376. if (dirty & /*authorizeUrl*/ 2) {
  15377. attr(a, "href", /*authorizeUrl*/ ctx[1]);
  15378. }
  15379. if (dirty & /*fullWidth*/ 1) {
  15380. toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]);
  15381. }
  15382. },
  15383. i: noop,
  15384. o: noop,
  15385. d(detaching) {
  15386. if (detaching) detach(a);
  15387. }
  15388. };
  15389. }
  15390. function instance$b($$self, $$props, $$invalidate) {
  15391. let { authOptions } = $$props;
  15392. let { fullWidth } = $$props;
  15393. let { pkceChallenge } = $$props;
  15394. let { isPKCE } = $$props;
  15395. $$self.$set = $$props => {
  15396. if ("authOptions" in $$props) $$invalidate(2, authOptions = $$props.authOptions);
  15397. if ("fullWidth" in $$props) $$invalidate(0, fullWidth = $$props.fullWidth);
  15398. if ("pkceChallenge" in $$props) $$invalidate(3, pkceChallenge = $$props.pkceChallenge);
  15399. if ("isPKCE" in $$props) $$invalidate(4, isPKCE = $$props.isPKCE);
  15400. };
  15401. let authorizeParams;
  15402. let authorizeUrl;
  15403. $$self.$$.update = () => {
  15404. if ($$self.$$.dirty & /*isPKCE, authOptions, pkceChallenge*/ 28) {
  15405. $$invalidate(5, authorizeParams = isPKCE
  15406. ? querystringify_1.stringify(
  15407. {
  15408. client_id: authOptions.clientId,
  15409. redirect_uri: authOptions.callbackUrl,
  15410. response_type: "code",
  15411. state: getState(),
  15412. scope: authOptions.scopes || "",
  15413. code_challenge: pkceChallenge.codeChallenge,
  15414. code_challenge_method: "S256"
  15415. },
  15416. true
  15417. )
  15418. : querystringify_1.stringify(
  15419. {
  15420. client_id: authOptions.clientId,
  15421. redirect_uri: authOptions.callbackUrl,
  15422. response_type: "code",
  15423. scope: authOptions.scopes || ""
  15424. },
  15425. true
  15426. ));
  15427. }
  15428. if ($$self.$$.dirty & /*authOptions, authorizeParams*/ 36) {
  15429. $$invalidate(1, authorizeUrl = `${authOptions.authorizeUrl}${authorizeParams}`);
  15430. }
  15431. };
  15432. return [fullWidth, authorizeUrl, authOptions, pkceChallenge, isPKCE];
  15433. }
  15434. class LoginButton extends SvelteComponent {
  15435. constructor(options) {
  15436. super();
  15437. init(this, options, instance$b, create_fragment$b, safe_not_equal, {
  15438. authOptions: 2,
  15439. fullWidth: 0,
  15440. pkceChallenge: 3,
  15441. isPKCE: 4
  15442. });
  15443. }
  15444. }
  15445. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/PlaygroundPanel.svelte generated by Svelte v3.19.2 */
  15446. function add_css$6() {
  15447. var style = element("style");
  15448. style.id = "svelte-c3oocm-style";
  15449. style.textContent = ".small-section.svelte-c3oocm{padding-top:0.5rem}.button-left.svelte-c3oocm{justify-content:left}.control-switch.svelte-c3oocm{padding-top:0.4rem}.container-content.svelte-c3oocm{padding:0.5rem 1rem;border-radius:4px;margin-top:0.5rem;background-color:#2b2b2b}.content-header.svelte-c3oocm{color:#fff;border-bottom:dashed 1px #777;padding-top:0.5rem;padding-bottom:1rem}.hero-small.svelte-c3oocm{padding:1.5rem}.has-border.svelte-c3oocm{border-color:#dbdbdb}.hero-rounded.svelte-c3oocm{border-radius:4px}";
  15450. append(document.head, style);
  15451. }
  15452. function get_each_context$1(ctx, list, i) {
  15453. const child_ctx = ctx.slice();
  15454. child_ctx[31] = list[i][0];
  15455. child_ctx[32] = list[i][1];
  15456. return child_ctx;
  15457. }
  15458. function get_each_context_1(ctx, list, i) {
  15459. const child_ctx = ctx.slice();
  15460. child_ctx[35] = list[i];
  15461. child_ctx[36] = list;
  15462. child_ctx[37] = i;
  15463. return child_ctx;
  15464. }
  15465. function get_each_context_2(ctx, list, i) {
  15466. const child_ctx = ctx.slice();
  15467. child_ctx[38] = list[i];
  15468. child_ctx[39] = list;
  15469. child_ctx[40] = i;
  15470. return child_ctx;
  15471. }
  15472. // (119:2) <span slot="heading">
  15473. function create_heading_slot(ctx) {
  15474. let span;
  15475. return {
  15476. c() {
  15477. span = element("span");
  15478. span.textContent = "Playground";
  15479. attr(span, "slot", "heading");
  15480. },
  15481. m(target, anchor) {
  15482. insert(target, span, anchor);
  15483. },
  15484. d(detaching) {
  15485. if (detaching) detach(span);
  15486. }
  15487. };
  15488. }
  15489. // (128:8) {:else}
  15490. function create_else_block_4(ctx) {
  15491. let a;
  15492. let span0;
  15493. let t0_value = /*currentAction*/ ctx[6].method + "";
  15494. let t0;
  15495. let t1;
  15496. let span1;
  15497. let t2_value = /*currentUrl*/ ctx[13].origin + "";
  15498. let t2;
  15499. let t3;
  15500. let span2;
  15501. let t4_value = /*currentUrl*/ ctx[13].pathname + "";
  15502. let t4;
  15503. let dispose;
  15504. return {
  15505. c() {
  15506. a = element("a");
  15507. span0 = element("span");
  15508. t0 = text(t0_value);
  15509. t1 = text("\n  \n ");
  15510. span1 = element("span");
  15511. t2 = text(t2_value);
  15512. t3 = space();
  15513. span2 = element("span");
  15514. t4 = text(t4_value);
  15515. attr(span0, "class", "is-uppercase has-text-weight-bold");
  15516. attr(span2, "class", "has-text-weight-bold");
  15517. attr(a, "href", "javascript:void(0)");
  15518. attr(a, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm");
  15519. },
  15520. m(target, anchor) {
  15521. insert(target, a, anchor);
  15522. append(a, span0);
  15523. append(span0, t0);
  15524. append(a, t1);
  15525. append(a, span1);
  15526. append(span1, t2);
  15527. append(a, t3);
  15528. append(a, span2);
  15529. append(span2, t4);
  15530. dispose = listen(a, "click", /*handleCopy*/ ctx[17]);
  15531. },
  15532. p(ctx, dirty) {
  15533. if (dirty[0] & /*currentAction*/ 64 && t0_value !== (t0_value = /*currentAction*/ ctx[6].method + "")) set_data(t0, t0_value);
  15534. if (dirty[0] & /*currentUrl*/ 8192 && t2_value !== (t2_value = /*currentUrl*/ ctx[13].origin + "")) set_data(t2, t2_value);
  15535. if (dirty[0] & /*currentUrl*/ 8192 && t4_value !== (t4_value = /*currentUrl*/ ctx[13].pathname + "")) set_data(t4, t4_value);
  15536. },
  15537. d(detaching) {
  15538. if (detaching) detach(a);
  15539. dispose();
  15540. }
  15541. };
  15542. }
  15543. // (123:8) {#if copying}
  15544. function create_if_block_7(ctx) {
  15545. let button;
  15546. return {
  15547. c() {
  15548. button = element("button");
  15549. button.innerHTML = `<span>URL has been copied to clipboard.</span>`;
  15550. attr(button, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm");
  15551. },
  15552. m(target, anchor) {
  15553. insert(target, button, anchor);
  15554. },
  15555. p: noop,
  15556. d(detaching) {
  15557. if (detaching) detach(button);
  15558. }
  15559. };
  15560. }
  15561. // (149:8) {:else}
  15562. function create_else_block_3(ctx) {
  15563. let button;
  15564. let dispose;
  15565. return {
  15566. c() {
  15567. button = element("button");
  15568. button.innerHTML = `<span class="icon"><i class="fas fa-paper-plane"></i></span>
  15569. <span>Send</span>`;
  15570. attr(button, "class", "button is-success is-fullwidth");
  15571. },
  15572. m(target, anchor) {
  15573. insert(target, button, anchor);
  15574. dispose = listen(button, "click", /*handleClick*/ ctx[15]);
  15575. },
  15576. p: noop,
  15577. i: noop,
  15578. o: noop,
  15579. d(detaching) {
  15580. if (detaching) detach(button);
  15581. dispose();
  15582. }
  15583. };
  15584. }
  15585. // (143:8) {#if isAuth(environment, 'oauth2') && !$auth.split(';').includes($env)}
  15586. function create_if_block_6(ctx) {
  15587. let current;
  15588. const loginbutton = new LoginButton({
  15589. props: {
  15590. authOptions: /*environment*/ ctx[11].auth.options,
  15591. isPKCE: isPKCE(/*environment*/ ctx[11]),
  15592. pkceChallenge: /*pkceChallenge*/ ctx[7],
  15593. fullWidth: true
  15594. }
  15595. });
  15596. return {
  15597. c() {
  15598. create_component(loginbutton.$$.fragment);
  15599. },
  15600. m(target, anchor) {
  15601. mount_component(loginbutton, target, anchor);
  15602. current = true;
  15603. },
  15604. p(ctx, dirty) {
  15605. const loginbutton_changes = {};
  15606. if (dirty[0] & /*environment*/ 2048) loginbutton_changes.authOptions = /*environment*/ ctx[11].auth.options;
  15607. if (dirty[0] & /*environment*/ 2048) loginbutton_changes.isPKCE = isPKCE(/*environment*/ ctx[11]);
  15608. if (dirty[0] & /*pkceChallenge*/ 128) loginbutton_changes.pkceChallenge = /*pkceChallenge*/ ctx[7];
  15609. loginbutton.$set(loginbutton_changes);
  15610. },
  15611. i(local) {
  15612. if (current) return;
  15613. transition_in(loginbutton.$$.fragment, local);
  15614. current = true;
  15615. },
  15616. o(local) {
  15617. transition_out(loginbutton.$$.fragment, local);
  15618. current = false;
  15619. },
  15620. d(detaching) {
  15621. destroy_component(loginbutton, detaching);
  15622. }
  15623. };
  15624. }
  15625. // (181:6) {:else}
  15626. function create_else_block_2(ctx) {
  15627. let t;
  15628. let if_block_anchor;
  15629. let current;
  15630. let each_value_2 = /*requestHeaders*/ ctx[0];
  15631. let each_blocks = [];
  15632. for (let i = 0; i < each_value_2.length; i += 1) {
  15633. each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
  15634. }
  15635. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  15636. each_blocks[i] = null;
  15637. });
  15638. let if_block = /*requestAuthHeader*/ ctx[1] && create_if_block_5(ctx);
  15639. return {
  15640. c() {
  15641. for (let i = 0; i < each_blocks.length; i += 1) {
  15642. each_blocks[i].c();
  15643. }
  15644. t = space();
  15645. if (if_block) if_block.c();
  15646. if_block_anchor = empty();
  15647. },
  15648. m(target, anchor) {
  15649. for (let i = 0; i < each_blocks.length; i += 1) {
  15650. each_blocks[i].m(target, anchor);
  15651. }
  15652. insert(target, t, anchor);
  15653. if (if_block) if_block.m(target, anchor);
  15654. insert(target, if_block_anchor, anchor);
  15655. current = true;
  15656. },
  15657. p(ctx, dirty) {
  15658. if (dirty[0] & /*requestHeaders*/ 1) {
  15659. each_value_2 = /*requestHeaders*/ ctx[0];
  15660. let i;
  15661. for (i = 0; i < each_value_2.length; i += 1) {
  15662. const child_ctx = get_each_context_2(ctx, each_value_2, i);
  15663. if (each_blocks[i]) {
  15664. each_blocks[i].p(child_ctx, dirty);
  15665. transition_in(each_blocks[i], 1);
  15666. } else {
  15667. each_blocks[i] = create_each_block_2(child_ctx);
  15668. each_blocks[i].c();
  15669. transition_in(each_blocks[i], 1);
  15670. each_blocks[i].m(t.parentNode, t);
  15671. }
  15672. }
  15673. group_outros();
  15674. for (i = each_value_2.length; i < each_blocks.length; i += 1) {
  15675. out(i);
  15676. }
  15677. check_outros();
  15678. }
  15679. if (/*requestAuthHeader*/ ctx[1]) {
  15680. if (if_block) {
  15681. if_block.p(ctx, dirty);
  15682. transition_in(if_block, 1);
  15683. } else {
  15684. if_block = create_if_block_5(ctx);
  15685. if_block.c();
  15686. transition_in(if_block, 1);
  15687. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  15688. }
  15689. } else if (if_block) {
  15690. group_outros();
  15691. transition_out(if_block, 1, 1, () => {
  15692. if_block = null;
  15693. });
  15694. check_outros();
  15695. }
  15696. },
  15697. i(local) {
  15698. if (current) return;
  15699. for (let i = 0; i < each_value_2.length; i += 1) {
  15700. transition_in(each_blocks[i]);
  15701. }
  15702. transition_in(if_block);
  15703. current = true;
  15704. },
  15705. o(local) {
  15706. each_blocks = each_blocks.filter(Boolean);
  15707. for (let i = 0; i < each_blocks.length; i += 1) {
  15708. transition_out(each_blocks[i]);
  15709. }
  15710. transition_out(if_block);
  15711. current = false;
  15712. },
  15713. d(detaching) {
  15714. destroy_each(each_blocks, detaching);
  15715. if (detaching) detach(t);
  15716. if (if_block) if_block.d(detaching);
  15717. if (detaching) detach(if_block_anchor);
  15718. }
  15719. };
  15720. }
  15721. // (177:6) {#if requestHeaders.length === 0 && !environment.auth}
  15722. function create_if_block_4(ctx) {
  15723. let p;
  15724. return {
  15725. c() {
  15726. p = element("p");
  15727. p.innerHTML = `<em>No configurable headers.</em>`;
  15728. },
  15729. m(target, anchor) {
  15730. insert(target, p, anchor);
  15731. },
  15732. p: noop,
  15733. i: noop,
  15734. o: noop,
  15735. d(detaching) {
  15736. if (detaching) detach(p);
  15737. }
  15738. };
  15739. }
  15740. // (182:8) {#each requestHeaders as header}
  15741. function create_each_block_2(ctx) {
  15742. let updating_used;
  15743. let updating_value;
  15744. let current;
  15745. function fieldswitch_used_binding(value) {
  15746. /*fieldswitch_used_binding*/ ctx[23].call(null, value, /*header*/ ctx[38]);
  15747. }
  15748. function fieldswitch_value_binding(value) {
  15749. /*fieldswitch_value_binding*/ ctx[24].call(null, value, /*header*/ ctx[38]);
  15750. }
  15751. let fieldswitch_props = {
  15752. name: /*header*/ ctx[38].name,
  15753. required: /*header*/ ctx[38].required,
  15754. rounded: true
  15755. };
  15756. if (/*header*/ ctx[38].used !== void 0) {
  15757. fieldswitch_props.used = /*header*/ ctx[38].used;
  15758. }
  15759. if (/*header*/ ctx[38].value !== void 0) {
  15760. fieldswitch_props.value = /*header*/ ctx[38].value;
  15761. }
  15762. const fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  15763. binding_callbacks.push(() => bind(fieldswitch, "used", fieldswitch_used_binding));
  15764. binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding));
  15765. return {
  15766. c() {
  15767. create_component(fieldswitch.$$.fragment);
  15768. },
  15769. m(target, anchor) {
  15770. mount_component(fieldswitch, target, anchor);
  15771. current = true;
  15772. },
  15773. p(new_ctx, dirty) {
  15774. ctx = new_ctx;
  15775. const fieldswitch_changes = {};
  15776. if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.name = /*header*/ ctx[38].name;
  15777. if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.required = /*header*/ ctx[38].required;
  15778. if (!updating_used && dirty[0] & /*requestHeaders*/ 1) {
  15779. updating_used = true;
  15780. fieldswitch_changes.used = /*header*/ ctx[38].used;
  15781. add_flush_callback(() => updating_used = false);
  15782. }
  15783. if (!updating_value && dirty[0] & /*requestHeaders*/ 1) {
  15784. updating_value = true;
  15785. fieldswitch_changes.value = /*header*/ ctx[38].value;
  15786. add_flush_callback(() => updating_value = false);
  15787. }
  15788. fieldswitch.$set(fieldswitch_changes);
  15789. },
  15790. i(local) {
  15791. if (current) return;
  15792. transition_in(fieldswitch.$$.fragment, local);
  15793. current = true;
  15794. },
  15795. o(local) {
  15796. transition_out(fieldswitch.$$.fragment, local);
  15797. current = false;
  15798. },
  15799. d(detaching) {
  15800. destroy_component(fieldswitch, detaching);
  15801. }
  15802. };
  15803. }
  15804. // (191:8) {#if requestAuthHeader}
  15805. function create_if_block_5(ctx) {
  15806. let updating_value;
  15807. let current;
  15808. function fieldswitch_value_binding_1(value) {
  15809. /*fieldswitch_value_binding_1*/ ctx[25].call(null, value);
  15810. }
  15811. let fieldswitch_props = {
  15812. name: /*requestAuthHeader*/ ctx[1].name,
  15813. required: /*requestAuthHeader*/ ctx[1].required,
  15814. used: /*requestAuthHeader*/ ctx[1].used,
  15815. rounded: true
  15816. };
  15817. if (/*requestAuthHeader*/ ctx[1].value !== void 0) {
  15818. fieldswitch_props.value = /*requestAuthHeader*/ ctx[1].value;
  15819. }
  15820. const fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  15821. binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding_1));
  15822. return {
  15823. c() {
  15824. create_component(fieldswitch.$$.fragment);
  15825. },
  15826. m(target, anchor) {
  15827. mount_component(fieldswitch, target, anchor);
  15828. current = true;
  15829. },
  15830. p(ctx, dirty) {
  15831. const fieldswitch_changes = {};
  15832. if (dirty[0] & /*requestAuthHeader*/ 2) fieldswitch_changes.name = /*requestAuthHeader*/ ctx[1].name;
  15833. if (dirty[0] & /*requestAuthHeader*/ 2) fieldswitch_changes.required = /*requestAuthHeader*/ ctx[1].required;
  15834. if (dirty[0] & /*requestAuthHeader*/ 2) fieldswitch_changes.used = /*requestAuthHeader*/ ctx[1].used;
  15835. if (!updating_value && dirty[0] & /*requestAuthHeader*/ 2) {
  15836. updating_value = true;
  15837. fieldswitch_changes.value = /*requestAuthHeader*/ ctx[1].value;
  15838. add_flush_callback(() => updating_value = false);
  15839. }
  15840. fieldswitch.$set(fieldswitch_changes);
  15841. },
  15842. i(local) {
  15843. if (current) return;
  15844. transition_in(fieldswitch.$$.fragment, local);
  15845. current = true;
  15846. },
  15847. o(local) {
  15848. transition_out(fieldswitch.$$.fragment, local);
  15849. current = false;
  15850. },
  15851. d(detaching) {
  15852. destroy_component(fieldswitch, detaching);
  15853. }
  15854. };
  15855. }
  15856. // (207:6) {:else}
  15857. function create_else_block_1(ctx) {
  15858. let each_1_anchor;
  15859. let current;
  15860. let each_value_1 = /*requestParameters*/ ctx[2];
  15861. let each_blocks = [];
  15862. for (let i = 0; i < each_value_1.length; i += 1) {
  15863. each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
  15864. }
  15865. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  15866. each_blocks[i] = null;
  15867. });
  15868. return {
  15869. c() {
  15870. for (let i = 0; i < each_blocks.length; i += 1) {
  15871. each_blocks[i].c();
  15872. }
  15873. each_1_anchor = empty();
  15874. },
  15875. m(target, anchor) {
  15876. for (let i = 0; i < each_blocks.length; i += 1) {
  15877. each_blocks[i].m(target, anchor);
  15878. }
  15879. insert(target, each_1_anchor, anchor);
  15880. current = true;
  15881. },
  15882. p(ctx, dirty) {
  15883. if (dirty[0] & /*requestParameters*/ 4) {
  15884. each_value_1 = /*requestParameters*/ ctx[2];
  15885. let i;
  15886. for (i = 0; i < each_value_1.length; i += 1) {
  15887. const child_ctx = get_each_context_1(ctx, each_value_1, i);
  15888. if (each_blocks[i]) {
  15889. each_blocks[i].p(child_ctx, dirty);
  15890. transition_in(each_blocks[i], 1);
  15891. } else {
  15892. each_blocks[i] = create_each_block_1(child_ctx);
  15893. each_blocks[i].c();
  15894. transition_in(each_blocks[i], 1);
  15895. each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
  15896. }
  15897. }
  15898. group_outros();
  15899. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  15900. out(i);
  15901. }
  15902. check_outros();
  15903. }
  15904. },
  15905. i(local) {
  15906. if (current) return;
  15907. for (let i = 0; i < each_value_1.length; i += 1) {
  15908. transition_in(each_blocks[i]);
  15909. }
  15910. current = true;
  15911. },
  15912. o(local) {
  15913. each_blocks = each_blocks.filter(Boolean);
  15914. for (let i = 0; i < each_blocks.length; i += 1) {
  15915. transition_out(each_blocks[i]);
  15916. }
  15917. current = false;
  15918. },
  15919. d(detaching) {
  15920. destroy_each(each_blocks, detaching);
  15921. if (detaching) detach(each_1_anchor);
  15922. }
  15923. };
  15924. }
  15925. // (203:6) {#if requestParameters.length === 0}
  15926. function create_if_block_3(ctx) {
  15927. let p;
  15928. return {
  15929. c() {
  15930. p = element("p");
  15931. p.innerHTML = `<em>No configurable parameters.</em>`;
  15932. },
  15933. m(target, anchor) {
  15934. insert(target, p, anchor);
  15935. },
  15936. p: noop,
  15937. i: noop,
  15938. o: noop,
  15939. d(detaching) {
  15940. if (detaching) detach(p);
  15941. }
  15942. };
  15943. }
  15944. // (208:8) {#each requestParameters as param}
  15945. function create_each_block_1(ctx) {
  15946. let updating_used;
  15947. let updating_value;
  15948. let current;
  15949. function fieldswitch_used_binding_1(value) {
  15950. /*fieldswitch_used_binding_1*/ ctx[26].call(null, value, /*param*/ ctx[35]);
  15951. }
  15952. function fieldswitch_value_binding_2(value) {
  15953. /*fieldswitch_value_binding_2*/ ctx[27].call(null, value, /*param*/ ctx[35]);
  15954. }
  15955. let fieldswitch_props = {
  15956. name: /*param*/ ctx[35].name,
  15957. required: /*param*/ ctx[35].required,
  15958. rounded: false
  15959. };
  15960. if (/*param*/ ctx[35].used !== void 0) {
  15961. fieldswitch_props.used = /*param*/ ctx[35].used;
  15962. }
  15963. if (/*param*/ ctx[35].value !== void 0) {
  15964. fieldswitch_props.value = /*param*/ ctx[35].value;
  15965. }
  15966. const fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  15967. binding_callbacks.push(() => bind(fieldswitch, "used", fieldswitch_used_binding_1));
  15968. binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding_2));
  15969. return {
  15970. c() {
  15971. create_component(fieldswitch.$$.fragment);
  15972. },
  15973. m(target, anchor) {
  15974. mount_component(fieldswitch, target, anchor);
  15975. current = true;
  15976. },
  15977. p(new_ctx, dirty) {
  15978. ctx = new_ctx;
  15979. const fieldswitch_changes = {};
  15980. if (dirty[0] & /*requestParameters*/ 4) fieldswitch_changes.name = /*param*/ ctx[35].name;
  15981. if (dirty[0] & /*requestParameters*/ 4) fieldswitch_changes.required = /*param*/ ctx[35].required;
  15982. if (!updating_used && dirty[0] & /*requestParameters*/ 4) {
  15983. updating_used = true;
  15984. fieldswitch_changes.used = /*param*/ ctx[35].used;
  15985. add_flush_callback(() => updating_used = false);
  15986. }
  15987. if (!updating_value && dirty[0] & /*requestParameters*/ 4) {
  15988. updating_value = true;
  15989. fieldswitch_changes.value = /*param*/ ctx[35].value;
  15990. add_flush_callback(() => updating_value = false);
  15991. }
  15992. fieldswitch.$set(fieldswitch_changes);
  15993. },
  15994. i(local) {
  15995. if (current) return;
  15996. transition_in(fieldswitch.$$.fragment, local);
  15997. current = true;
  15998. },
  15999. o(local) {
  16000. transition_out(fieldswitch.$$.fragment, local);
  16001. current = false;
  16002. },
  16003. d(detaching) {
  16004. destroy_component(fieldswitch, detaching);
  16005. }
  16006. };
  16007. }
  16008. // (225:6) {:else}
  16009. function create_else_block$3(ctx) {
  16010. let p;
  16011. return {
  16012. c() {
  16013. p = element("p");
  16014. p.innerHTML = `<i>Body is only available for POST, PUT and PATCH.</i>`;
  16015. },
  16016. m(target, anchor) {
  16017. insert(target, p, anchor);
  16018. },
  16019. p: noop,
  16020. d(detaching) {
  16021. if (detaching) detach(p);
  16022. }
  16023. };
  16024. }
  16025. // (220:6) {#if allowBody(currentAction)}
  16026. function create_if_block_2$2(ctx) {
  16027. let textarea;
  16028. let dispose;
  16029. return {
  16030. c() {
  16031. textarea = element("textarea");
  16032. attr(textarea, "class", "textarea is-family-code");
  16033. attr(textarea, "rows", "8");
  16034. },
  16035. m(target, anchor) {
  16036. insert(target, textarea, anchor);
  16037. set_input_value(textarea, /*requestBody*/ ctx[3]);
  16038. dispose = listen(textarea, "input", /*textarea_input_handler*/ ctx[28]);
  16039. },
  16040. p(ctx, dirty) {
  16041. if (dirty[0] & /*requestBody*/ 8) {
  16042. set_input_value(textarea, /*requestBody*/ ctx[3]);
  16043. }
  16044. },
  16045. d(detaching) {
  16046. if (detaching) detach(textarea);
  16047. dispose();
  16048. }
  16049. };
  16050. }
  16051. // (265:4) {:catch error}
  16052. function create_catch_block(ctx) {
  16053. let div1;
  16054. let section1;
  16055. let section0;
  16056. let div0;
  16057. let p;
  16058. let t_value = /*error*/ ctx[30] + "";
  16059. let t;
  16060. return {
  16061. c() {
  16062. div1 = element("div");
  16063. section1 = element("section");
  16064. section0 = element("section");
  16065. div0 = element("div");
  16066. p = element("p");
  16067. t = text(t_value);
  16068. attr(p, "class", "subtitle");
  16069. attr(div0, "class", "container");
  16070. attr(section0, "class", "hero-body");
  16071. attr(section1, "class", "hero is-danger");
  16072. attr(div1, "class", "small-section svelte-c3oocm");
  16073. },
  16074. m(target, anchor) {
  16075. insert(target, div1, anchor);
  16076. append(div1, section1);
  16077. append(section1, section0);
  16078. append(section0, div0);
  16079. append(div0, p);
  16080. append(p, t);
  16081. },
  16082. p(ctx, dirty) {
  16083. if (dirty[0] & /*response*/ 256 && t_value !== (t_value = /*error*/ ctx[30] + "")) set_data(t, t_value);
  16084. },
  16085. i: noop,
  16086. o: noop,
  16087. d(detaching) {
  16088. if (detaching) detach(div1);
  16089. }
  16090. };
  16091. }
  16092. // (238:4) {:then value}
  16093. function create_then_block(ctx) {
  16094. let show_if = Object.keys(/*value*/ ctx[29] || {}).length > 0;
  16095. let if_block_anchor;
  16096. let current;
  16097. let if_block = show_if && create_if_block$6(ctx);
  16098. return {
  16099. c() {
  16100. if (if_block) if_block.c();
  16101. if_block_anchor = empty();
  16102. },
  16103. m(target, anchor) {
  16104. if (if_block) if_block.m(target, anchor);
  16105. insert(target, if_block_anchor, anchor);
  16106. current = true;
  16107. },
  16108. p(ctx, dirty) {
  16109. if (dirty[0] & /*response*/ 256) show_if = Object.keys(/*value*/ ctx[29] || {}).length > 0;
  16110. if (show_if) {
  16111. if (if_block) {
  16112. if_block.p(ctx, dirty);
  16113. transition_in(if_block, 1);
  16114. } else {
  16115. if_block = create_if_block$6(ctx);
  16116. if_block.c();
  16117. transition_in(if_block, 1);
  16118. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  16119. }
  16120. } else if (if_block) {
  16121. group_outros();
  16122. transition_out(if_block, 1, 1, () => {
  16123. if_block = null;
  16124. });
  16125. check_outros();
  16126. }
  16127. },
  16128. i(local) {
  16129. if (current) return;
  16130. transition_in(if_block);
  16131. current = true;
  16132. },
  16133. o(local) {
  16134. transition_out(if_block);
  16135. current = false;
  16136. },
  16137. d(detaching) {
  16138. if (if_block) if_block.d(detaching);
  16139. if (detaching) detach(if_block_anchor);
  16140. }
  16141. };
  16142. }
  16143. // (239:6) {#if Object.keys(value || {}).length > 0}
  16144. function create_if_block$6(ctx) {
  16145. let div1;
  16146. let section1;
  16147. let section0;
  16148. let div0;
  16149. let h1;
  16150. let t0_value = /*value*/ ctx[29].status + "";
  16151. let t0;
  16152. let t1;
  16153. let t2_value = /*value*/ ctx[29].statusText + "";
  16154. let t2;
  16155. let section1_class_value;
  16156. let t3;
  16157. let show_if = Object.keys(/*value*/ ctx[29].headers).length > 0;
  16158. let current;
  16159. let if_block = show_if && create_if_block_1$4(ctx);
  16160. return {
  16161. c() {
  16162. div1 = element("div");
  16163. section1 = element("section");
  16164. section0 = element("section");
  16165. div0 = element("div");
  16166. h1 = element("h1");
  16167. t0 = text(t0_value);
  16168. t1 = space();
  16169. t2 = text(t2_value);
  16170. t3 = space();
  16171. if (if_block) if_block.c();
  16172. attr(h1, "class", "title");
  16173. attr(div0, "class", "container has-text-centered");
  16174. attr(section0, "class", "hero-body hero-small svelte-c3oocm");
  16175. attr(section1, "class", section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[29].status) + " svelte-c3oocm");
  16176. attr(div1, "class", "small-section svelte-c3oocm");
  16177. },
  16178. m(target, anchor) {
  16179. insert(target, div1, anchor);
  16180. append(div1, section1);
  16181. append(section1, section0);
  16182. append(section0, div0);
  16183. append(div0, h1);
  16184. append(h1, t0);
  16185. append(h1, t1);
  16186. append(h1, t2);
  16187. append(div1, t3);
  16188. if (if_block) if_block.m(div1, null);
  16189. current = true;
  16190. },
  16191. p(ctx, dirty) {
  16192. if ((!current || dirty[0] & /*response*/ 256) && t0_value !== (t0_value = /*value*/ ctx[29].status + "")) set_data(t0, t0_value);
  16193. if ((!current || dirty[0] & /*response*/ 256) && t2_value !== (t2_value = /*value*/ ctx[29].statusText + "")) set_data(t2, t2_value);
  16194. if (!current || dirty[0] & /*response*/ 256 && section1_class_value !== (section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[29].status) + " svelte-c3oocm")) {
  16195. attr(section1, "class", section1_class_value);
  16196. }
  16197. if (dirty[0] & /*response*/ 256) show_if = Object.keys(/*value*/ ctx[29].headers).length > 0;
  16198. if (show_if) {
  16199. if (if_block) {
  16200. if_block.p(ctx, dirty);
  16201. transition_in(if_block, 1);
  16202. } else {
  16203. if_block = create_if_block_1$4(ctx);
  16204. if_block.c();
  16205. transition_in(if_block, 1);
  16206. if_block.m(div1, null);
  16207. }
  16208. } else if (if_block) {
  16209. group_outros();
  16210. transition_out(if_block, 1, 1, () => {
  16211. if_block = null;
  16212. });
  16213. check_outros();
  16214. }
  16215. },
  16216. i(local) {
  16217. if (current) return;
  16218. transition_in(if_block);
  16219. current = true;
  16220. },
  16221. o(local) {
  16222. transition_out(if_block);
  16223. current = false;
  16224. },
  16225. d(detaching) {
  16226. if (detaching) detach(div1);
  16227. if (if_block) if_block.d();
  16228. }
  16229. };
  16230. }
  16231. // (249:10) {#if Object.keys(value.headers).length > 0}
  16232. function create_if_block_1$4(ctx) {
  16233. let div1;
  16234. let div0;
  16235. let t;
  16236. let current;
  16237. let each_value = Object.entries(/*value*/ ctx[29].headers);
  16238. let each_blocks = [];
  16239. for (let i = 0; i < each_value.length; i += 1) {
  16240. each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
  16241. }
  16242. const codeblock = new CodeBlock({
  16243. props: {
  16244. type: contentType(/*value*/ ctx[29].headers),
  16245. body: /*value*/ ctx[29].data
  16246. }
  16247. });
  16248. return {
  16249. c() {
  16250. div1 = element("div");
  16251. div0 = element("div");
  16252. for (let i = 0; i < each_blocks.length; i += 1) {
  16253. each_blocks[i].c();
  16254. }
  16255. t = space();
  16256. create_component(codeblock.$$.fragment);
  16257. attr(div0, "class", "content-header svelte-c3oocm");
  16258. attr(div1, "class", "container container-content svelte-c3oocm");
  16259. },
  16260. m(target, anchor) {
  16261. insert(target, div1, anchor);
  16262. append(div1, div0);
  16263. for (let i = 0; i < each_blocks.length; i += 1) {
  16264. each_blocks[i].m(div0, null);
  16265. }
  16266. append(div1, t);
  16267. mount_component(codeblock, div1, null);
  16268. current = true;
  16269. },
  16270. p(ctx, dirty) {
  16271. if (dirty[0] & /*response*/ 256) {
  16272. each_value = Object.entries(/*value*/ ctx[29].headers);
  16273. let i;
  16274. for (i = 0; i < each_value.length; i += 1) {
  16275. const child_ctx = get_each_context$1(ctx, each_value, i);
  16276. if (each_blocks[i]) {
  16277. each_blocks[i].p(child_ctx, dirty);
  16278. } else {
  16279. each_blocks[i] = create_each_block$1(child_ctx);
  16280. each_blocks[i].c();
  16281. each_blocks[i].m(div0, null);
  16282. }
  16283. }
  16284. for (; i < each_blocks.length; i += 1) {
  16285. each_blocks[i].d(1);
  16286. }
  16287. each_blocks.length = each_value.length;
  16288. }
  16289. const codeblock_changes = {};
  16290. if (dirty[0] & /*response*/ 256) codeblock_changes.type = contentType(/*value*/ ctx[29].headers);
  16291. if (dirty[0] & /*response*/ 256) codeblock_changes.body = /*value*/ ctx[29].data;
  16292. codeblock.$set(codeblock_changes);
  16293. },
  16294. i(local) {
  16295. if (current) return;
  16296. transition_in(codeblock.$$.fragment, local);
  16297. current = true;
  16298. },
  16299. o(local) {
  16300. transition_out(codeblock.$$.fragment, local);
  16301. current = false;
  16302. },
  16303. d(detaching) {
  16304. if (detaching) detach(div1);
  16305. destroy_each(each_blocks, detaching);
  16306. destroy_component(codeblock);
  16307. }
  16308. };
  16309. }
  16310. // (252:16) {#each Object.entries(value.headers) as [key, val]}
  16311. function create_each_block$1(ctx) {
  16312. let p;
  16313. let span;
  16314. let t0_value = /*key*/ ctx[31] + "";
  16315. let t0;
  16316. let t1;
  16317. let t2_value = /*val*/ ctx[32] + "";
  16318. let t2;
  16319. let t3;
  16320. return {
  16321. c() {
  16322. p = element("p");
  16323. span = element("span");
  16324. t0 = text(t0_value);
  16325. t1 = text("\n : ");
  16326. t2 = text(t2_value);
  16327. t3 = space();
  16328. attr(span, "class", "is-capitalized");
  16329. attr(p, "class", "is-family-code");
  16330. },
  16331. m(target, anchor) {
  16332. insert(target, p, anchor);
  16333. append(p, span);
  16334. append(span, t0);
  16335. append(p, t1);
  16336. append(p, t2);
  16337. append(p, t3);
  16338. },
  16339. p(ctx, dirty) {
  16340. if (dirty[0] & /*response*/ 256 && t0_value !== (t0_value = /*key*/ ctx[31] + "")) set_data(t0, t0_value);
  16341. if (dirty[0] & /*response*/ 256 && t2_value !== (t2_value = /*val*/ ctx[32] + "")) set_data(t2, t2_value);
  16342. },
  16343. d(detaching) {
  16344. if (detaching) detach(p);
  16345. }
  16346. };
  16347. }
  16348. // (232:21) <div class="section has-text-centered"> <span class="icon is-medium has-text-danger"> <i class="fas fa-2x fa-spinner fa-pulse" /> </span> </div> {:then value}
  16349. function create_pending_block(ctx) {
  16350. let div;
  16351. return {
  16352. c() {
  16353. div = element("div");
  16354. div.innerHTML = `<span class="icon is-medium has-text-danger"><i class="fas fa-2x fa-spinner fa-pulse"></i></span>`;
  16355. attr(div, "class", "section has-text-centered");
  16356. },
  16357. m(target, anchor) {
  16358. insert(target, div, anchor);
  16359. },
  16360. p: noop,
  16361. i: noop,
  16362. o: noop,
  16363. d(detaching) {
  16364. if (detaching) detach(div);
  16365. }
  16366. };
  16367. }
  16368. // (120:2) <div slot="body">
  16369. function create_body_slot(ctx) {
  16370. let div0;
  16371. let div3;
  16372. let div1;
  16373. let t0;
  16374. let div2;
  16375. let show_if_1;
  16376. let current_block_type_index;
  16377. let if_block1;
  16378. let t1;
  16379. let div4;
  16380. let ul;
  16381. let li0;
  16382. let a0;
  16383. let t3;
  16384. let li1;
  16385. let a1;
  16386. let t5;
  16387. let li2;
  16388. let a2;
  16389. let t7;
  16390. let div5;
  16391. let current_block_type_index_1;
  16392. let if_block2;
  16393. let t8;
  16394. let div6;
  16395. let current_block_type_index_2;
  16396. let if_block3;
  16397. let t9;
  16398. let div7;
  16399. let show_if;
  16400. let t10;
  16401. let promise;
  16402. let current;
  16403. let dispose;
  16404. function select_block_type(ctx, dirty) {
  16405. if (/*copying*/ ctx[10]) return create_if_block_7;
  16406. return create_else_block_4;
  16407. }
  16408. let current_block_type = select_block_type(ctx, [-1]);
  16409. let if_block0 = current_block_type(ctx);
  16410. const if_block_creators = [create_if_block_6, create_else_block_3];
  16411. const if_blocks = [];
  16412. function select_block_type_1(ctx, dirty) {
  16413. if (dirty[0] & /*environment, $auth, $env*/ 22528) show_if_1 = !!(isAuth(/*environment*/ ctx[11], "oauth2") && !/*$auth*/ ctx[14].split(";").includes(/*$env*/ ctx[12]));
  16414. if (show_if_1) return 0;
  16415. return 1;
  16416. }
  16417. current_block_type_index = select_block_type_1(ctx, [-1]);
  16418. if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  16419. const if_block_creators_1 = [create_if_block_4, create_else_block_2];
  16420. const if_blocks_1 = [];
  16421. function select_block_type_2(ctx, dirty) {
  16422. if (/*requestHeaders*/ ctx[0].length === 0 && !/*environment*/ ctx[11].auth) return 0;
  16423. return 1;
  16424. }
  16425. current_block_type_index_1 = select_block_type_2(ctx, [-1]);
  16426. if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx);
  16427. const if_block_creators_2 = [create_if_block_3, create_else_block_1];
  16428. const if_blocks_2 = [];
  16429. function select_block_type_3(ctx, dirty) {
  16430. if (/*requestParameters*/ ctx[2].length === 0) return 0;
  16431. return 1;
  16432. }
  16433. current_block_type_index_2 = select_block_type_3(ctx, [-1]);
  16434. if_block3 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx);
  16435. function select_block_type_4(ctx, dirty) {
  16436. if (show_if == null || dirty[0] & /*currentAction*/ 64) show_if = !!allowBody(/*currentAction*/ ctx[6]);
  16437. if (show_if) return create_if_block_2$2;
  16438. return create_else_block$3;
  16439. }
  16440. let current_block_type_1 = select_block_type_4(ctx, [-1]);
  16441. let if_block4 = current_block_type_1(ctx);
  16442. let info = {
  16443. ctx,
  16444. current: null,
  16445. token: null,
  16446. pending: create_pending_block,
  16447. then: create_then_block,
  16448. catch: create_catch_block,
  16449. value: 29,
  16450. error: 30,
  16451. blocks: [,,,]
  16452. };
  16453. handle_promise(promise = /*response*/ ctx[8], info);
  16454. return {
  16455. c() {
  16456. div0 = element("div");
  16457. div3 = element("div");
  16458. div1 = element("div");
  16459. if_block0.c();
  16460. t0 = space();
  16461. div2 = element("div");
  16462. if_block1.c();
  16463. t1 = space();
  16464. div4 = element("div");
  16465. ul = element("ul");
  16466. li0 = element("li");
  16467. a0 = element("a");
  16468. a0.textContent = "Headers";
  16469. t3 = space();
  16470. li1 = element("li");
  16471. a1 = element("a");
  16472. a1.textContent = "Parameters";
  16473. t5 = space();
  16474. li2 = element("li");
  16475. a2 = element("a");
  16476. a2.textContent = "Body";
  16477. t7 = space();
  16478. div5 = element("div");
  16479. if_block2.c();
  16480. t8 = space();
  16481. div6 = element("div");
  16482. if_block3.c();
  16483. t9 = space();
  16484. div7 = element("div");
  16485. if_block4.c();
  16486. t10 = space();
  16487. info.block.c();
  16488. attr(div1, "class", "column");
  16489. attr(div2, "class", "column is-one-fifth");
  16490. attr(div3, "class", "columns");
  16491. attr(a0, "href", "javascript:void(0)");
  16492. toggle_class(li0, "is-active", /*requestTab*/ ctx[9] === 0);
  16493. attr(a1, "href", "javascript:void(0)");
  16494. toggle_class(li1, "is-active", /*requestTab*/ ctx[9] === 1);
  16495. attr(a2, "href", "javascript:void(0)");
  16496. toggle_class(li2, "is-active", /*requestTab*/ ctx[9] === 2);
  16497. attr(div4, "class", "tabs is-boxed");
  16498. attr(div5, "class", "section-headers");
  16499. toggle_class(div5, "is-hidden", /*requestTab*/ ctx[9] != 0);
  16500. attr(div6, "class", "section-parameters");
  16501. toggle_class(div6, "is-hidden", /*requestTab*/ ctx[9] != 1);
  16502. attr(div7, "class", "section-body");
  16503. toggle_class(div7, "is-hidden", /*requestTab*/ ctx[9] != 2);
  16504. attr(div0, "slot", "body");
  16505. },
  16506. m(target, anchor) {
  16507. insert(target, div0, anchor);
  16508. append(div0, div3);
  16509. append(div3, div1);
  16510. if_block0.m(div1, null);
  16511. append(div3, t0);
  16512. append(div3, div2);
  16513. if_blocks[current_block_type_index].m(div2, null);
  16514. append(div0, t1);
  16515. append(div0, div4);
  16516. append(div4, ul);
  16517. append(ul, li0);
  16518. append(li0, a0);
  16519. append(ul, t3);
  16520. append(ul, li1);
  16521. append(li1, a1);
  16522. append(ul, t5);
  16523. append(ul, li2);
  16524. append(li2, a2);
  16525. append(div0, t7);
  16526. append(div0, div5);
  16527. if_blocks_1[current_block_type_index_1].m(div5, null);
  16528. append(div0, t8);
  16529. append(div0, div6);
  16530. if_blocks_2[current_block_type_index_2].m(div6, null);
  16531. append(div0, t9);
  16532. append(div0, div7);
  16533. if_block4.m(div7, null);
  16534. append(div0, t10);
  16535. info.block.m(div0, info.anchor = null);
  16536. info.mount = () => div0;
  16537. info.anchor = null;
  16538. current = true;
  16539. dispose = [
  16540. listen(a0, "click", /*click_handler*/ ctx[20]),
  16541. listen(a1, "click", /*click_handler_1*/ ctx[21]),
  16542. listen(a2, "click", /*click_handler_2*/ ctx[22])
  16543. ];
  16544. },
  16545. p(new_ctx, dirty) {
  16546. ctx = new_ctx;
  16547. if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) {
  16548. if_block0.p(ctx, dirty);
  16549. } else {
  16550. if_block0.d(1);
  16551. if_block0 = current_block_type(ctx);
  16552. if (if_block0) {
  16553. if_block0.c();
  16554. if_block0.m(div1, null);
  16555. }
  16556. }
  16557. let previous_block_index = current_block_type_index;
  16558. current_block_type_index = select_block_type_1(ctx, dirty);
  16559. if (current_block_type_index === previous_block_index) {
  16560. if_blocks[current_block_type_index].p(ctx, dirty);
  16561. } else {
  16562. group_outros();
  16563. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  16564. if_blocks[previous_block_index] = null;
  16565. });
  16566. check_outros();
  16567. if_block1 = if_blocks[current_block_type_index];
  16568. if (!if_block1) {
  16569. if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  16570. if_block1.c();
  16571. }
  16572. transition_in(if_block1, 1);
  16573. if_block1.m(div2, null);
  16574. }
  16575. if (dirty[0] & /*requestTab*/ 512) {
  16576. toggle_class(li0, "is-active", /*requestTab*/ ctx[9] === 0);
  16577. }
  16578. if (dirty[0] & /*requestTab*/ 512) {
  16579. toggle_class(li1, "is-active", /*requestTab*/ ctx[9] === 1);
  16580. }
  16581. if (dirty[0] & /*requestTab*/ 512) {
  16582. toggle_class(li2, "is-active", /*requestTab*/ ctx[9] === 2);
  16583. }
  16584. let previous_block_index_1 = current_block_type_index_1;
  16585. current_block_type_index_1 = select_block_type_2(ctx, dirty);
  16586. if (current_block_type_index_1 === previous_block_index_1) {
  16587. if_blocks_1[current_block_type_index_1].p(ctx, dirty);
  16588. } else {
  16589. group_outros();
  16590. transition_out(if_blocks_1[previous_block_index_1], 1, 1, () => {
  16591. if_blocks_1[previous_block_index_1] = null;
  16592. });
  16593. check_outros();
  16594. if_block2 = if_blocks_1[current_block_type_index_1];
  16595. if (!if_block2) {
  16596. if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx);
  16597. if_block2.c();
  16598. }
  16599. transition_in(if_block2, 1);
  16600. if_block2.m(div5, null);
  16601. }
  16602. if (dirty[0] & /*requestTab*/ 512) {
  16603. toggle_class(div5, "is-hidden", /*requestTab*/ ctx[9] != 0);
  16604. }
  16605. let previous_block_index_2 = current_block_type_index_2;
  16606. current_block_type_index_2 = select_block_type_3(ctx, dirty);
  16607. if (current_block_type_index_2 === previous_block_index_2) {
  16608. if_blocks_2[current_block_type_index_2].p(ctx, dirty);
  16609. } else {
  16610. group_outros();
  16611. transition_out(if_blocks_2[previous_block_index_2], 1, 1, () => {
  16612. if_blocks_2[previous_block_index_2] = null;
  16613. });
  16614. check_outros();
  16615. if_block3 = if_blocks_2[current_block_type_index_2];
  16616. if (!if_block3) {
  16617. if_block3 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx);
  16618. if_block3.c();
  16619. }
  16620. transition_in(if_block3, 1);
  16621. if_block3.m(div6, null);
  16622. }
  16623. if (dirty[0] & /*requestTab*/ 512) {
  16624. toggle_class(div6, "is-hidden", /*requestTab*/ ctx[9] != 1);
  16625. }
  16626. if (current_block_type_1 === (current_block_type_1 = select_block_type_4(ctx, dirty)) && if_block4) {
  16627. if_block4.p(ctx, dirty);
  16628. } else {
  16629. if_block4.d(1);
  16630. if_block4 = current_block_type_1(ctx);
  16631. if (if_block4) {
  16632. if_block4.c();
  16633. if_block4.m(div7, null);
  16634. }
  16635. }
  16636. if (dirty[0] & /*requestTab*/ 512) {
  16637. toggle_class(div7, "is-hidden", /*requestTab*/ ctx[9] != 2);
  16638. }
  16639. info.ctx = ctx;
  16640. if (dirty[0] & /*response*/ 256 && promise !== (promise = /*response*/ ctx[8]) && handle_promise(promise, info)) {
  16641. } else {
  16642. const child_ctx = ctx.slice();
  16643. child_ctx[29] = info.resolved;
  16644. info.block.p(child_ctx, dirty);
  16645. }
  16646. },
  16647. i(local) {
  16648. if (current) return;
  16649. transition_in(if_block1);
  16650. transition_in(if_block2);
  16651. transition_in(if_block3);
  16652. transition_in(info.block);
  16653. current = true;
  16654. },
  16655. o(local) {
  16656. transition_out(if_block1);
  16657. transition_out(if_block2);
  16658. transition_out(if_block3);
  16659. for (let i = 0; i < 3; i += 1) {
  16660. const block = info.blocks[i];
  16661. transition_out(block);
  16662. }
  16663. current = false;
  16664. },
  16665. d(detaching) {
  16666. if (detaching) detach(div0);
  16667. if_block0.d();
  16668. if_blocks[current_block_type_index].d();
  16669. if_blocks_1[current_block_type_index_1].d();
  16670. if_blocks_2[current_block_type_index_2].d();
  16671. if_block4.d();
  16672. info.block.d();
  16673. info.token = null;
  16674. info = null;
  16675. run_all(dispose);
  16676. }
  16677. };
  16678. }
  16679. // (118:0) <CollapsiblePanel dark={true} {isDarkmode} {show}>
  16680. function create_default_slot(ctx) {
  16681. let t;
  16682. let current;
  16683. return {
  16684. c() {
  16685. t = space();
  16686. },
  16687. m(target, anchor) {
  16688. insert(target, t, anchor);
  16689. },
  16690. p: noop,
  16691. i: noop,
  16692. o: noop,
  16693. d(detaching) {
  16694. if (detaching) detach(t);
  16695. }
  16696. };
  16697. }
  16698. function create_fragment$c(ctx) {
  16699. let current;
  16700. const collapsiblepanel = new CollapsiblePanel({
  16701. props: {
  16702. dark: true,
  16703. isDarkmode: /*isDarkmode*/ ctx[5],
  16704. show: /*show*/ ctx[4],
  16705. $$slots: {
  16706. default: [create_default_slot],
  16707. body: [create_body_slot],
  16708. heading: [create_heading_slot]
  16709. },
  16710. $$scope: { ctx }
  16711. }
  16712. });
  16713. return {
  16714. c() {
  16715. create_component(collapsiblepanel.$$.fragment);
  16716. },
  16717. m(target, anchor) {
  16718. mount_component(collapsiblepanel, target, anchor);
  16719. current = true;
  16720. },
  16721. p(ctx, dirty) {
  16722. const collapsiblepanel_changes = {};
  16723. if (dirty[0] & /*isDarkmode*/ 32) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[5];
  16724. if (dirty[0] & /*show*/ 16) collapsiblepanel_changes.show = /*show*/ ctx[4];
  16725. if (dirty[0] & /*response, requestTab, requestBody, currentAction, requestParameters, requestHeaders, environment, requestAuthHeader, pkceChallenge, $auth, $env, copying, currentUrl*/ 32719 | dirty[1] & /*$$scope*/ 1024) {
  16726. collapsiblepanel_changes.$$scope = { dirty, ctx };
  16727. }
  16728. collapsiblepanel.$set(collapsiblepanel_changes);
  16729. },
  16730. i(local) {
  16731. if (current) return;
  16732. transition_in(collapsiblepanel.$$.fragment, local);
  16733. current = true;
  16734. },
  16735. o(local) {
  16736. transition_out(collapsiblepanel.$$.fragment, local);
  16737. current = false;
  16738. },
  16739. d(detaching) {
  16740. destroy_component(collapsiblepanel, detaching);
  16741. }
  16742. };
  16743. }
  16744. function contentType(headers) {
  16745. return headers && headers["content-type"];
  16746. }
  16747. function basicAuth$1(username, password) {
  16748. return btoa(`${username}:${password}`);
  16749. }
  16750. function instance$c($$self, $$props, $$invalidate) {
  16751. let $env;
  16752. let $router;
  16753. let $auth;
  16754. component_subscribe($$self, env, $$value => $$invalidate(12, $env = $$value));
  16755. component_subscribe($$self, router, $$value => $$invalidate(19, $router = $$value));
  16756. component_subscribe($$self, auth, $$value => $$invalidate(14, $auth = $$value));
  16757. let { show = true } = $$props;
  16758. let { isDarkmode } = $$props;
  16759. let { environments } = $$props;
  16760. let { currentAction } = $$props;
  16761. let { requestHeaders } = $$props;
  16762. let { requestAuthHeader } = $$props;
  16763. let { requestParameters } = $$props;
  16764. let { requestBody } = $$props;
  16765. let { pkceChallenge } = $$props;
  16766. let response;
  16767. let requestTab = 0;
  16768. let copying = false;
  16769. function handleClick() {
  16770. $$invalidate(8, response = sendRequest($env, environment, currentAction, {
  16771. headers: requestHeaders.concat(requestAuthHeader),
  16772. parameters: requestParameters,
  16773. body: requestBody
  16774. }));
  16775. }
  16776. function handleTab(index) {
  16777. $$invalidate(9, requestTab = index);
  16778. }
  16779. function handleCopy() {
  16780. $$invalidate(10, copying = true);
  16781. setTimeout(
  16782. () => {
  16783. $$invalidate(10, copying = false);
  16784. },
  16785. 2000
  16786. );
  16787. copyUrl(currentUrl, requestParameters);
  16788. }
  16789. const click_handler = () => handleTab(0);
  16790. const click_handler_1 = () => handleTab(1);
  16791. const click_handler_2 = () => handleTab(2);
  16792. function fieldswitch_used_binding(value, header) {
  16793. header.used = value;
  16794. $$invalidate(0, requestHeaders);
  16795. }
  16796. function fieldswitch_value_binding(value, header) {
  16797. header.value = value;
  16798. $$invalidate(0, requestHeaders);
  16799. }
  16800. function fieldswitch_value_binding_1(value) {
  16801. requestAuthHeader.value = value;
  16802. $$invalidate(1, requestAuthHeader);
  16803. }
  16804. function fieldswitch_used_binding_1(value, param) {
  16805. param.used = value;
  16806. $$invalidate(2, requestParameters);
  16807. }
  16808. function fieldswitch_value_binding_2(value, param) {
  16809. param.value = value;
  16810. $$invalidate(2, requestParameters);
  16811. }
  16812. function textarea_input_handler() {
  16813. requestBody = this.value;
  16814. $$invalidate(3, requestBody);
  16815. }
  16816. $$self.$set = $$props => {
  16817. if ("show" in $$props) $$invalidate(4, show = $$props.show);
  16818. if ("isDarkmode" in $$props) $$invalidate(5, isDarkmode = $$props.isDarkmode);
  16819. if ("environments" in $$props) $$invalidate(18, environments = $$props.environments);
  16820. if ("currentAction" in $$props) $$invalidate(6, currentAction = $$props.currentAction);
  16821. if ("requestHeaders" in $$props) $$invalidate(0, requestHeaders = $$props.requestHeaders);
  16822. if ("requestAuthHeader" in $$props) $$invalidate(1, requestAuthHeader = $$props.requestAuthHeader);
  16823. if ("requestParameters" in $$props) $$invalidate(2, requestParameters = $$props.requestParameters);
  16824. if ("requestBody" in $$props) $$invalidate(3, requestBody = $$props.requestBody);
  16825. if ("pkceChallenge" in $$props) $$invalidate(7, pkceChallenge = $$props.pkceChallenge);
  16826. };
  16827. let environment;
  16828. let currentUrl;
  16829. $$self.$$.update = () => {
  16830. if ($$self.$$.dirty[0] & /*environments, $env*/ 266240) {
  16831. $$invalidate(11, environment = environments[$env]);
  16832. }
  16833. if ($$self.$$.dirty[0] & /*environment, currentAction*/ 2112) {
  16834. $$invalidate(13, currentUrl = urlParse(urlJoin(environment.url, currentAction.path)));
  16835. }
  16836. if ($$self.$$.dirty[0] & /*$router*/ 524288) {
  16837. $$invalidate(8, response = $router && undefined);
  16838. }
  16839. };
  16840. return [
  16841. requestHeaders,
  16842. requestAuthHeader,
  16843. requestParameters,
  16844. requestBody,
  16845. show,
  16846. isDarkmode,
  16847. currentAction,
  16848. pkceChallenge,
  16849. response,
  16850. requestTab,
  16851. copying,
  16852. environment,
  16853. $env,
  16854. currentUrl,
  16855. $auth,
  16856. handleClick,
  16857. handleTab,
  16858. handleCopy,
  16859. environments,
  16860. $router,
  16861. click_handler,
  16862. click_handler_1,
  16863. click_handler_2,
  16864. fieldswitch_used_binding,
  16865. fieldswitch_value_binding,
  16866. fieldswitch_value_binding_1,
  16867. fieldswitch_used_binding_1,
  16868. fieldswitch_value_binding_2,
  16869. textarea_input_handler
  16870. ];
  16871. }
  16872. class PlaygroundPanel extends SvelteComponent {
  16873. constructor(options) {
  16874. super();
  16875. if (!document.getElementById("svelte-c3oocm-style")) add_css$6();
  16876. init(
  16877. this,
  16878. options,
  16879. instance$c,
  16880. create_fragment$c,
  16881. safe_not_equal,
  16882. {
  16883. show: 4,
  16884. isDarkmode: 5,
  16885. environments: 18,
  16886. currentAction: 6,
  16887. requestHeaders: 0,
  16888. requestAuthHeader: 1,
  16889. requestParameters: 2,
  16890. requestBody: 3,
  16891. pkceChallenge: 7
  16892. },
  16893. [-1, -1]
  16894. );
  16895. }
  16896. }
  16897. /* usr/local/lib/node_modules/snowboard/templates/winter/tables/HeaderTable.svelte generated by Svelte v3.19.2 */
  16898. function get_each_context$2(ctx, list, i) {
  16899. const child_ctx = ctx.slice();
  16900. child_ctx[1] = list[i].name;
  16901. child_ctx[2] = list[i].example;
  16902. return child_ctx;
  16903. }
  16904. // (5:0) {#if headers.length > 0}
  16905. function create_if_block$7(ctx) {
  16906. let table;
  16907. let thead;
  16908. let t1;
  16909. let tbody;
  16910. let each_value = /*headers*/ ctx[0];
  16911. let each_blocks = [];
  16912. for (let i = 0; i < each_value.length; i += 1) {
  16913. each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
  16914. }
  16915. return {
  16916. c() {
  16917. table = element("table");
  16918. thead = element("thead");
  16919. thead.innerHTML = `<tr><th colspan="2">Headers</th></tr>`;
  16920. t1 = space();
  16921. tbody = element("tbody");
  16922. for (let i = 0; i < each_blocks.length; i += 1) {
  16923. each_blocks[i].c();
  16924. }
  16925. attr(table, "class", "table is-stripped is-fullwidth");
  16926. },
  16927. m(target, anchor) {
  16928. insert(target, table, anchor);
  16929. append(table, thead);
  16930. append(table, t1);
  16931. append(table, tbody);
  16932. for (let i = 0; i < each_blocks.length; i += 1) {
  16933. each_blocks[i].m(tbody, null);
  16934. }
  16935. },
  16936. p(ctx, dirty) {
  16937. if (dirty & /*headers*/ 1) {
  16938. each_value = /*headers*/ ctx[0];
  16939. let i;
  16940. for (i = 0; i < each_value.length; i += 1) {
  16941. const child_ctx = get_each_context$2(ctx, each_value, i);
  16942. if (each_blocks[i]) {
  16943. each_blocks[i].p(child_ctx, dirty);
  16944. } else {
  16945. each_blocks[i] = create_each_block$2(child_ctx);
  16946. each_blocks[i].c();
  16947. each_blocks[i].m(tbody, null);
  16948. }
  16949. }
  16950. for (; i < each_blocks.length; i += 1) {
  16951. each_blocks[i].d(1);
  16952. }
  16953. each_blocks.length = each_value.length;
  16954. }
  16955. },
  16956. d(detaching) {
  16957. if (detaching) detach(table);
  16958. destroy_each(each_blocks, detaching);
  16959. }
  16960. };
  16961. }
  16962. // (13:6) {#each headers as { name, example }}
  16963. function create_each_block$2(ctx) {
  16964. let tr;
  16965. let td0;
  16966. let t0_value = /*name*/ ctx[1] + "";
  16967. let t0;
  16968. let t1;
  16969. let td1;
  16970. let code;
  16971. let t2_value = /*example*/ ctx[2] + "";
  16972. let t2;
  16973. let t3;
  16974. return {
  16975. c() {
  16976. tr = element("tr");
  16977. td0 = element("td");
  16978. t0 = text(t0_value);
  16979. t1 = space();
  16980. td1 = element("td");
  16981. code = element("code");
  16982. t2 = text(t2_value);
  16983. t3 = space();
  16984. },
  16985. m(target, anchor) {
  16986. insert(target, tr, anchor);
  16987. append(tr, td0);
  16988. append(td0, t0);
  16989. append(tr, t1);
  16990. append(tr, td1);
  16991. append(td1, code);
  16992. append(code, t2);
  16993. append(tr, t3);
  16994. },
  16995. p(ctx, dirty) {
  16996. if (dirty & /*headers*/ 1 && t0_value !== (t0_value = /*name*/ ctx[1] + "")) set_data(t0, t0_value);
  16997. if (dirty & /*headers*/ 1 && t2_value !== (t2_value = /*example*/ ctx[2] + "")) set_data(t2, t2_value);
  16998. },
  16999. d(detaching) {
  17000. if (detaching) detach(tr);
  17001. }
  17002. };
  17003. }
  17004. function create_fragment$d(ctx) {
  17005. let if_block_anchor;
  17006. let if_block = /*headers*/ ctx[0].length > 0 && create_if_block$7(ctx);
  17007. return {
  17008. c() {
  17009. if (if_block) if_block.c();
  17010. if_block_anchor = empty();
  17011. },
  17012. m(target, anchor) {
  17013. if (if_block) if_block.m(target, anchor);
  17014. insert(target, if_block_anchor, anchor);
  17015. },
  17016. p(ctx, [dirty]) {
  17017. if (/*headers*/ ctx[0].length > 0) {
  17018. if (if_block) {
  17019. if_block.p(ctx, dirty);
  17020. } else {
  17021. if_block = create_if_block$7(ctx);
  17022. if_block.c();
  17023. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  17024. }
  17025. } else if (if_block) {
  17026. if_block.d(1);
  17027. if_block = null;
  17028. }
  17029. },
  17030. i: noop,
  17031. o: noop,
  17032. d(detaching) {
  17033. if (if_block) if_block.d(detaching);
  17034. if (detaching) detach(if_block_anchor);
  17035. }
  17036. };
  17037. }
  17038. function instance$d($$self, $$props, $$invalidate) {
  17039. let { headers = [] } = $$props;
  17040. $$self.$set = $$props => {
  17041. if ("headers" in $$props) $$invalidate(0, headers = $$props.headers);
  17042. };
  17043. return [headers];
  17044. }
  17045. class HeaderTable extends SvelteComponent {
  17046. constructor(options) {
  17047. super();
  17048. init(this, options, instance$d, create_fragment$d, safe_not_equal, { headers: 0 });
  17049. }
  17050. }
  17051. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CodePanel.svelte generated by Svelte v3.19.2 */
  17052. function add_css$7() {
  17053. var style = element("style");
  17054. style.id = "svelte-15v28ah-style";
  17055. style.textContent = ".tab-content.svelte-15v28ah{display:none}.tab-content.is-active.svelte-15v28ah{display:block}";
  17056. append(document.head, style);
  17057. }
  17058. // (32:0) {#if example || schema}
  17059. function create_if_block$8(ctx) {
  17060. let div2;
  17061. let div0;
  17062. let ul;
  17063. let li;
  17064. let a;
  17065. let t1;
  17066. let t2;
  17067. let div1;
  17068. let section;
  17069. let section_class_value;
  17070. let t3;
  17071. let current;
  17072. let dispose;
  17073. let if_block0 = /*schema*/ ctx[2] && create_if_block_2$3(ctx);
  17074. const codeblock = new CodeBlock({
  17075. props: {
  17076. type: /*contentType*/ ctx[0],
  17077. body: /*example*/ ctx[1]
  17078. }
  17079. });
  17080. let if_block1 = /*schema*/ ctx[2] && create_if_block_1$5(ctx);
  17081. return {
  17082. c() {
  17083. div2 = element("div");
  17084. div0 = element("div");
  17085. ul = element("ul");
  17086. li = element("li");
  17087. a = element("a");
  17088. a.textContent = "Body";
  17089. t1 = space();
  17090. if (if_block0) if_block0.c();
  17091. t2 = space();
  17092. div1 = element("div");
  17093. section = element("section");
  17094. create_component(codeblock.$$.fragment);
  17095. t3 = space();
  17096. if (if_block1) if_block1.c();
  17097. attr(a, "data-index", "0");
  17098. attr(a, "href", "javascript:void(0)");
  17099. toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 0);
  17100. attr(div0, "class", "tabs is-fullwidth");
  17101. toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]);
  17102. attr(section, "class", section_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah");
  17103. attr(div2, "class", "tabs-with-content");
  17104. },
  17105. m(target, anchor) {
  17106. insert(target, div2, anchor);
  17107. append(div2, div0);
  17108. append(div0, ul);
  17109. append(ul, li);
  17110. append(li, a);
  17111. append(ul, t1);
  17112. if (if_block0) if_block0.m(ul, null);
  17113. append(div2, t2);
  17114. append(div2, div1);
  17115. append(div1, section);
  17116. mount_component(codeblock, section, null);
  17117. append(div1, t3);
  17118. if (if_block1) if_block1.m(div1, null);
  17119. current = true;
  17120. dispose = listen(a, "click", /*tabSelect*/ ctx[4]);
  17121. },
  17122. p(ctx, dirty) {
  17123. if (dirty & /*tabIndex*/ 128) {
  17124. toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 0);
  17125. }
  17126. if (/*schema*/ ctx[2]) {
  17127. if (if_block0) {
  17128. if_block0.p(ctx, dirty);
  17129. } else {
  17130. if_block0 = create_if_block_2$3(ctx);
  17131. if_block0.c();
  17132. if_block0.m(ul, null);
  17133. }
  17134. } else if (if_block0) {
  17135. if_block0.d(1);
  17136. if_block0 = null;
  17137. }
  17138. if (dirty & /*asToggle*/ 8) {
  17139. toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]);
  17140. }
  17141. const codeblock_changes = {};
  17142. if (dirty & /*contentType*/ 1) codeblock_changes.type = /*contentType*/ ctx[0];
  17143. if (dirty & /*example*/ 2) codeblock_changes.body = /*example*/ ctx[1];
  17144. codeblock.$set(codeblock_changes);
  17145. if (!current || dirty & /*activeBody*/ 32 && section_class_value !== (section_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah")) {
  17146. attr(section, "class", section_class_value);
  17147. }
  17148. if (/*schema*/ ctx[2]) {
  17149. if (if_block1) {
  17150. if_block1.p(ctx, dirty);
  17151. transition_in(if_block1, 1);
  17152. } else {
  17153. if_block1 = create_if_block_1$5(ctx);
  17154. if_block1.c();
  17155. transition_in(if_block1, 1);
  17156. if_block1.m(div1, null);
  17157. }
  17158. } else if (if_block1) {
  17159. group_outros();
  17160. transition_out(if_block1, 1, 1, () => {
  17161. if_block1 = null;
  17162. });
  17163. check_outros();
  17164. }
  17165. },
  17166. i(local) {
  17167. if (current) return;
  17168. transition_in(codeblock.$$.fragment, local);
  17169. transition_in(if_block1);
  17170. current = true;
  17171. },
  17172. o(local) {
  17173. transition_out(codeblock.$$.fragment, local);
  17174. transition_out(if_block1);
  17175. current = false;
  17176. },
  17177. d(detaching) {
  17178. if (detaching) detach(div2);
  17179. if (if_block0) if_block0.d();
  17180. destroy_component(codeblock);
  17181. if (if_block1) if_block1.d();
  17182. dispose();
  17183. }
  17184. };
  17185. }
  17186. // (42:8) {#if schema}
  17187. function create_if_block_2$3(ctx) {
  17188. let li;
  17189. let a;
  17190. let dispose;
  17191. return {
  17192. c() {
  17193. li = element("li");
  17194. a = element("a");
  17195. a.textContent = "Schema";
  17196. attr(a, "data-index", "1");
  17197. attr(a, "href", "javascript:void(0)");
  17198. toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 1);
  17199. },
  17200. m(target, anchor) {
  17201. insert(target, li, anchor);
  17202. append(li, a);
  17203. dispose = listen(a, "click", /*tabSelect*/ ctx[4]);
  17204. },
  17205. p(ctx, dirty) {
  17206. if (dirty & /*tabIndex*/ 128) {
  17207. toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 1);
  17208. }
  17209. },
  17210. d(detaching) {
  17211. if (detaching) detach(li);
  17212. dispose();
  17213. }
  17214. };
  17215. }
  17216. // (55:6) {#if schema}
  17217. function create_if_block_1$5(ctx) {
  17218. let section;
  17219. let section_class_value;
  17220. let current;
  17221. const codeblock = new CodeBlock({
  17222. props: {
  17223. type: "application/json",
  17224. body: /*schema*/ ctx[2]
  17225. }
  17226. });
  17227. return {
  17228. c() {
  17229. section = element("section");
  17230. create_component(codeblock.$$.fragment);
  17231. attr(section, "class", section_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah");
  17232. },
  17233. m(target, anchor) {
  17234. insert(target, section, anchor);
  17235. mount_component(codeblock, section, null);
  17236. current = true;
  17237. },
  17238. p(ctx, dirty) {
  17239. const codeblock_changes = {};
  17240. if (dirty & /*schema*/ 4) codeblock_changes.body = /*schema*/ ctx[2];
  17241. codeblock.$set(codeblock_changes);
  17242. if (!current || dirty & /*activeSchema*/ 64 && section_class_value !== (section_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah")) {
  17243. attr(section, "class", section_class_value);
  17244. }
  17245. },
  17246. i(local) {
  17247. if (current) return;
  17248. transition_in(codeblock.$$.fragment, local);
  17249. current = true;
  17250. },
  17251. o(local) {
  17252. transition_out(codeblock.$$.fragment, local);
  17253. current = false;
  17254. },
  17255. d(detaching) {
  17256. if (detaching) detach(section);
  17257. destroy_component(codeblock);
  17258. }
  17259. };
  17260. }
  17261. function create_fragment$e(ctx) {
  17262. let if_block_anchor;
  17263. let current;
  17264. let if_block = (/*example*/ ctx[1] || /*schema*/ ctx[2]) && create_if_block$8(ctx);
  17265. return {
  17266. c() {
  17267. if (if_block) if_block.c();
  17268. if_block_anchor = empty();
  17269. },
  17270. m(target, anchor) {
  17271. if (if_block) if_block.m(target, anchor);
  17272. insert(target, if_block_anchor, anchor);
  17273. current = true;
  17274. },
  17275. p(ctx, [dirty]) {
  17276. if (/*example*/ ctx[1] || /*schema*/ ctx[2]) {
  17277. if (if_block) {
  17278. if_block.p(ctx, dirty);
  17279. transition_in(if_block, 1);
  17280. } else {
  17281. if_block = create_if_block$8(ctx);
  17282. if_block.c();
  17283. transition_in(if_block, 1);
  17284. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  17285. }
  17286. } else if (if_block) {
  17287. group_outros();
  17288. transition_out(if_block, 1, 1, () => {
  17289. if_block = null;
  17290. });
  17291. check_outros();
  17292. }
  17293. },
  17294. i(local) {
  17295. if (current) return;
  17296. transition_in(if_block);
  17297. current = true;
  17298. },
  17299. o(local) {
  17300. transition_out(if_block);
  17301. current = false;
  17302. },
  17303. d(detaching) {
  17304. if (if_block) if_block.d(detaching);
  17305. if (detaching) detach(if_block_anchor);
  17306. }
  17307. };
  17308. }
  17309. function instance$e($$self, $$props, $$invalidate) {
  17310. let { contentType } = $$props;
  17311. let { example } = $$props;
  17312. let { schema } = $$props;
  17313. let { asToggle } = $$props;
  17314. let activeBody = "is-active";
  17315. let activeSchema = "";
  17316. let tabIndex = 0;
  17317. const tabSelect = event => {
  17318. const index = event.target.dataset["index"];
  17319. $$invalidate(7, tabIndex = parseInt(index, 10));
  17320. };
  17321. $$self.$set = $$props => {
  17322. if ("contentType" in $$props) $$invalidate(0, contentType = $$props.contentType);
  17323. if ("example" in $$props) $$invalidate(1, example = $$props.example);
  17324. if ("schema" in $$props) $$invalidate(2, schema = $$props.schema);
  17325. if ("asToggle" in $$props) $$invalidate(3, asToggle = $$props.asToggle);
  17326. };
  17327. $$self.$$.update = () => {
  17328. if ($$self.$$.dirty & /*tabIndex*/ 128) {
  17329. $$invalidate(5, activeBody = tabIndex === 0 ? "is-active" : "");
  17330. }
  17331. if ($$self.$$.dirty & /*tabIndex*/ 128) {
  17332. $$invalidate(6, activeSchema = tabIndex === 1 ? "is-active" : "");
  17333. }
  17334. };
  17335. return [
  17336. contentType,
  17337. example,
  17338. schema,
  17339. asToggle,
  17340. tabSelect,
  17341. activeBody,
  17342. activeSchema,
  17343. tabIndex
  17344. ];
  17345. }
  17346. class CodePanel extends SvelteComponent {
  17347. constructor(options) {
  17348. super();
  17349. if (!document.getElementById("svelte-15v28ah-style")) add_css$7();
  17350. init(this, options, instance$e, create_fragment$e, safe_not_equal, {
  17351. contentType: 0,
  17352. example: 1,
  17353. schema: 2,
  17354. asToggle: 3,
  17355. tabSelect: 4
  17356. });
  17357. }
  17358. get tabSelect() {
  17359. return this.$$.ctx[4];
  17360. }
  17361. }
  17362. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/RequestPanel.svelte generated by Svelte v3.19.2 */
  17363. function create_if_block_1$6(ctx) {
  17364. let div;
  17365. let raw_value = markdown(/*description*/ ctx[0]) + "";
  17366. return {
  17367. c() {
  17368. div = element("div");
  17369. attr(div, "class", "content");
  17370. },
  17371. m(target, anchor) {
  17372. insert(target, div, anchor);
  17373. div.innerHTML = raw_value;
  17374. },
  17375. p(ctx, dirty) {
  17376. if (dirty & /*description*/ 1 && raw_value !== (raw_value = markdown(/*description*/ ctx[0]) + "")) div.innerHTML = raw_value;;
  17377. },
  17378. d(detaching) {
  17379. if (detaching) detach(div);
  17380. }
  17381. };
  17382. }
  17383. // (26:0) {#if showRequest}
  17384. function create_if_block$9(ctx) {
  17385. let hr;
  17386. return {
  17387. c() {
  17388. hr = element("hr");
  17389. },
  17390. m(target, anchor) {
  17391. insert(target, hr, anchor);
  17392. },
  17393. d(detaching) {
  17394. if (detaching) detach(hr);
  17395. }
  17396. };
  17397. }
  17398. function create_fragment$f(ctx) {
  17399. let t0;
  17400. let t1;
  17401. let t2;
  17402. let if_block1_anchor;
  17403. let current;
  17404. let if_block0 = /*description*/ ctx[0] && create_if_block_1$6(ctx);
  17405. const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[1] } });
  17406. const codepanel = new CodePanel({
  17407. props: {
  17408. contentType: /*contentType*/ ctx[2],
  17409. example: /*example*/ ctx[3],
  17410. schema: /*schema*/ ctx[4],
  17411. asToggle: true
  17412. }
  17413. });
  17414. let if_block1 = /*showRequest*/ ctx[5] && create_if_block$9(ctx);
  17415. return {
  17416. c() {
  17417. if (if_block0) if_block0.c();
  17418. t0 = space();
  17419. create_component(headertable.$$.fragment);
  17420. t1 = space();
  17421. create_component(codepanel.$$.fragment);
  17422. t2 = space();
  17423. if (if_block1) if_block1.c();
  17424. if_block1_anchor = empty();
  17425. },
  17426. m(target, anchor) {
  17427. if (if_block0) if_block0.m(target, anchor);
  17428. insert(target, t0, anchor);
  17429. mount_component(headertable, target, anchor);
  17430. insert(target, t1, anchor);
  17431. mount_component(codepanel, target, anchor);
  17432. insert(target, t2, anchor);
  17433. if (if_block1) if_block1.m(target, anchor);
  17434. insert(target, if_block1_anchor, anchor);
  17435. current = true;
  17436. },
  17437. p(ctx, [dirty]) {
  17438. if (/*description*/ ctx[0]) {
  17439. if (if_block0) {
  17440. if_block0.p(ctx, dirty);
  17441. } else {
  17442. if_block0 = create_if_block_1$6(ctx);
  17443. if_block0.c();
  17444. if_block0.m(t0.parentNode, t0);
  17445. }
  17446. } else if (if_block0) {
  17447. if_block0.d(1);
  17448. if_block0 = null;
  17449. }
  17450. const headertable_changes = {};
  17451. if (dirty & /*headers*/ 2) headertable_changes.headers = /*headers*/ ctx[1];
  17452. headertable.$set(headertable_changes);
  17453. const codepanel_changes = {};
  17454. if (dirty & /*contentType*/ 4) codepanel_changes.contentType = /*contentType*/ ctx[2];
  17455. if (dirty & /*example*/ 8) codepanel_changes.example = /*example*/ ctx[3];
  17456. if (dirty & /*schema*/ 16) codepanel_changes.schema = /*schema*/ ctx[4];
  17457. codepanel.$set(codepanel_changes);
  17458. if (/*showRequest*/ ctx[5]) {
  17459. if (!if_block1) {
  17460. if_block1 = create_if_block$9(ctx);
  17461. if_block1.c();
  17462. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  17463. } else {
  17464. }
  17465. } else if (if_block1) {
  17466. if_block1.d(1);
  17467. if_block1 = null;
  17468. }
  17469. },
  17470. i(local) {
  17471. if (current) return;
  17472. transition_in(headertable.$$.fragment, local);
  17473. transition_in(codepanel.$$.fragment, local);
  17474. current = true;
  17475. },
  17476. o(local) {
  17477. transition_out(headertable.$$.fragment, local);
  17478. transition_out(codepanel.$$.fragment, local);
  17479. current = false;
  17480. },
  17481. d(detaching) {
  17482. if (if_block0) if_block0.d(detaching);
  17483. if (detaching) detach(t0);
  17484. destroy_component(headertable, detaching);
  17485. if (detaching) detach(t1);
  17486. destroy_component(codepanel, detaching);
  17487. if (detaching) detach(t2);
  17488. if (if_block1) if_block1.d(detaching);
  17489. if (detaching) detach(if_block1_anchor);
  17490. }
  17491. };
  17492. }
  17493. function instance$f($$self, $$props, $$invalidate) {
  17494. let { description } = $$props;
  17495. let { headers } = $$props;
  17496. let { contentType } = $$props;
  17497. let { example } = $$props;
  17498. let { schema } = $$props;
  17499. $$self.$set = $$props => {
  17500. if ("description" in $$props) $$invalidate(0, description = $$props.description);
  17501. if ("headers" in $$props) $$invalidate(1, headers = $$props.headers);
  17502. if ("contentType" in $$props) $$invalidate(2, contentType = $$props.contentType);
  17503. if ("example" in $$props) $$invalidate(3, example = $$props.example);
  17504. if ("schema" in $$props) $$invalidate(4, schema = $$props.schema);
  17505. };
  17506. let showRequest;
  17507. $$self.$$.update = () => {
  17508. if ($$self.$$.dirty & /*description, headers, example*/ 11) {
  17509. $$invalidate(5, showRequest = !!(description || headers.length !== 0 || example));
  17510. }
  17511. };
  17512. return [description, headers, contentType, example, schema, showRequest];
  17513. }
  17514. class RequestPanel extends SvelteComponent {
  17515. constructor(options) {
  17516. super();
  17517. init(this, options, instance$f, create_fragment$f, safe_not_equal, {
  17518. description: 0,
  17519. headers: 1,
  17520. contentType: 2,
  17521. example: 3,
  17522. schema: 4
  17523. });
  17524. }
  17525. }
  17526. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ResponsePanel.svelte generated by Svelte v3.19.2 */
  17527. function create_else_block$4(ctx) {
  17528. let t_value = (/*contentType*/ ctx[4] || "Response") + "";
  17529. let t;
  17530. return {
  17531. c() {
  17532. t = text(t_value);
  17533. },
  17534. m(target, anchor) {
  17535. insert(target, t, anchor);
  17536. },
  17537. p(ctx, dirty) {
  17538. if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "Response") + "")) set_data(t, t_value);
  17539. },
  17540. d(detaching) {
  17541. if (detaching) detach(t);
  17542. }
  17543. };
  17544. }
  17545. // (19:6) {#if title}
  17546. function create_if_block_2$4(ctx) {
  17547. let t0;
  17548. let t1;
  17549. return {
  17550. c() {
  17551. t0 = text("Response ");
  17552. t1 = text(/*title*/ ctx[0]);
  17553. },
  17554. m(target, anchor) {
  17555. insert(target, t0, anchor);
  17556. insert(target, t1, anchor);
  17557. },
  17558. p(ctx, dirty) {
  17559. if (dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]);
  17560. },
  17561. d(detaching) {
  17562. if (detaching) detach(t0);
  17563. if (detaching) detach(t1);
  17564. }
  17565. };
  17566. }
  17567. // (23:6) {#if title !== ''}
  17568. function create_if_block_1$7(ctx) {
  17569. let span;
  17570. let t_value = (/*contentType*/ ctx[4] || "") + "";
  17571. let t;
  17572. return {
  17573. c() {
  17574. span = element("span");
  17575. t = text(t_value);
  17576. attr(span, "class", "tag is-medium is-white");
  17577. },
  17578. m(target, anchor) {
  17579. insert(target, span, anchor);
  17580. append(span, t);
  17581. },
  17582. p(ctx, dirty) {
  17583. if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "") + "")) set_data(t, t_value);
  17584. },
  17585. d(detaching) {
  17586. if (detaching) detach(span);
  17587. }
  17588. };
  17589. }
  17590. // (30:4) {#if description}
  17591. function create_if_block$a(ctx) {
  17592. let div;
  17593. let raw_value = markdown(/*description*/ ctx[1]) + "";
  17594. return {
  17595. c() {
  17596. div = element("div");
  17597. attr(div, "class", "content");
  17598. },
  17599. m(target, anchor) {
  17600. insert(target, div, anchor);
  17601. div.innerHTML = raw_value;
  17602. },
  17603. p(ctx, dirty) {
  17604. if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;;
  17605. },
  17606. d(detaching) {
  17607. if (detaching) detach(div);
  17608. }
  17609. };
  17610. }
  17611. function create_fragment$g(ctx) {
  17612. let div1;
  17613. let header;
  17614. let p;
  17615. let t0;
  17616. let a;
  17617. let t1;
  17618. let code;
  17619. let t2;
  17620. let code_class_value;
  17621. let t3;
  17622. let div0;
  17623. let t4;
  17624. let t5;
  17625. let current;
  17626. function select_block_type(ctx, dirty) {
  17627. if (/*title*/ ctx[0]) return create_if_block_2$4;
  17628. return create_else_block$4;
  17629. }
  17630. let current_block_type = select_block_type(ctx, -1);
  17631. let if_block0 = current_block_type(ctx);
  17632. let if_block1 = /*title*/ ctx[0] !== "" && create_if_block_1$7(ctx);
  17633. let if_block2 = /*description*/ ctx[1] && create_if_block$a(ctx);
  17634. const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[2] } });
  17635. const codepanel = new CodePanel({
  17636. props: {
  17637. contentType: /*contentType*/ ctx[4],
  17638. example: /*example*/ ctx[5],
  17639. schema: /*schema*/ ctx[6]
  17640. }
  17641. });
  17642. return {
  17643. c() {
  17644. div1 = element("div");
  17645. header = element("header");
  17646. p = element("p");
  17647. if_block0.c();
  17648. t0 = space();
  17649. a = element("a");
  17650. if (if_block1) if_block1.c();
  17651. t1 = space();
  17652. code = element("code");
  17653. t2 = text(/*statusCode*/ ctx[3]);
  17654. t3 = space();
  17655. div0 = element("div");
  17656. if (if_block2) if_block2.c();
  17657. t4 = space();
  17658. create_component(headertable.$$.fragment);
  17659. t5 = space();
  17660. create_component(codepanel.$$.fragment);
  17661. attr(p, "class", "card-header-title");
  17662. attr(code, "class", code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3]));
  17663. attr(a, "href", "javascript:void(0)");
  17664. attr(a, "class", "card-header-icon is-family-code");
  17665. attr(header, "class", "card-header");
  17666. attr(div0, "class", "card-content");
  17667. attr(div1, "class", "card");
  17668. },
  17669. m(target, anchor) {
  17670. insert(target, div1, anchor);
  17671. append(div1, header);
  17672. append(header, p);
  17673. if_block0.m(p, null);
  17674. append(header, t0);
  17675. append(header, a);
  17676. if (if_block1) if_block1.m(a, null);
  17677. append(a, t1);
  17678. append(a, code);
  17679. append(code, t2);
  17680. append(div1, t3);
  17681. append(div1, div0);
  17682. if (if_block2) if_block2.m(div0, null);
  17683. append(div0, t4);
  17684. mount_component(headertable, div0, null);
  17685. append(div0, t5);
  17686. mount_component(codepanel, div0, null);
  17687. current = true;
  17688. },
  17689. p(ctx, [dirty]) {
  17690. if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) {
  17691. if_block0.p(ctx, dirty);
  17692. } else {
  17693. if_block0.d(1);
  17694. if_block0 = current_block_type(ctx);
  17695. if (if_block0) {
  17696. if_block0.c();
  17697. if_block0.m(p, null);
  17698. }
  17699. }
  17700. if (/*title*/ ctx[0] !== "") {
  17701. if (if_block1) {
  17702. if_block1.p(ctx, dirty);
  17703. } else {
  17704. if_block1 = create_if_block_1$7(ctx);
  17705. if_block1.c();
  17706. if_block1.m(a, t1);
  17707. }
  17708. } else if (if_block1) {
  17709. if_block1.d(1);
  17710. if_block1 = null;
  17711. }
  17712. if (!current || dirty & /*statusCode*/ 8) set_data(t2, /*statusCode*/ ctx[3]);
  17713. if (!current || dirty & /*statusCode*/ 8 && code_class_value !== (code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3]))) {
  17714. attr(code, "class", code_class_value);
  17715. }
  17716. if (/*description*/ ctx[1]) {
  17717. if (if_block2) {
  17718. if_block2.p(ctx, dirty);
  17719. } else {
  17720. if_block2 = create_if_block$a(ctx);
  17721. if_block2.c();
  17722. if_block2.m(div0, t4);
  17723. }
  17724. } else if (if_block2) {
  17725. if_block2.d(1);
  17726. if_block2 = null;
  17727. }
  17728. const headertable_changes = {};
  17729. if (dirty & /*headers*/ 4) headertable_changes.headers = /*headers*/ ctx[2];
  17730. headertable.$set(headertable_changes);
  17731. const codepanel_changes = {};
  17732. if (dirty & /*contentType*/ 16) codepanel_changes.contentType = /*contentType*/ ctx[4];
  17733. if (dirty & /*example*/ 32) codepanel_changes.example = /*example*/ ctx[5];
  17734. if (dirty & /*schema*/ 64) codepanel_changes.schema = /*schema*/ ctx[6];
  17735. codepanel.$set(codepanel_changes);
  17736. },
  17737. i(local) {
  17738. if (current) return;
  17739. transition_in(headertable.$$.fragment, local);
  17740. transition_in(codepanel.$$.fragment, local);
  17741. current = true;
  17742. },
  17743. o(local) {
  17744. transition_out(headertable.$$.fragment, local);
  17745. transition_out(codepanel.$$.fragment, local);
  17746. current = false;
  17747. },
  17748. d(detaching) {
  17749. if (detaching) detach(div1);
  17750. if_block0.d();
  17751. if (if_block1) if_block1.d();
  17752. if (if_block2) if_block2.d();
  17753. destroy_component(headertable);
  17754. destroy_component(codepanel);
  17755. }
  17756. };
  17757. }
  17758. function instance$g($$self, $$props, $$invalidate) {
  17759. let { title } = $$props;
  17760. let { description } = $$props;
  17761. let { headers } = $$props;
  17762. let { statusCode } = $$props;
  17763. let { contentType } = $$props;
  17764. let { example } = $$props;
  17765. let { schema } = $$props;
  17766. $$self.$set = $$props => {
  17767. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  17768. if ("description" in $$props) $$invalidate(1, description = $$props.description);
  17769. if ("headers" in $$props) $$invalidate(2, headers = $$props.headers);
  17770. if ("statusCode" in $$props) $$invalidate(3, statusCode = $$props.statusCode);
  17771. if ("contentType" in $$props) $$invalidate(4, contentType = $$props.contentType);
  17772. if ("example" in $$props) $$invalidate(5, example = $$props.example);
  17773. if ("schema" in $$props) $$invalidate(6, schema = $$props.schema);
  17774. };
  17775. return [title, description, headers, statusCode, contentType, example, schema];
  17776. }
  17777. class ResponsePanel extends SvelteComponent {
  17778. constructor(options) {
  17779. super();
  17780. init(this, options, instance$g, create_fragment$g, safe_not_equal, {
  17781. title: 0,
  17782. description: 1,
  17783. headers: 2,
  17784. statusCode: 3,
  17785. contentType: 4,
  17786. example: 5,
  17787. schema: 6
  17788. });
  17789. }
  17790. }
  17791. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ScenarioPanel.svelte generated by Svelte v3.19.2 */
  17792. function get_each_context_1$1(ctx, list, i) {
  17793. const child_ctx = ctx.slice();
  17794. child_ctx[7] = list[i];
  17795. child_ctx[4] = i;
  17796. return child_ctx;
  17797. }
  17798. function get_each_context$3(ctx, list, i) {
  17799. const child_ctx = ctx.slice();
  17800. child_ctx[7] = list[i];
  17801. child_ctx[4] = i;
  17802. return child_ctx;
  17803. }
  17804. // (50:0) {:else}
  17805. function create_else_block$5(ctx) {
  17806. let current;
  17807. const collapsiblepanel = new CollapsiblePanel({
  17808. props: {
  17809. isDarkmode: /*isDarkmode*/ ctx[3],
  17810. show: /*show*/ ctx[0],
  17811. $$slots: {
  17812. default: [create_default_slot$1],
  17813. body: [create_body_slot$1],
  17814. heading: [create_heading_slot$1]
  17815. },
  17816. $$scope: { ctx }
  17817. }
  17818. });
  17819. return {
  17820. c() {
  17821. create_component(collapsiblepanel.$$.fragment);
  17822. },
  17823. m(target, anchor) {
  17824. mount_component(collapsiblepanel, target, anchor);
  17825. current = true;
  17826. },
  17827. p(ctx, dirty) {
  17828. const collapsiblepanel_changes = {};
  17829. if (dirty & /*isDarkmode*/ 8) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[3];
  17830. if (dirty & /*show*/ 1) collapsiblepanel_changes.show = /*show*/ ctx[0];
  17831. if (dirty & /*$$scope, responses, request, index*/ 1046) {
  17832. collapsiblepanel_changes.$$scope = { dirty, ctx };
  17833. }
  17834. collapsiblepanel.$set(collapsiblepanel_changes);
  17835. },
  17836. i(local) {
  17837. if (current) return;
  17838. transition_in(collapsiblepanel.$$.fragment, local);
  17839. current = true;
  17840. },
  17841. o(local) {
  17842. transition_out(collapsiblepanel.$$.fragment, local);
  17843. current = false;
  17844. },
  17845. d(detaching) {
  17846. destroy_component(collapsiblepanel, detaching);
  17847. }
  17848. };
  17849. }
  17850. // (30:0) {#if request.title === ''}
  17851. function create_if_block$b(ctx) {
  17852. let t0;
  17853. let t1;
  17854. let div;
  17855. let current;
  17856. let if_block = /*show*/ ctx[0] && create_if_block_1$8(ctx);
  17857. let each_value = /*responses*/ ctx[2];
  17858. let each_blocks = [];
  17859. for (let i = 0; i < each_value.length; i += 1) {
  17860. each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
  17861. }
  17862. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  17863. each_blocks[i] = null;
  17864. });
  17865. return {
  17866. c() {
  17867. if (if_block) if_block.c();
  17868. t0 = space();
  17869. for (let i = 0; i < each_blocks.length; i += 1) {
  17870. each_blocks[i].c();
  17871. }
  17872. t1 = space();
  17873. div = element("div");
  17874. attr(div, "class", "panel");
  17875. },
  17876. m(target, anchor) {
  17877. if (if_block) if_block.m(target, anchor);
  17878. insert(target, t0, anchor);
  17879. for (let i = 0; i < each_blocks.length; i += 1) {
  17880. each_blocks[i].m(target, anchor);
  17881. }
  17882. insert(target, t1, anchor);
  17883. insert(target, div, anchor);
  17884. current = true;
  17885. },
  17886. p(ctx, dirty) {
  17887. if (/*show*/ ctx[0]) {
  17888. if (if_block) {
  17889. if_block.p(ctx, dirty);
  17890. transition_in(if_block, 1);
  17891. } else {
  17892. if_block = create_if_block_1$8(ctx);
  17893. if_block.c();
  17894. transition_in(if_block, 1);
  17895. if_block.m(t0.parentNode, t0);
  17896. }
  17897. } else if (if_block) {
  17898. group_outros();
  17899. transition_out(if_block, 1, 1, () => {
  17900. if_block = null;
  17901. });
  17902. check_outros();
  17903. }
  17904. if (dirty & /*responses*/ 4) {
  17905. each_value = /*responses*/ ctx[2];
  17906. let i;
  17907. for (i = 0; i < each_value.length; i += 1) {
  17908. const child_ctx = get_each_context$3(ctx, each_value, i);
  17909. if (each_blocks[i]) {
  17910. each_blocks[i].p(child_ctx, dirty);
  17911. transition_in(each_blocks[i], 1);
  17912. } else {
  17913. each_blocks[i] = create_each_block$3(child_ctx);
  17914. each_blocks[i].c();
  17915. transition_in(each_blocks[i], 1);
  17916. each_blocks[i].m(t1.parentNode, t1);
  17917. }
  17918. }
  17919. group_outros();
  17920. for (i = each_value.length; i < each_blocks.length; i += 1) {
  17921. out(i);
  17922. }
  17923. check_outros();
  17924. }
  17925. },
  17926. i(local) {
  17927. if (current) return;
  17928. transition_in(if_block);
  17929. for (let i = 0; i < each_value.length; i += 1) {
  17930. transition_in(each_blocks[i]);
  17931. }
  17932. current = true;
  17933. },
  17934. o(local) {
  17935. transition_out(if_block);
  17936. each_blocks = each_blocks.filter(Boolean);
  17937. for (let i = 0; i < each_blocks.length; i += 1) {
  17938. transition_out(each_blocks[i]);
  17939. }
  17940. current = false;
  17941. },
  17942. d(detaching) {
  17943. if (if_block) if_block.d(detaching);
  17944. if (detaching) detach(t0);
  17945. destroy_each(each_blocks, detaching);
  17946. if (detaching) detach(t1);
  17947. if (detaching) detach(div);
  17948. }
  17949. };
  17950. }
  17951. // (52:4) <span slot="heading">
  17952. function create_heading_slot$1(ctx) {
  17953. let span;
  17954. let t_value = /*title*/ ctx[5](/*index*/ ctx[4]) + "";
  17955. let t;
  17956. return {
  17957. c() {
  17958. span = element("span");
  17959. t = text(t_value);
  17960. attr(span, "slot", "heading");
  17961. },
  17962. m(target, anchor) {
  17963. insert(target, span, anchor);
  17964. append(span, t);
  17965. },
  17966. p(ctx, dirty) {
  17967. if (dirty & /*index*/ 16 && t_value !== (t_value = /*title*/ ctx[5](/*index*/ ctx[4]) + "")) set_data(t, t_value);
  17968. },
  17969. d(detaching) {
  17970. if (detaching) detach(span);
  17971. }
  17972. };
  17973. }
  17974. // (61:6) {#each responses as response, index}
  17975. function create_each_block_1$1(ctx) {
  17976. let current;
  17977. const responsepanel = new ResponsePanel({
  17978. props: {
  17979. title: /*response*/ ctx[7].title,
  17980. description: /*response*/ ctx[7].description,
  17981. statusCode: /*response*/ ctx[7].statusCode,
  17982. headers: /*response*/ ctx[7].headers,
  17983. contentType: /*response*/ ctx[7].contentType,
  17984. example: /*response*/ ctx[7].example,
  17985. schema: /*response*/ ctx[7].schema
  17986. }
  17987. });
  17988. return {
  17989. c() {
  17990. create_component(responsepanel.$$.fragment);
  17991. },
  17992. m(target, anchor) {
  17993. mount_component(responsepanel, target, anchor);
  17994. current = true;
  17995. },
  17996. p(ctx, dirty) {
  17997. const responsepanel_changes = {};
  17998. if (dirty & /*responses*/ 4) responsepanel_changes.title = /*response*/ ctx[7].title;
  17999. if (dirty & /*responses*/ 4) responsepanel_changes.description = /*response*/ ctx[7].description;
  18000. if (dirty & /*responses*/ 4) responsepanel_changes.statusCode = /*response*/ ctx[7].statusCode;
  18001. if (dirty & /*responses*/ 4) responsepanel_changes.headers = /*response*/ ctx[7].headers;
  18002. if (dirty & /*responses*/ 4) responsepanel_changes.contentType = /*response*/ ctx[7].contentType;
  18003. if (dirty & /*responses*/ 4) responsepanel_changes.example = /*response*/ ctx[7].example;
  18004. if (dirty & /*responses*/ 4) responsepanel_changes.schema = /*response*/ ctx[7].schema;
  18005. responsepanel.$set(responsepanel_changes);
  18006. },
  18007. i(local) {
  18008. if (current) return;
  18009. transition_in(responsepanel.$$.fragment, local);
  18010. current = true;
  18011. },
  18012. o(local) {
  18013. transition_out(responsepanel.$$.fragment, local);
  18014. current = false;
  18015. },
  18016. d(detaching) {
  18017. destroy_component(responsepanel, detaching);
  18018. }
  18019. };
  18020. }
  18021. // (53:4) <div slot="body">
  18022. function create_body_slot$1(ctx) {
  18023. let div;
  18024. let t;
  18025. let current;
  18026. const requestpanel = new RequestPanel({
  18027. props: {
  18028. description: /*request*/ ctx[1].description,
  18029. headers: /*request*/ ctx[1].headers,
  18030. contentType: /*request*/ ctx[1].contentType,
  18031. example: /*request*/ ctx[1].example,
  18032. schema: /*request*/ ctx[1].schema
  18033. }
  18034. });
  18035. let each_value_1 = /*responses*/ ctx[2];
  18036. let each_blocks = [];
  18037. for (let i = 0; i < each_value_1.length; i += 1) {
  18038. each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i));
  18039. }
  18040. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  18041. each_blocks[i] = null;
  18042. });
  18043. return {
  18044. c() {
  18045. div = element("div");
  18046. create_component(requestpanel.$$.fragment);
  18047. t = space();
  18048. for (let i = 0; i < each_blocks.length; i += 1) {
  18049. each_blocks[i].c();
  18050. }
  18051. attr(div, "slot", "body");
  18052. },
  18053. m(target, anchor) {
  18054. insert(target, div, anchor);
  18055. mount_component(requestpanel, div, null);
  18056. append(div, t);
  18057. for (let i = 0; i < each_blocks.length; i += 1) {
  18058. each_blocks[i].m(div, null);
  18059. }
  18060. current = true;
  18061. },
  18062. p(ctx, dirty) {
  18063. const requestpanel_changes = {};
  18064. if (dirty & /*request*/ 2) requestpanel_changes.description = /*request*/ ctx[1].description;
  18065. if (dirty & /*request*/ 2) requestpanel_changes.headers = /*request*/ ctx[1].headers;
  18066. if (dirty & /*request*/ 2) requestpanel_changes.contentType = /*request*/ ctx[1].contentType;
  18067. if (dirty & /*request*/ 2) requestpanel_changes.example = /*request*/ ctx[1].example;
  18068. if (dirty & /*request*/ 2) requestpanel_changes.schema = /*request*/ ctx[1].schema;
  18069. requestpanel.$set(requestpanel_changes);
  18070. if (dirty & /*responses*/ 4) {
  18071. each_value_1 = /*responses*/ ctx[2];
  18072. let i;
  18073. for (i = 0; i < each_value_1.length; i += 1) {
  18074. const child_ctx = get_each_context_1$1(ctx, each_value_1, i);
  18075. if (each_blocks[i]) {
  18076. each_blocks[i].p(child_ctx, dirty);
  18077. transition_in(each_blocks[i], 1);
  18078. } else {
  18079. each_blocks[i] = create_each_block_1$1(child_ctx);
  18080. each_blocks[i].c();
  18081. transition_in(each_blocks[i], 1);
  18082. each_blocks[i].m(div, null);
  18083. }
  18084. }
  18085. group_outros();
  18086. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  18087. out(i);
  18088. }
  18089. check_outros();
  18090. }
  18091. },
  18092. i(local) {
  18093. if (current) return;
  18094. transition_in(requestpanel.$$.fragment, local);
  18095. for (let i = 0; i < each_value_1.length; i += 1) {
  18096. transition_in(each_blocks[i]);
  18097. }
  18098. current = true;
  18099. },
  18100. o(local) {
  18101. transition_out(requestpanel.$$.fragment, local);
  18102. each_blocks = each_blocks.filter(Boolean);
  18103. for (let i = 0; i < each_blocks.length; i += 1) {
  18104. transition_out(each_blocks[i]);
  18105. }
  18106. current = false;
  18107. },
  18108. d(detaching) {
  18109. if (detaching) detach(div);
  18110. destroy_component(requestpanel);
  18111. destroy_each(each_blocks, detaching);
  18112. }
  18113. };
  18114. }
  18115. // (51:2) <CollapsiblePanel {isDarkmode} {show}>
  18116. function create_default_slot$1(ctx) {
  18117. let t;
  18118. let current;
  18119. return {
  18120. c() {
  18121. t = space();
  18122. },
  18123. m(target, anchor) {
  18124. insert(target, t, anchor);
  18125. },
  18126. p: noop,
  18127. i: noop,
  18128. o: noop,
  18129. d(detaching) {
  18130. if (detaching) detach(t);
  18131. }
  18132. };
  18133. }
  18134. // (31:2) {#if show}
  18135. function create_if_block_1$8(ctx) {
  18136. let current;
  18137. const requestpanel = new RequestPanel({
  18138. props: {
  18139. description: /*request*/ ctx[1].description,
  18140. headers: /*request*/ ctx[1].headers,
  18141. contentType: /*request*/ ctx[1].contentType,
  18142. example: /*request*/ ctx[1].example,
  18143. schema: /*request*/ ctx[1].schema
  18144. }
  18145. });
  18146. return {
  18147. c() {
  18148. create_component(requestpanel.$$.fragment);
  18149. },
  18150. m(target, anchor) {
  18151. mount_component(requestpanel, target, anchor);
  18152. current = true;
  18153. },
  18154. p(ctx, dirty) {
  18155. const requestpanel_changes = {};
  18156. if (dirty & /*request*/ 2) requestpanel_changes.description = /*request*/ ctx[1].description;
  18157. if (dirty & /*request*/ 2) requestpanel_changes.headers = /*request*/ ctx[1].headers;
  18158. if (dirty & /*request*/ 2) requestpanel_changes.contentType = /*request*/ ctx[1].contentType;
  18159. if (dirty & /*request*/ 2) requestpanel_changes.example = /*request*/ ctx[1].example;
  18160. if (dirty & /*request*/ 2) requestpanel_changes.schema = /*request*/ ctx[1].schema;
  18161. requestpanel.$set(requestpanel_changes);
  18162. },
  18163. i(local) {
  18164. if (current) return;
  18165. transition_in(requestpanel.$$.fragment, local);
  18166. current = true;
  18167. },
  18168. o(local) {
  18169. transition_out(requestpanel.$$.fragment, local);
  18170. current = false;
  18171. },
  18172. d(detaching) {
  18173. destroy_component(requestpanel, detaching);
  18174. }
  18175. };
  18176. }
  18177. // (39:2) {#each responses as response, index}
  18178. function create_each_block$3(ctx) {
  18179. let current;
  18180. const responsepanel = new ResponsePanel({
  18181. props: {
  18182. title: /*response*/ ctx[7].title,
  18183. description: /*response*/ ctx[7].description,
  18184. statusCode: /*response*/ ctx[7].statusCode,
  18185. headers: /*response*/ ctx[7].headers,
  18186. contentType: /*response*/ ctx[7].contentType,
  18187. example: /*response*/ ctx[7].example,
  18188. schema: /*response*/ ctx[7].schema
  18189. }
  18190. });
  18191. return {
  18192. c() {
  18193. create_component(responsepanel.$$.fragment);
  18194. },
  18195. m(target, anchor) {
  18196. mount_component(responsepanel, target, anchor);
  18197. current = true;
  18198. },
  18199. p(ctx, dirty) {
  18200. const responsepanel_changes = {};
  18201. if (dirty & /*responses*/ 4) responsepanel_changes.title = /*response*/ ctx[7].title;
  18202. if (dirty & /*responses*/ 4) responsepanel_changes.description = /*response*/ ctx[7].description;
  18203. if (dirty & /*responses*/ 4) responsepanel_changes.statusCode = /*response*/ ctx[7].statusCode;
  18204. if (dirty & /*responses*/ 4) responsepanel_changes.headers = /*response*/ ctx[7].headers;
  18205. if (dirty & /*responses*/ 4) responsepanel_changes.contentType = /*response*/ ctx[7].contentType;
  18206. if (dirty & /*responses*/ 4) responsepanel_changes.example = /*response*/ ctx[7].example;
  18207. if (dirty & /*responses*/ 4) responsepanel_changes.schema = /*response*/ ctx[7].schema;
  18208. responsepanel.$set(responsepanel_changes);
  18209. },
  18210. i(local) {
  18211. if (current) return;
  18212. transition_in(responsepanel.$$.fragment, local);
  18213. current = true;
  18214. },
  18215. o(local) {
  18216. transition_out(responsepanel.$$.fragment, local);
  18217. current = false;
  18218. },
  18219. d(detaching) {
  18220. destroy_component(responsepanel, detaching);
  18221. }
  18222. };
  18223. }
  18224. function create_fragment$h(ctx) {
  18225. let current_block_type_index;
  18226. let if_block;
  18227. let if_block_anchor;
  18228. let current;
  18229. const if_block_creators = [create_if_block$b, create_else_block$5];
  18230. const if_blocks = [];
  18231. function select_block_type(ctx, dirty) {
  18232. if (/*request*/ ctx[1].title === "") return 0;
  18233. return 1;
  18234. }
  18235. current_block_type_index = select_block_type(ctx, -1);
  18236. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  18237. return {
  18238. c() {
  18239. if_block.c();
  18240. if_block_anchor = empty();
  18241. },
  18242. m(target, anchor) {
  18243. if_blocks[current_block_type_index].m(target, anchor);
  18244. insert(target, if_block_anchor, anchor);
  18245. current = true;
  18246. },
  18247. p(ctx, [dirty]) {
  18248. let previous_block_index = current_block_type_index;
  18249. current_block_type_index = select_block_type(ctx, dirty);
  18250. if (current_block_type_index === previous_block_index) {
  18251. if_blocks[current_block_type_index].p(ctx, dirty);
  18252. } else {
  18253. group_outros();
  18254. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  18255. if_blocks[previous_block_index] = null;
  18256. });
  18257. check_outros();
  18258. if_block = if_blocks[current_block_type_index];
  18259. if (!if_block) {
  18260. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  18261. if_block.c();
  18262. }
  18263. transition_in(if_block, 1);
  18264. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  18265. }
  18266. },
  18267. i(local) {
  18268. if (current) return;
  18269. transition_in(if_block);
  18270. current = true;
  18271. },
  18272. o(local) {
  18273. transition_out(if_block);
  18274. current = false;
  18275. },
  18276. d(detaching) {
  18277. if_blocks[current_block_type_index].d(detaching);
  18278. if (detaching) detach(if_block_anchor);
  18279. }
  18280. };
  18281. }
  18282. function instance$h($$self, $$props, $$invalidate) {
  18283. let { show } = $$props;
  18284. let { count } = $$props;
  18285. let { index } = $$props;
  18286. let { request } = $$props;
  18287. let { responses } = $$props;
  18288. let { isDarkmode } = $$props;
  18289. function title(index) {
  18290. if (request.title) {
  18291. return `Request ${request.title}`;
  18292. }
  18293. if (count === 1) {
  18294. return "Request";
  18295. } else {
  18296. return `Request ${index + 1}`;
  18297. }
  18298. }
  18299. $$self.$set = $$props => {
  18300. if ("show" in $$props) $$invalidate(0, show = $$props.show);
  18301. if ("count" in $$props) $$invalidate(6, count = $$props.count);
  18302. if ("index" in $$props) $$invalidate(4, index = $$props.index);
  18303. if ("request" in $$props) $$invalidate(1, request = $$props.request);
  18304. if ("responses" in $$props) $$invalidate(2, responses = $$props.responses);
  18305. if ("isDarkmode" in $$props) $$invalidate(3, isDarkmode = $$props.isDarkmode);
  18306. };
  18307. return [show, request, responses, isDarkmode, index, title, count];
  18308. }
  18309. class ScenarioPanel extends SvelteComponent {
  18310. constructor(options) {
  18311. super();
  18312. init(this, options, instance$h, create_fragment$h, safe_not_equal, {
  18313. show: 0,
  18314. count: 6,
  18315. index: 4,
  18316. request: 1,
  18317. responses: 2,
  18318. isDarkmode: 3
  18319. });
  18320. }
  18321. }
  18322. /* usr/local/lib/node_modules/snowboard/templates/winter/pages/Action.svelte generated by Svelte v3.19.2 */
  18323. function add_css$8() {
  18324. var style = element("style");
  18325. style.id = "svelte-1kw1ago-style";
  18326. style.textContent = ".breadcrumb-right.svelte-1kw1ago{margin-top:0.3em}.box-wrapper.svelte-1kw1ago{border-radius:0}";
  18327. append(document.head, style);
  18328. }
  18329. function get_each_context$4(ctx, list, i) {
  18330. const child_ctx = ctx.slice();
  18331. child_ctx[11] = list[i].request;
  18332. child_ctx[12] = list[i].responses;
  18333. child_ctx[14] = i;
  18334. return child_ctx;
  18335. }
  18336. function get_each_context_1$2(ctx, list, i) {
  18337. const child_ctx = ctx.slice();
  18338. child_ctx[15] = list[i];
  18339. child_ctx[14] = i;
  18340. return child_ctx;
  18341. }
  18342. // (192:0) {:else}
  18343. function create_else_block_1$1(ctx) {
  18344. let h3;
  18345. return {
  18346. c() {
  18347. h3 = element("h3");
  18348. h3.textContent = "404 - Not Found";
  18349. },
  18350. m(target, anchor) {
  18351. insert(target, h3, anchor);
  18352. },
  18353. p: noop,
  18354. i: noop,
  18355. o: noop,
  18356. d(detaching) {
  18357. if (detaching) detach(h3);
  18358. }
  18359. };
  18360. }
  18361. // (126:0) {#if action}
  18362. function create_if_block$c(ctx) {
  18363. let div2;
  18364. let div0;
  18365. let h1;
  18366. let t0_value = /*action*/ ctx[0].title + "";
  18367. let t0;
  18368. let t1;
  18369. let div1;
  18370. let nav;
  18371. let ul;
  18372. let t2;
  18373. let hr;
  18374. let t3;
  18375. let div3;
  18376. let code0;
  18377. let t4_value = /*action*/ ctx[0].method + "";
  18378. let t4;
  18379. let code0_class_value;
  18380. let t5;
  18381. let code1;
  18382. let t6_value = /*action*/ ctx[0].pathTemplate + "";
  18383. let t6;
  18384. let t7;
  18385. let div4;
  18386. let raw_value = markdown(/*action*/ ctx[0].description) + "";
  18387. let t8;
  18388. let t9;
  18389. let t10;
  18390. let each1_anchor;
  18391. let current;
  18392. let each_value_1 = /*action*/ ctx[0].tags;
  18393. let each_blocks_1 = [];
  18394. for (let i = 0; i < each_value_1.length; i += 1) {
  18395. each_blocks_1[i] = create_each_block_1$2(get_each_context_1$2(ctx, each_value_1, i));
  18396. }
  18397. let if_block = /*config*/ ctx[1].playground.enabled && create_if_block_1$9(ctx);
  18398. const parameterpanel = new ParameterPanel({
  18399. props: { parameters: /*action*/ ctx[0].parameters }
  18400. });
  18401. let each_value = /*transactions*/ ctx[5];
  18402. let each_blocks = [];
  18403. for (let i = 0; i < each_value.length; i += 1) {
  18404. each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
  18405. }
  18406. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  18407. each_blocks[i] = null;
  18408. });
  18409. return {
  18410. c() {
  18411. div2 = element("div");
  18412. div0 = element("div");
  18413. h1 = element("h1");
  18414. t0 = text(t0_value);
  18415. t1 = space();
  18416. div1 = element("div");
  18417. nav = element("nav");
  18418. ul = element("ul");
  18419. for (let i = 0; i < each_blocks_1.length; i += 1) {
  18420. each_blocks_1[i].c();
  18421. }
  18422. t2 = space();
  18423. hr = element("hr");
  18424. t3 = space();
  18425. div3 = element("div");
  18426. code0 = element("code");
  18427. t4 = text(t4_value);
  18428. t5 = space();
  18429. code1 = element("code");
  18430. t6 = text(t6_value);
  18431. t7 = space();
  18432. div4 = element("div");
  18433. t8 = space();
  18434. if (if_block) if_block.c();
  18435. t9 = space();
  18436. create_component(parameterpanel.$$.fragment);
  18437. t10 = space();
  18438. for (let i = 0; i < each_blocks.length; i += 1) {
  18439. each_blocks[i].c();
  18440. }
  18441. each1_anchor = empty();
  18442. attr(h1, "class", "title is-4");
  18443. attr(div0, "class", "column");
  18444. attr(nav, "class", "breadcrumb breadcrumb-right is-pulled-right svelte-1kw1ago");
  18445. attr(nav, "aria-label", "breadcrumbs");
  18446. attr(div1, "class", "column");
  18447. attr(div2, "class", "columns");
  18448. attr(code0, "class", code0_class_value = "tag is-uppercase " + colorize(/*action*/ ctx[0].method) + " svelte-1kw1ago");
  18449. attr(code1, "class", "tag ");
  18450. attr(div3, "class", "tags has-addons are-large");
  18451. attr(div4, "class", "content");
  18452. },
  18453. m(target, anchor) {
  18454. insert(target, div2, anchor);
  18455. append(div2, div0);
  18456. append(div0, h1);
  18457. append(h1, t0);
  18458. append(div2, t1);
  18459. append(div2, div1);
  18460. append(div1, nav);
  18461. append(nav, ul);
  18462. for (let i = 0; i < each_blocks_1.length; i += 1) {
  18463. each_blocks_1[i].m(ul, null);
  18464. }
  18465. insert(target, t2, anchor);
  18466. insert(target, hr, anchor);
  18467. insert(target, t3, anchor);
  18468. insert(target, div3, anchor);
  18469. append(div3, code0);
  18470. append(code0, t4);
  18471. append(div3, t5);
  18472. append(div3, code1);
  18473. append(code1, t6);
  18474. insert(target, t7, anchor);
  18475. insert(target, div4, anchor);
  18476. div4.innerHTML = raw_value;
  18477. insert(target, t8, anchor);
  18478. if (if_block) if_block.m(target, anchor);
  18479. insert(target, t9, anchor);
  18480. mount_component(parameterpanel, target, anchor);
  18481. insert(target, t10, anchor);
  18482. for (let i = 0; i < each_blocks.length; i += 1) {
  18483. each_blocks[i].m(target, anchor);
  18484. }
  18485. insert(target, each1_anchor, anchor);
  18486. current = true;
  18487. },
  18488. p(ctx, dirty) {
  18489. if ((!current || dirty & /*action*/ 1) && t0_value !== (t0_value = /*action*/ ctx[0].title + "")) set_data(t0, t0_value);
  18490. if (dirty & /*action, slugify, handleLink*/ 1) {
  18491. each_value_1 = /*action*/ ctx[0].tags;
  18492. let i;
  18493. for (i = 0; i < each_value_1.length; i += 1) {
  18494. const child_ctx = get_each_context_1$2(ctx, each_value_1, i);
  18495. if (each_blocks_1[i]) {
  18496. each_blocks_1[i].p(child_ctx, dirty);
  18497. } else {
  18498. each_blocks_1[i] = create_each_block_1$2(child_ctx);
  18499. each_blocks_1[i].c();
  18500. each_blocks_1[i].m(ul, null);
  18501. }
  18502. }
  18503. for (; i < each_blocks_1.length; i += 1) {
  18504. each_blocks_1[i].d(1);
  18505. }
  18506. each_blocks_1.length = each_value_1.length;
  18507. }
  18508. if ((!current || dirty & /*action*/ 1) && t4_value !== (t4_value = /*action*/ ctx[0].method + "")) set_data(t4, t4_value);
  18509. if (!current || dirty & /*action*/ 1 && code0_class_value !== (code0_class_value = "tag is-uppercase " + colorize(/*action*/ ctx[0].method) + " svelte-1kw1ago")) {
  18510. attr(code0, "class", code0_class_value);
  18511. }
  18512. if ((!current || dirty & /*action*/ 1) && t6_value !== (t6_value = /*action*/ ctx[0].pathTemplate + "")) set_data(t6, t6_value);
  18513. if ((!current || dirty & /*action*/ 1) && raw_value !== (raw_value = markdown(/*action*/ ctx[0].description) + "")) div4.innerHTML = raw_value;;
  18514. if (/*config*/ ctx[1].playground.enabled) {
  18515. if (if_block) {
  18516. if_block.p(ctx, dirty);
  18517. transition_in(if_block, 1);
  18518. } else {
  18519. if_block = create_if_block_1$9(ctx);
  18520. if_block.c();
  18521. transition_in(if_block, 1);
  18522. if_block.m(t9.parentNode, t9);
  18523. }
  18524. } else if (if_block) {
  18525. group_outros();
  18526. transition_out(if_block, 1, 1, () => {
  18527. if_block = null;
  18528. });
  18529. check_outros();
  18530. }
  18531. const parameterpanel_changes = {};
  18532. if (dirty & /*action*/ 1) parameterpanel_changes.parameters = /*action*/ ctx[0].parameters;
  18533. parameterpanel.$set(parameterpanel_changes);
  18534. if (dirty & /*darkMode, transactions*/ 48) {
  18535. each_value = /*transactions*/ ctx[5];
  18536. let i;
  18537. for (i = 0; i < each_value.length; i += 1) {
  18538. const child_ctx = get_each_context$4(ctx, each_value, i);
  18539. if (each_blocks[i]) {
  18540. each_blocks[i].p(child_ctx, dirty);
  18541. transition_in(each_blocks[i], 1);
  18542. } else {
  18543. each_blocks[i] = create_each_block$4(child_ctx);
  18544. each_blocks[i].c();
  18545. transition_in(each_blocks[i], 1);
  18546. each_blocks[i].m(each1_anchor.parentNode, each1_anchor);
  18547. }
  18548. }
  18549. group_outros();
  18550. for (i = each_value.length; i < each_blocks.length; i += 1) {
  18551. out(i);
  18552. }
  18553. check_outros();
  18554. }
  18555. },
  18556. i(local) {
  18557. if (current) return;
  18558. transition_in(if_block);
  18559. transition_in(parameterpanel.$$.fragment, local);
  18560. for (let i = 0; i < each_value.length; i += 1) {
  18561. transition_in(each_blocks[i]);
  18562. }
  18563. current = true;
  18564. },
  18565. o(local) {
  18566. transition_out(if_block);
  18567. transition_out(parameterpanel.$$.fragment, local);
  18568. each_blocks = each_blocks.filter(Boolean);
  18569. for (let i = 0; i < each_blocks.length; i += 1) {
  18570. transition_out(each_blocks[i]);
  18571. }
  18572. current = false;
  18573. },
  18574. d(detaching) {
  18575. if (detaching) detach(div2);
  18576. destroy_each(each_blocks_1, detaching);
  18577. if (detaching) detach(t2);
  18578. if (detaching) detach(hr);
  18579. if (detaching) detach(t3);
  18580. if (detaching) detach(div3);
  18581. if (detaching) detach(t7);
  18582. if (detaching) detach(div4);
  18583. if (detaching) detach(t8);
  18584. if (if_block) if_block.d(detaching);
  18585. if (detaching) detach(t9);
  18586. destroy_component(parameterpanel, detaching);
  18587. if (detaching) detach(t10);
  18588. destroy_each(each_blocks, detaching);
  18589. if (detaching) detach(each1_anchor);
  18590. }
  18591. };
  18592. }
  18593. // (140:14) {:else}
  18594. function create_else_block$6(ctx) {
  18595. let a;
  18596. let t_value = /*tag*/ ctx[15] + "";
  18597. let t;
  18598. let a_href_value;
  18599. let dispose;
  18600. return {
  18601. c() {
  18602. a = element("a");
  18603. t = text(t_value);
  18604. attr(a, "href", a_href_value = "/#/g~" + slugify(/*action*/ ctx[0].tags[0]) + "~" + slugify(/*tag*/ ctx[15]));
  18605. },
  18606. m(target, anchor) {
  18607. insert(target, a, anchor);
  18608. append(a, t);
  18609. dispose = listen(a, "click", handleLink);
  18610. },
  18611. p(ctx, dirty) {
  18612. if (dirty & /*action*/ 1 && t_value !== (t_value = /*tag*/ ctx[15] + "")) set_data(t, t_value);
  18613. if (dirty & /*action*/ 1 && a_href_value !== (a_href_value = "/#/g~" + slugify(/*action*/ ctx[0].tags[0]) + "~" + slugify(/*tag*/ ctx[15]))) {
  18614. attr(a, "href", a_href_value);
  18615. }
  18616. },
  18617. d(detaching) {
  18618. if (detaching) detach(a);
  18619. dispose();
  18620. }
  18621. };
  18622. }
  18623. // (138:14) {#if index === 0}
  18624. function create_if_block_3$1(ctx) {
  18625. let a;
  18626. let t_value = /*tag*/ ctx[15] + "";
  18627. let t;
  18628. return {
  18629. c() {
  18630. a = element("a");
  18631. t = text(t_value);
  18632. attr(a, "href", "javascript:void(0)");
  18633. },
  18634. m(target, anchor) {
  18635. insert(target, a, anchor);
  18636. append(a, t);
  18637. },
  18638. p(ctx, dirty) {
  18639. if (dirty & /*action*/ 1 && t_value !== (t_value = /*tag*/ ctx[15] + "")) set_data(t, t_value);
  18640. },
  18641. d(detaching) {
  18642. if (detaching) detach(a);
  18643. }
  18644. };
  18645. }
  18646. // (136:10) {#each action.tags as tag, index}
  18647. function create_each_block_1$2(ctx) {
  18648. let li;
  18649. let t;
  18650. function select_block_type_1(ctx, dirty) {
  18651. if (/*index*/ ctx[14] === 0) return create_if_block_3$1;
  18652. return create_else_block$6;
  18653. }
  18654. let current_block_type = select_block_type_1(ctx, -1);
  18655. let if_block = current_block_type(ctx);
  18656. return {
  18657. c() {
  18658. li = element("li");
  18659. if_block.c();
  18660. t = space();
  18661. },
  18662. m(target, anchor) {
  18663. insert(target, li, anchor);
  18664. if_block.m(li, null);
  18665. append(li, t);
  18666. },
  18667. p(ctx, dirty) {
  18668. if_block.p(ctx, dirty);
  18669. },
  18670. d(detaching) {
  18671. if (detaching) detach(li);
  18672. if_block.d();
  18673. }
  18674. };
  18675. }
  18676. // (167:2) {#if config.playground.enabled}
  18677. function create_if_block_1$9(ctx) {
  18678. let if_block_anchor;
  18679. let current;
  18680. let if_block = /*environment*/ ctx[2].playground !== false && create_if_block_2$5(ctx);
  18681. return {
  18682. c() {
  18683. if (if_block) if_block.c();
  18684. if_block_anchor = empty();
  18685. },
  18686. m(target, anchor) {
  18687. if (if_block) if_block.m(target, anchor);
  18688. insert(target, if_block_anchor, anchor);
  18689. current = true;
  18690. },
  18691. p(ctx, dirty) {
  18692. if (/*environment*/ ctx[2].playground !== false) {
  18693. if (if_block) {
  18694. if_block.p(ctx, dirty);
  18695. transition_in(if_block, 1);
  18696. } else {
  18697. if_block = create_if_block_2$5(ctx);
  18698. if_block.c();
  18699. transition_in(if_block, 1);
  18700. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  18701. }
  18702. } else if (if_block) {
  18703. group_outros();
  18704. transition_out(if_block, 1, 1, () => {
  18705. if_block = null;
  18706. });
  18707. check_outros();
  18708. }
  18709. },
  18710. i(local) {
  18711. if (current) return;
  18712. transition_in(if_block);
  18713. current = true;
  18714. },
  18715. o(local) {
  18716. transition_out(if_block);
  18717. current = false;
  18718. },
  18719. d(detaching) {
  18720. if (if_block) if_block.d(detaching);
  18721. if (detaching) detach(if_block_anchor);
  18722. }
  18723. };
  18724. }
  18725. // (168:4) {#if environment.playground !== false}
  18726. function create_if_block_2$5(ctx) {
  18727. let current;
  18728. const playgroundpanel = new PlaygroundPanel({
  18729. props: {
  18730. currentAction: /*action*/ ctx[0],
  18731. pkceChallenge: /*challengePair*/ ctx[3],
  18732. environments: /*config*/ ctx[1].playground.environments,
  18733. requestHeaders: headersMap(/*action*/ ctx[0]),
  18734. requestAuthHeader: /*authHeader*/ ctx[6](/*action*/ ctx[0], /*environment*/ ctx[2]),
  18735. requestParameters: parametersMap(/*action*/ ctx[0]),
  18736. requestBody: bodyMap(/*action*/ ctx[0]),
  18737. isDarkmode: /*darkMode*/ ctx[4].active
  18738. }
  18739. });
  18740. return {
  18741. c() {
  18742. create_component(playgroundpanel.$$.fragment);
  18743. },
  18744. m(target, anchor) {
  18745. mount_component(playgroundpanel, target, anchor);
  18746. current = true;
  18747. },
  18748. p(ctx, dirty) {
  18749. const playgroundpanel_changes = {};
  18750. if (dirty & /*action*/ 1) playgroundpanel_changes.currentAction = /*action*/ ctx[0];
  18751. if (dirty & /*challengePair*/ 8) playgroundpanel_changes.pkceChallenge = /*challengePair*/ ctx[3];
  18752. if (dirty & /*config*/ 2) playgroundpanel_changes.environments = /*config*/ ctx[1].playground.environments;
  18753. if (dirty & /*action*/ 1) playgroundpanel_changes.requestHeaders = headersMap(/*action*/ ctx[0]);
  18754. if (dirty & /*action, environment*/ 5) playgroundpanel_changes.requestAuthHeader = /*authHeader*/ ctx[6](/*action*/ ctx[0], /*environment*/ ctx[2]);
  18755. if (dirty & /*action*/ 1) playgroundpanel_changes.requestParameters = parametersMap(/*action*/ ctx[0]);
  18756. if (dirty & /*action*/ 1) playgroundpanel_changes.requestBody = bodyMap(/*action*/ ctx[0]);
  18757. if (dirty & /*darkMode*/ 16) playgroundpanel_changes.isDarkmode = /*darkMode*/ ctx[4].active;
  18758. playgroundpanel.$set(playgroundpanel_changes);
  18759. },
  18760. i(local) {
  18761. if (current) return;
  18762. transition_in(playgroundpanel.$$.fragment, local);
  18763. current = true;
  18764. },
  18765. o(local) {
  18766. transition_out(playgroundpanel.$$.fragment, local);
  18767. current = false;
  18768. },
  18769. d(detaching) {
  18770. destroy_component(playgroundpanel, detaching);
  18771. }
  18772. };
  18773. }
  18774. // (183:2) {#each transactions as { request, responses }
  18775. function create_each_block$4(ctx) {
  18776. let current;
  18777. const scenariopanel = new ScenarioPanel({
  18778. props: {
  18779. show: /*index*/ ctx[14] === 0,
  18780. isDarkmode: /*darkMode*/ ctx[4].active,
  18781. request: /*request*/ ctx[11],
  18782. responses: /*responses*/ ctx[12],
  18783. index: /*index*/ ctx[14],
  18784. count: /*transactions*/ ctx[5].length
  18785. }
  18786. });
  18787. return {
  18788. c() {
  18789. create_component(scenariopanel.$$.fragment);
  18790. },
  18791. m(target, anchor) {
  18792. mount_component(scenariopanel, target, anchor);
  18793. current = true;
  18794. },
  18795. p(ctx, dirty) {
  18796. const scenariopanel_changes = {};
  18797. if (dirty & /*darkMode*/ 16) scenariopanel_changes.isDarkmode = /*darkMode*/ ctx[4].active;
  18798. if (dirty & /*transactions*/ 32) scenariopanel_changes.request = /*request*/ ctx[11];
  18799. if (dirty & /*transactions*/ 32) scenariopanel_changes.responses = /*responses*/ ctx[12];
  18800. if (dirty & /*transactions*/ 32) scenariopanel_changes.count = /*transactions*/ ctx[5].length;
  18801. scenariopanel.$set(scenariopanel_changes);
  18802. },
  18803. i(local) {
  18804. if (current) return;
  18805. transition_in(scenariopanel.$$.fragment, local);
  18806. current = true;
  18807. },
  18808. o(local) {
  18809. transition_out(scenariopanel.$$.fragment, local);
  18810. current = false;
  18811. },
  18812. d(detaching) {
  18813. destroy_component(scenariopanel, detaching);
  18814. }
  18815. };
  18816. }
  18817. function create_fragment$i(ctx) {
  18818. let current_block_type_index;
  18819. let if_block;
  18820. let if_block_anchor;
  18821. let current;
  18822. const if_block_creators = [create_if_block$c, create_else_block_1$1];
  18823. const if_blocks = [];
  18824. function select_block_type(ctx, dirty) {
  18825. if (/*action*/ ctx[0]) return 0;
  18826. return 1;
  18827. }
  18828. current_block_type_index = select_block_type(ctx, -1);
  18829. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  18830. return {
  18831. c() {
  18832. if_block.c();
  18833. if_block_anchor = empty();
  18834. },
  18835. m(target, anchor) {
  18836. if_blocks[current_block_type_index].m(target, anchor);
  18837. insert(target, if_block_anchor, anchor);
  18838. current = true;
  18839. },
  18840. p(ctx, [dirty]) {
  18841. let previous_block_index = current_block_type_index;
  18842. current_block_type_index = select_block_type(ctx, dirty);
  18843. if (current_block_type_index === previous_block_index) {
  18844. if_blocks[current_block_type_index].p(ctx, dirty);
  18845. } else {
  18846. group_outros();
  18847. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  18848. if_blocks[previous_block_index] = null;
  18849. });
  18850. check_outros();
  18851. if_block = if_blocks[current_block_type_index];
  18852. if (!if_block) {
  18853. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  18854. if_block.c();
  18855. }
  18856. transition_in(if_block, 1);
  18857. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  18858. }
  18859. },
  18860. i(local) {
  18861. if (current) return;
  18862. transition_in(if_block);
  18863. current = true;
  18864. },
  18865. o(local) {
  18866. transition_out(if_block);
  18867. current = false;
  18868. },
  18869. d(detaching) {
  18870. if_blocks[current_block_type_index].d(detaching);
  18871. if (detaching) detach(if_block_anchor);
  18872. }
  18873. };
  18874. }
  18875. function sample(action) {
  18876. return action.transactions[0].request;
  18877. }
  18878. function headersMap(action) {
  18879. return sample(action).headers.filter(header => header.name != "Authorization").map(header => {
  18880. return {
  18881. used: true,
  18882. required: false,
  18883. name: header.name,
  18884. value: header.example || ""
  18885. };
  18886. });
  18887. }
  18888. function parametersMap(action) {
  18889. return action.parameters.map(param => {
  18890. return {
  18891. used: param.required,
  18892. required: param.required,
  18893. name: param.name,
  18894. value: param.example || ""
  18895. };
  18896. });
  18897. }
  18898. function bodyMap(action) {
  18899. const example = sample(action).example;
  18900. return stringify$2(example);
  18901. }
  18902. function instance$i($$self, $$props, $$invalidate) {
  18903. let $auth;
  18904. let $env;
  18905. let $token;
  18906. component_subscribe($$self, auth, $$value => $$invalidate(7, $auth = $$value));
  18907. component_subscribe($$self, env, $$value => $$invalidate(8, $env = $$value));
  18908. component_subscribe($$self, token$1, $$value => $$invalidate(9, $token = $$value));
  18909. let { action } = $$props;
  18910. let { config } = $$props;
  18911. let { environment } = $$props;
  18912. let { challengePair } = $$props;
  18913. let { darkMode } = $$props;
  18914. function authHeader(action, environment) {
  18915. const header = sample(action).headers.find(header => header.name === "Authorization");
  18916. if (!header) return;
  18917. header.value = header.example;
  18918. header.used = true;
  18919. if (isAuth(environment, "basic")) {
  18920. header.value = `Basic ${basicAuth(environment.auth.options.username, environment.auth.options.password)}`;
  18921. }
  18922. if (isAuth(environment, "apikey")) {
  18923. header.name = environment.auth.options.header;
  18924. header.value = environment.auth.options.key;
  18925. }
  18926. if (isAuth(environment, "oauth2")) {
  18927. if ($auth.split(";").includes($env)) {
  18928. header.value = `Bearer ${$token}`;
  18929. }
  18930. }
  18931. return header;
  18932. }
  18933. function toTransactions(transactions) {
  18934. if (!transactions) return [];
  18935. const items = {};
  18936. transactions.forEach(transaction => {
  18937. const { request, response } = transaction;
  18938. const requestHash = lib$2.h32(fastJsonStableStringify(request), 703710).toString(16);
  18939. if (!Object.keys(items).includes(requestHash)) {
  18940. items[requestHash] = { request, responses: [response] };
  18941. } else {
  18942. items[requestHash].responses.push(response);
  18943. }
  18944. });
  18945. return Object.values(items);
  18946. }
  18947. $$self.$set = $$props => {
  18948. if ("action" in $$props) $$invalidate(0, action = $$props.action);
  18949. if ("config" in $$props) $$invalidate(1, config = $$props.config);
  18950. if ("environment" in $$props) $$invalidate(2, environment = $$props.environment);
  18951. if ("challengePair" in $$props) $$invalidate(3, challengePair = $$props.challengePair);
  18952. if ("darkMode" in $$props) $$invalidate(4, darkMode = $$props.darkMode);
  18953. };
  18954. let transactions;
  18955. $$self.$$.update = () => {
  18956. if ($$self.$$.dirty & /*action*/ 1) {
  18957. $$invalidate(5, transactions = toTransactions(action && action.transactions));
  18958. }
  18959. };
  18960. return [action, config, environment, challengePair, darkMode, transactions, authHeader];
  18961. }
  18962. class Action extends SvelteComponent {
  18963. constructor(options) {
  18964. super();
  18965. if (!document.getElementById("svelte-1kw1ago-style")) add_css$8();
  18966. init(this, options, instance$i, create_fragment$i, safe_not_equal, {
  18967. action: 0,
  18968. config: 1,
  18969. environment: 2,
  18970. challengePair: 3,
  18971. darkMode: 4
  18972. });
  18973. }
  18974. }
  18975. /* usr/local/lib/node_modules/snowboard/templates/winter/components/MenuItem.svelte generated by Svelte v3.19.2 */
  18976. function add_css$9() {
  18977. var style = element("style");
  18978. style.id = "svelte-39af3j-style";
  18979. style.textContent = ".tag.svelte-39af3j{width:3.5rem}.menu-ellipsis.svelte-39af3j{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:0.25em 0.75em}.menu-action.svelte-39af3j{vertical-align:middle}";
  18980. append(document.head, style);
  18981. }
  18982. function get_each_context$5(ctx, list, i) {
  18983. const child_ctx = ctx.slice();
  18984. child_ctx[6] = list[i];
  18985. return child_ctx;
  18986. }
  18987. // (28:0) {#if title}
  18988. function create_if_block_1$a(ctx) {
  18989. let li;
  18990. let a0;
  18991. let t0;
  18992. let a0_href_value;
  18993. let t1;
  18994. let a1;
  18995. let span;
  18996. let i;
  18997. let dispose;
  18998. return {
  18999. c() {
  19000. li = element("li");
  19001. a0 = element("a");
  19002. t0 = text(/*title*/ ctx[1]);
  19003. t1 = space();
  19004. a1 = element("a");
  19005. span = element("span");
  19006. i = element("i");
  19007. attr(a0, "href", a0_href_value = buildHref(`#/g~${/*parentSlug*/ ctx[3]}~${slugify(/*title*/ ctx[1])}`));
  19008. attr(a0, "class", "is-inline-block");
  19009. attr(i, "class", "fas");
  19010. toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]);
  19011. toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]);
  19012. attr(span, "class", "icon is-small has-text-grey-light");
  19013. attr(a1, "href", "javascript:void(0)");
  19014. attr(a1, "class", "is-inline-block is-pulled-right");
  19015. },
  19016. m(target, anchor) {
  19017. insert(target, li, anchor);
  19018. append(li, a0);
  19019. append(a0, t0);
  19020. append(li, t1);
  19021. append(li, a1);
  19022. append(a1, span);
  19023. append(span, i);
  19024. dispose = [
  19025. listen(a0, "click", handleLink),
  19026. listen(a1, "click", /*click_handler*/ ctx[5])
  19027. ];
  19028. },
  19029. p(ctx, dirty) {
  19030. if (dirty & /*title*/ 2) set_data(t0, /*title*/ ctx[1]);
  19031. if (dirty & /*parentSlug, title*/ 10 && a0_href_value !== (a0_href_value = buildHref(`#/g~${/*parentSlug*/ ctx[3]}~${slugify(/*title*/ ctx[1])}`))) {
  19032. attr(a0, "href", a0_href_value);
  19033. }
  19034. if (dirty & /*hidden*/ 1) {
  19035. toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]);
  19036. }
  19037. if (dirty & /*hidden*/ 1) {
  19038. toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]);
  19039. }
  19040. },
  19041. d(detaching) {
  19042. if (detaching) detach(li);
  19043. run_all(dispose);
  19044. }
  19045. };
  19046. }
  19047. // (50:0) {#if actions.length > 0}
  19048. function create_if_block$d(ctx) {
  19049. let li;
  19050. let ul;
  19051. let each_value = /*actions*/ ctx[2];
  19052. let each_blocks = [];
  19053. for (let i = 0; i < each_value.length; i += 1) {
  19054. each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
  19055. }
  19056. return {
  19057. c() {
  19058. li = element("li");
  19059. ul = element("ul");
  19060. for (let i = 0; i < each_blocks.length; i += 1) {
  19061. each_blocks[i].c();
  19062. }
  19063. toggle_class(li, "is-hidden", /*hidden*/ ctx[0]);
  19064. },
  19065. m(target, anchor) {
  19066. insert(target, li, anchor);
  19067. append(li, ul);
  19068. for (let i = 0; i < each_blocks.length; i += 1) {
  19069. each_blocks[i].m(ul, null);
  19070. }
  19071. },
  19072. p(ctx, dirty) {
  19073. if (dirty & /*buildHref, actions, $router, handleLink, colorize*/ 20) {
  19074. each_value = /*actions*/ ctx[2];
  19075. let i;
  19076. for (i = 0; i < each_value.length; i += 1) {
  19077. const child_ctx = get_each_context$5(ctx, each_value, i);
  19078. if (each_blocks[i]) {
  19079. each_blocks[i].p(child_ctx, dirty);
  19080. } else {
  19081. each_blocks[i] = create_each_block$5(child_ctx);
  19082. each_blocks[i].c();
  19083. each_blocks[i].m(ul, null);
  19084. }
  19085. }
  19086. for (; i < each_blocks.length; i += 1) {
  19087. each_blocks[i].d(1);
  19088. }
  19089. each_blocks.length = each_value.length;
  19090. }
  19091. if (dirty & /*hidden*/ 1) {
  19092. toggle_class(li, "is-hidden", /*hidden*/ ctx[0]);
  19093. }
  19094. },
  19095. d(detaching) {
  19096. if (detaching) detach(li);
  19097. destroy_each(each_blocks, detaching);
  19098. }
  19099. };
  19100. }
  19101. // (53:6) {#each actions as action}
  19102. function create_each_block$5(ctx) {
  19103. let li;
  19104. let a;
  19105. let code;
  19106. let t0_value = /*action*/ ctx[6].method + "";
  19107. let t0;
  19108. let code_class_value;
  19109. let t1;
  19110. let span;
  19111. let t2_value = /*action*/ ctx[6].title + "";
  19112. let t2;
  19113. let a_href_value;
  19114. let t3;
  19115. let dispose;
  19116. return {
  19117. c() {
  19118. li = element("li");
  19119. a = element("a");
  19120. code = element("code");
  19121. t0 = text(t0_value);
  19122. t1 = space();
  19123. span = element("span");
  19124. t2 = text(t2_value);
  19125. t3 = space();
  19126. attr(code, "class", code_class_value = "tag " + colorize(/*action*/ ctx[6].method) + " is-uppercase" + " svelte-39af3j");
  19127. attr(span, "class", "menu-action svelte-39af3j");
  19128. attr(a, "href", a_href_value = buildHref(`#/${/*action*/ ctx[6].slug}`));
  19129. attr(a, "class", "menu-ellipsis svelte-39af3j");
  19130. toggle_class(a, "is-active", /*action*/ ctx[6].slug === /*$router*/ ctx[4].params.slug);
  19131. },
  19132. m(target, anchor) {
  19133. insert(target, li, anchor);
  19134. append(li, a);
  19135. append(a, code);
  19136. append(code, t0);
  19137. append(a, t1);
  19138. append(a, span);
  19139. append(span, t2);
  19140. append(li, t3);
  19141. dispose = listen(a, "click", handleLink);
  19142. },
  19143. p(ctx, dirty) {
  19144. if (dirty & /*actions*/ 4 && t0_value !== (t0_value = /*action*/ ctx[6].method + "")) set_data(t0, t0_value);
  19145. if (dirty & /*actions*/ 4 && code_class_value !== (code_class_value = "tag " + colorize(/*action*/ ctx[6].method) + " is-uppercase" + " svelte-39af3j")) {
  19146. attr(code, "class", code_class_value);
  19147. }
  19148. if (dirty & /*actions*/ 4 && t2_value !== (t2_value = /*action*/ ctx[6].title + "")) set_data(t2, t2_value);
  19149. if (dirty & /*actions*/ 4 && a_href_value !== (a_href_value = buildHref(`#/${/*action*/ ctx[6].slug}`))) {
  19150. attr(a, "href", a_href_value);
  19151. }
  19152. if (dirty & /*actions, $router*/ 20) {
  19153. toggle_class(a, "is-active", /*action*/ ctx[6].slug === /*$router*/ ctx[4].params.slug);
  19154. }
  19155. },
  19156. d(detaching) {
  19157. if (detaching) detach(li);
  19158. dispose();
  19159. }
  19160. };
  19161. }
  19162. function create_fragment$j(ctx) {
  19163. let t;
  19164. let if_block1_anchor;
  19165. let if_block0 = /*title*/ ctx[1] && create_if_block_1$a(ctx);
  19166. let if_block1 = /*actions*/ ctx[2].length > 0 && create_if_block$d(ctx);
  19167. return {
  19168. c() {
  19169. if (if_block0) if_block0.c();
  19170. t = space();
  19171. if (if_block1) if_block1.c();
  19172. if_block1_anchor = empty();
  19173. },
  19174. m(target, anchor) {
  19175. if (if_block0) if_block0.m(target, anchor);
  19176. insert(target, t, anchor);
  19177. if (if_block1) if_block1.m(target, anchor);
  19178. insert(target, if_block1_anchor, anchor);
  19179. },
  19180. p(ctx, [dirty]) {
  19181. if (/*title*/ ctx[1]) {
  19182. if (if_block0) {
  19183. if_block0.p(ctx, dirty);
  19184. } else {
  19185. if_block0 = create_if_block_1$a(ctx);
  19186. if_block0.c();
  19187. if_block0.m(t.parentNode, t);
  19188. }
  19189. } else if (if_block0) {
  19190. if_block0.d(1);
  19191. if_block0 = null;
  19192. }
  19193. if (/*actions*/ ctx[2].length > 0) {
  19194. if (if_block1) {
  19195. if_block1.p(ctx, dirty);
  19196. } else {
  19197. if_block1 = create_if_block$d(ctx);
  19198. if_block1.c();
  19199. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  19200. }
  19201. } else if (if_block1) {
  19202. if_block1.d(1);
  19203. if_block1 = null;
  19204. }
  19205. },
  19206. i: noop,
  19207. o: noop,
  19208. d(detaching) {
  19209. if (if_block0) if_block0.d(detaching);
  19210. if (detaching) detach(t);
  19211. if (if_block1) if_block1.d(detaching);
  19212. if (detaching) detach(if_block1_anchor);
  19213. }
  19214. };
  19215. }
  19216. function instance$j($$self, $$props, $$invalidate) {
  19217. let $router;
  19218. component_subscribe($$self, router, $$value => $$invalidate(4, $router = $$value));
  19219. let { title } = $$props;
  19220. let { actions } = $$props;
  19221. let { parentSlug } = $$props;
  19222. let { hidden = false } = $$props;
  19223. const click_handler = () => $$invalidate(0, hidden = !hidden);
  19224. $$self.$set = $$props => {
  19225. if ("title" in $$props) $$invalidate(1, title = $$props.title);
  19226. if ("actions" in $$props) $$invalidate(2, actions = $$props.actions);
  19227. if ("parentSlug" in $$props) $$invalidate(3, parentSlug = $$props.parentSlug);
  19228. if ("hidden" in $$props) $$invalidate(0, hidden = $$props.hidden);
  19229. };
  19230. return [hidden, title, actions, parentSlug, $router, click_handler];
  19231. }
  19232. class MenuItem extends SvelteComponent {
  19233. constructor(options) {
  19234. super();
  19235. if (!document.getElementById("svelte-39af3j-style")) add_css$9();
  19236. init(this, options, instance$j, create_fragment$j, safe_not_equal, {
  19237. title: 1,
  19238. actions: 2,
  19239. parentSlug: 3,
  19240. hidden: 0
  19241. });
  19242. }
  19243. }
  19244. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/MenuPanel.svelte generated by Svelte v3.19.2 */
  19245. function add_css$a() {
  19246. var style = element("style");
  19247. style.id = "svelte-fvssqr-style";
  19248. style.textContent = ".hero.svelte-fvssqr.svelte-fvssqr,.menu-wrapper.svelte-fvssqr.svelte-fvssqr{padding:0 2.75rem 0 2rem}.hero.svelte-fvssqr.svelte-fvssqr{position:sticky;top:54px;background-color:#fafafa;margin-bottom:1.5rem}.hero.is-darkmode.svelte-fvssqr.svelte-fvssqr{background-color:#000}.hero-body.svelte-fvssqr.svelte-fvssqr{padding:1.5rem 0;box-shadow:0 2px 0 0 #f5f5f5}.hero-body.is-darkmode.svelte-fvssqr.svelte-fvssqr{box-shadow:0 2px 0 0 #363636}.menu-wrapper.svelte-fvssqr.svelte-fvssqr::-webkit-scrollbar{display:none}@media screen and (min-width: 768px){.hero.svelte-fvssqr.svelte-fvssqr,.menu-wrapper.svelte-fvssqr.svelte-fvssqr{width:-moz-calc(25% - 0.5rem);width:-webkit-calc(25% - 0.5rem);width:-o-calc(25% - 0.5rem);width:calc(25% - 0.5rem)}.hero.svelte-fvssqr.svelte-fvssqr{position:fixed;padding:0 1.25rem}.menu-wrapper.svelte-fvssqr.svelte-fvssqr{position:fixed;top:140px;padding:1.5rem 1.25rem 1.25rem;height:-moz-calc(100% - 150px - 2.5rem);height:-webkit-calc(100% - 150px - 2.5rem);height:-o-calc(100% - 150px - 2.5rem);height:calc(100% - 150px - 2.5rem);overflow:-moz-scrollbars-none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto;transition:opacity 0.3s, left 0.3s}.menu.is-collapsed.svelte-fvssqr.svelte-fvssqr{width:3rem}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr,.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{width:calc(3rem - 2px)}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr{padding-left:0;padding-right:0}.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{padding-left:0.3175rem;padding-right:0.3175rem;box-shadow:none}.is-collapsed.svelte-fvssqr .input.is-rounded.svelte-fvssqr{padding-left:0;padding-right:0;opacity:0}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr{color:#b5b5b5;background-color:#eee;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;cursor:pointer;pointer-events:auto}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr:hover{color:#999;background-color:#e0e0e0}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr{color:#ccc;background-color:#484848}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr:hover{color:#fff;background-color:#484848}.is-collapsed.svelte-fvssqr .menu-wrapper.svelte-fvssqr{left:-30%;opacity:0}}";
  19249. append(document.head, style);
  19250. }
  19251. function get_each_context_1$3(ctx, list, i) {
  19252. const child_ctx = ctx.slice();
  19253. child_ctx[13] = list[i];
  19254. return child_ctx;
  19255. }
  19256. function get_each_context$6(ctx, list, i) {
  19257. const child_ctx = ctx.slice();
  19258. child_ctx[10] = list[i];
  19259. return child_ctx;
  19260. }
  19261. function get_each_context_2$1(ctx, list, i) {
  19262. const child_ctx = ctx.slice();
  19263. child_ctx[16] = list[i];
  19264. return child_ctx;
  19265. }
  19266. // (169:4) {#if query === ''}
  19267. function create_if_block_1$b(ctx) {
  19268. let if_block_anchor;
  19269. let if_block = /*tagHeaders*/ ctx[3] && create_if_block_2$6(ctx);
  19270. return {
  19271. c() {
  19272. if (if_block) if_block.c();
  19273. if_block_anchor = empty();
  19274. },
  19275. m(target, anchor) {
  19276. if (if_block) if_block.m(target, anchor);
  19277. insert(target, if_block_anchor, anchor);
  19278. },
  19279. p(ctx, dirty) {
  19280. if (/*tagHeaders*/ ctx[3]) {
  19281. if (if_block) {
  19282. if_block.p(ctx, dirty);
  19283. } else {
  19284. if_block = create_if_block_2$6(ctx);
  19285. if_block.c();
  19286. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  19287. }
  19288. } else if (if_block) {
  19289. if_block.d(1);
  19290. if_block = null;
  19291. }
  19292. },
  19293. d(detaching) {
  19294. if (if_block) if_block.d(detaching);
  19295. if (detaching) detach(if_block_anchor);
  19296. }
  19297. };
  19298. }
  19299. // (170:6) {#if tagHeaders}
  19300. function create_if_block_2$6(ctx) {
  19301. let ul1;
  19302. let li;
  19303. let ul0;
  19304. let each_value_2 = /*tagHeaders*/ ctx[3];
  19305. let each_blocks = [];
  19306. for (let i = 0; i < each_value_2.length; i += 1) {
  19307. each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i));
  19308. }
  19309. return {
  19310. c() {
  19311. ul1 = element("ul");
  19312. li = element("li");
  19313. ul0 = element("ul");
  19314. for (let i = 0; i < each_blocks.length; i += 1) {
  19315. each_blocks[i].c();
  19316. }
  19317. attr(ul1, "class", "menu-list");
  19318. },
  19319. m(target, anchor) {
  19320. insert(target, ul1, anchor);
  19321. append(ul1, li);
  19322. append(li, ul0);
  19323. for (let i = 0; i < each_blocks.length; i += 1) {
  19324. each_blocks[i].m(ul0, null);
  19325. }
  19326. },
  19327. p(ctx, dirty) {
  19328. if (dirty & /*headerLink, tagHeaders, tocClick*/ 136) {
  19329. each_value_2 = /*tagHeaders*/ ctx[3];
  19330. let i;
  19331. for (i = 0; i < each_value_2.length; i += 1) {
  19332. const child_ctx = get_each_context_2$1(ctx, each_value_2, i);
  19333. if (each_blocks[i]) {
  19334. each_blocks[i].p(child_ctx, dirty);
  19335. } else {
  19336. each_blocks[i] = create_each_block_2$1(child_ctx);
  19337. each_blocks[i].c();
  19338. each_blocks[i].m(ul0, null);
  19339. }
  19340. }
  19341. for (; i < each_blocks.length; i += 1) {
  19342. each_blocks[i].d(1);
  19343. }
  19344. each_blocks.length = each_value_2.length;
  19345. }
  19346. },
  19347. d(detaching) {
  19348. if (detaching) detach(ul1);
  19349. destroy_each(each_blocks, detaching);
  19350. }
  19351. };
  19352. }
  19353. // (175:16) {#if header.level === 0}
  19354. function create_if_block_3$2(ctx) {
  19355. let li;
  19356. let a;
  19357. let t0_value = /*header*/ ctx[16].text + "";
  19358. let t0;
  19359. let a_href_value;
  19360. let t1;
  19361. let dispose;
  19362. return {
  19363. c() {
  19364. li = element("li");
  19365. a = element("a");
  19366. t0 = text(t0_value);
  19367. t1 = space();
  19368. attr(a, "href", a_href_value = "#" + headerLink(/*header*/ ctx[16].text));
  19369. },
  19370. m(target, anchor) {
  19371. insert(target, li, anchor);
  19372. append(li, a);
  19373. append(a, t0);
  19374. append(li, t1);
  19375. dispose = listen(a, "click", prevent_default(function () {
  19376. if (is_function(/*tocClick*/ ctx[7])) /*tocClick*/ ctx[7].apply(this, arguments);
  19377. }));
  19378. },
  19379. p(new_ctx, dirty) {
  19380. ctx = new_ctx;
  19381. if (dirty & /*tagHeaders*/ 8 && t0_value !== (t0_value = /*header*/ ctx[16].text + "")) set_data(t0, t0_value);
  19382. if (dirty & /*tagHeaders*/ 8 && a_href_value !== (a_href_value = "#" + headerLink(/*header*/ ctx[16].text))) {
  19383. attr(a, "href", a_href_value);
  19384. }
  19385. },
  19386. d(detaching) {
  19387. if (detaching) detach(li);
  19388. dispose();
  19389. }
  19390. };
  19391. }
  19392. // (174:14) {#each tagHeaders as header}
  19393. function create_each_block_2$1(ctx) {
  19394. let if_block_anchor;
  19395. let if_block = /*header*/ ctx[16].level === 0 && create_if_block_3$2(ctx);
  19396. return {
  19397. c() {
  19398. if (if_block) if_block.c();
  19399. if_block_anchor = empty();
  19400. },
  19401. m(target, anchor) {
  19402. if (if_block) if_block.m(target, anchor);
  19403. insert(target, if_block_anchor, anchor);
  19404. },
  19405. p(ctx, dirty) {
  19406. if (/*header*/ ctx[16].level === 0) {
  19407. if (if_block) {
  19408. if_block.p(ctx, dirty);
  19409. } else {
  19410. if_block = create_if_block_3$2(ctx);
  19411. if_block.c();
  19412. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  19413. }
  19414. } else if (if_block) {
  19415. if_block.d(1);
  19416. if_block = null;
  19417. }
  19418. },
  19419. d(detaching) {
  19420. if (if_block) if_block.d(detaching);
  19421. if (detaching) detach(if_block_anchor);
  19422. }
  19423. };
  19424. }
  19425. // (192:6) {#if tag.title}
  19426. function create_if_block$e(ctx) {
  19427. let p;
  19428. let a;
  19429. let t_value = /*tag*/ ctx[10].title + "";
  19430. let t;
  19431. let a_href_value;
  19432. let dispose;
  19433. return {
  19434. c() {
  19435. p = element("p");
  19436. a = element("a");
  19437. t = text(t_value);
  19438. attr(a, "href", a_href_value = buildHref(`#/rg~${slugify(/*tag*/ ctx[10].title)}`));
  19439. attr(a, "class", "is-inline-block");
  19440. attr(p, "class", "menu-label");
  19441. },
  19442. m(target, anchor) {
  19443. insert(target, p, anchor);
  19444. append(p, a);
  19445. append(a, t);
  19446. dispose = listen(a, "click", handleLink);
  19447. },
  19448. p(ctx, dirty) {
  19449. if (dirty & /*tagActions*/ 4 && t_value !== (t_value = /*tag*/ ctx[10].title + "")) set_data(t, t_value);
  19450. if (dirty & /*tagActions*/ 4 && a_href_value !== (a_href_value = buildHref(`#/rg~${slugify(/*tag*/ ctx[10].title)}`))) {
  19451. attr(a, "href", a_href_value);
  19452. }
  19453. },
  19454. d(detaching) {
  19455. if (detaching) detach(p);
  19456. dispose();
  19457. }
  19458. };
  19459. }
  19460. // (204:8) {#each tag.children as child}
  19461. function create_each_block_1$3(ctx) {
  19462. let current;
  19463. const menuitem = new MenuItem({
  19464. props: {
  19465. title: /*child*/ ctx[13].title,
  19466. actions: /*child*/ ctx[13].actions,
  19467. hidden: /*actionsCount*/ ctx[4] > 50,
  19468. parentSlug: slugify(/*tag*/ ctx[10].title)
  19469. }
  19470. });
  19471. return {
  19472. c() {
  19473. create_component(menuitem.$$.fragment);
  19474. },
  19475. m(target, anchor) {
  19476. mount_component(menuitem, target, anchor);
  19477. current = true;
  19478. },
  19479. p(ctx, dirty) {
  19480. const menuitem_changes = {};
  19481. if (dirty & /*tagActions*/ 4) menuitem_changes.title = /*child*/ ctx[13].title;
  19482. if (dirty & /*tagActions*/ 4) menuitem_changes.actions = /*child*/ ctx[13].actions;
  19483. if (dirty & /*actionsCount*/ 16) menuitem_changes.hidden = /*actionsCount*/ ctx[4] > 50;
  19484. if (dirty & /*tagActions*/ 4) menuitem_changes.parentSlug = slugify(/*tag*/ ctx[10].title);
  19485. menuitem.$set(menuitem_changes);
  19486. },
  19487. i(local) {
  19488. if (current) return;
  19489. transition_in(menuitem.$$.fragment, local);
  19490. current = true;
  19491. },
  19492. o(local) {
  19493. transition_out(menuitem.$$.fragment, local);
  19494. current = false;
  19495. },
  19496. d(detaching) {
  19497. destroy_component(menuitem, detaching);
  19498. }
  19499. };
  19500. }
  19501. // (191:4) {#each tagActions as tag}
  19502. function create_each_block$6(ctx) {
  19503. let t0;
  19504. let ul;
  19505. let t1;
  19506. let current;
  19507. let if_block = /*tag*/ ctx[10].title && create_if_block$e(ctx);
  19508. let each_value_1 = /*tag*/ ctx[10].children;
  19509. let each_blocks = [];
  19510. for (let i = 0; i < each_value_1.length; i += 1) {
  19511. each_blocks[i] = create_each_block_1$3(get_each_context_1$3(ctx, each_value_1, i));
  19512. }
  19513. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  19514. each_blocks[i] = null;
  19515. });
  19516. return {
  19517. c() {
  19518. if (if_block) if_block.c();
  19519. t0 = space();
  19520. ul = element("ul");
  19521. for (let i = 0; i < each_blocks.length; i += 1) {
  19522. each_blocks[i].c();
  19523. }
  19524. t1 = space();
  19525. attr(ul, "class", "menu-list");
  19526. },
  19527. m(target, anchor) {
  19528. if (if_block) if_block.m(target, anchor);
  19529. insert(target, t0, anchor);
  19530. insert(target, ul, anchor);
  19531. for (let i = 0; i < each_blocks.length; i += 1) {
  19532. each_blocks[i].m(ul, null);
  19533. }
  19534. append(ul, t1);
  19535. current = true;
  19536. },
  19537. p(ctx, dirty) {
  19538. if (/*tag*/ ctx[10].title) {
  19539. if (if_block) {
  19540. if_block.p(ctx, dirty);
  19541. } else {
  19542. if_block = create_if_block$e(ctx);
  19543. if_block.c();
  19544. if_block.m(t0.parentNode, t0);
  19545. }
  19546. } else if (if_block) {
  19547. if_block.d(1);
  19548. if_block = null;
  19549. }
  19550. if (dirty & /*tagActions, actionsCount, slugify*/ 20) {
  19551. each_value_1 = /*tag*/ ctx[10].children;
  19552. let i;
  19553. for (i = 0; i < each_value_1.length; i += 1) {
  19554. const child_ctx = get_each_context_1$3(ctx, each_value_1, i);
  19555. if (each_blocks[i]) {
  19556. each_blocks[i].p(child_ctx, dirty);
  19557. transition_in(each_blocks[i], 1);
  19558. } else {
  19559. each_blocks[i] = create_each_block_1$3(child_ctx);
  19560. each_blocks[i].c();
  19561. transition_in(each_blocks[i], 1);
  19562. each_blocks[i].m(ul, t1);
  19563. }
  19564. }
  19565. group_outros();
  19566. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  19567. out(i);
  19568. }
  19569. check_outros();
  19570. }
  19571. },
  19572. i(local) {
  19573. if (current) return;
  19574. for (let i = 0; i < each_value_1.length; i += 1) {
  19575. transition_in(each_blocks[i]);
  19576. }
  19577. current = true;
  19578. },
  19579. o(local) {
  19580. each_blocks = each_blocks.filter(Boolean);
  19581. for (let i = 0; i < each_blocks.length; i += 1) {
  19582. transition_out(each_blocks[i]);
  19583. }
  19584. current = false;
  19585. },
  19586. d(detaching) {
  19587. if (if_block) if_block.d(detaching);
  19588. if (detaching) detach(t0);
  19589. if (detaching) detach(ul);
  19590. destroy_each(each_blocks, detaching);
  19591. }
  19592. };
  19593. }
  19594. function create_fragment$k(ctx) {
  19595. let aside;
  19596. let section;
  19597. let div1;
  19598. let div0;
  19599. let p0;
  19600. let input;
  19601. let t0;
  19602. let span;
  19603. let t1;
  19604. let div2;
  19605. let p1;
  19606. let a;
  19607. let t2;
  19608. let a_href_value;
  19609. let t3;
  19610. let t4;
  19611. let current;
  19612. let dispose;
  19613. let if_block = /*query*/ ctx[0] === "" && create_if_block_1$b(ctx);
  19614. let each_value = /*tagActions*/ ctx[2];
  19615. let each_blocks = [];
  19616. for (let i = 0; i < each_value.length; i += 1) {
  19617. each_blocks[i] = create_each_block$6(get_each_context$6(ctx, each_value, i));
  19618. }
  19619. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  19620. each_blocks[i] = null;
  19621. });
  19622. return {
  19623. c() {
  19624. aside = element("aside");
  19625. section = element("section");
  19626. div1 = element("div");
  19627. div0 = element("div");
  19628. p0 = element("p");
  19629. input = element("input");
  19630. t0 = space();
  19631. span = element("span");
  19632. span.innerHTML = `<i class="fas fa-search"></i>`;
  19633. t1 = space();
  19634. div2 = element("div");
  19635. p1 = element("p");
  19636. a = element("a");
  19637. t2 = text(/*title*/ ctx[1]);
  19638. t3 = space();
  19639. if (if_block) if_block.c();
  19640. t4 = space();
  19641. for (let i = 0; i < each_blocks.length; i += 1) {
  19642. each_blocks[i].c();
  19643. }
  19644. attr(input, "id", "search-input-text");
  19645. attr(input, "class", "input is-rounded svelte-fvssqr");
  19646. attr(input, "placeholder", "Filter by path, method, and title...");
  19647. attr(span, "class", "icon is-right icon-input-search svelte-fvssqr");
  19648. attr(p0, "class", "control has-icons-right");
  19649. attr(div0, "class", "field");
  19650. attr(div1, "class", "hero-body svelte-fvssqr");
  19651. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]);
  19652. attr(section, "class", "hero is-sticky svelte-fvssqr");
  19653. toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]);
  19654. attr(a, "href", a_href_value = buildHref(""));
  19655. attr(p1, "class", "menu-label");
  19656. attr(div2, "class", "menu-wrapper svelte-fvssqr");
  19657. attr(aside, "class", "menu svelte-fvssqr");
  19658. toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]);
  19659. },
  19660. m(target, anchor) {
  19661. insert(target, aside, anchor);
  19662. append(aside, section);
  19663. append(section, div1);
  19664. append(div1, div0);
  19665. append(div0, p0);
  19666. append(p0, input);
  19667. set_input_value(input, /*query*/ ctx[0]);
  19668. append(p0, t0);
  19669. append(p0, span);
  19670. append(aside, t1);
  19671. append(aside, div2);
  19672. append(div2, p1);
  19673. append(p1, a);
  19674. append(a, t2);
  19675. append(div2, t3);
  19676. if (if_block) if_block.m(div2, null);
  19677. append(div2, t4);
  19678. for (let i = 0; i < each_blocks.length; i += 1) {
  19679. each_blocks[i].m(div2, null);
  19680. }
  19681. current = true;
  19682. dispose = [
  19683. listen(input, "input", /*input_input_handler*/ ctx[9]),
  19684. listen(span, "click", function () {
  19685. if (is_function(/*searchClick*/ ctx[8])) /*searchClick*/ ctx[8].apply(this, arguments);
  19686. }),
  19687. listen(a, "click", prevent_default(function () {
  19688. if (is_function(/*tocClick*/ ctx[7])) /*tocClick*/ ctx[7].apply(this, arguments);
  19689. }))
  19690. ];
  19691. },
  19692. p(new_ctx, [dirty]) {
  19693. ctx = new_ctx;
  19694. if (dirty & /*query*/ 1 && input.value !== /*query*/ ctx[0]) {
  19695. set_input_value(input, /*query*/ ctx[0]);
  19696. }
  19697. if (dirty & /*isDarkmode*/ 64) {
  19698. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]);
  19699. }
  19700. if (dirty & /*isDarkmode*/ 64) {
  19701. toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]);
  19702. }
  19703. if (!current || dirty & /*title*/ 2) set_data(t2, /*title*/ ctx[1]);
  19704. if (/*query*/ ctx[0] === "") {
  19705. if (if_block) {
  19706. if_block.p(ctx, dirty);
  19707. } else {
  19708. if_block = create_if_block_1$b(ctx);
  19709. if_block.c();
  19710. if_block.m(div2, t4);
  19711. }
  19712. } else if (if_block) {
  19713. if_block.d(1);
  19714. if_block = null;
  19715. }
  19716. if (dirty & /*tagActions, actionsCount, slugify, buildHref, handleLink*/ 20) {
  19717. each_value = /*tagActions*/ ctx[2];
  19718. let i;
  19719. for (i = 0; i < each_value.length; i += 1) {
  19720. const child_ctx = get_each_context$6(ctx, each_value, i);
  19721. if (each_blocks[i]) {
  19722. each_blocks[i].p(child_ctx, dirty);
  19723. transition_in(each_blocks[i], 1);
  19724. } else {
  19725. each_blocks[i] = create_each_block$6(child_ctx);
  19726. each_blocks[i].c();
  19727. transition_in(each_blocks[i], 1);
  19728. each_blocks[i].m(div2, null);
  19729. }
  19730. }
  19731. group_outros();
  19732. for (i = each_value.length; i < each_blocks.length; i += 1) {
  19733. out(i);
  19734. }
  19735. check_outros();
  19736. }
  19737. if (dirty & /*isCollapsed*/ 32) {
  19738. toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]);
  19739. }
  19740. },
  19741. i(local) {
  19742. if (current) return;
  19743. for (let i = 0; i < each_value.length; i += 1) {
  19744. transition_in(each_blocks[i]);
  19745. }
  19746. current = true;
  19747. },
  19748. o(local) {
  19749. each_blocks = each_blocks.filter(Boolean);
  19750. for (let i = 0; i < each_blocks.length; i += 1) {
  19751. transition_out(each_blocks[i]);
  19752. }
  19753. current = false;
  19754. },
  19755. d(detaching) {
  19756. if (detaching) detach(aside);
  19757. if (if_block) if_block.d();
  19758. destroy_each(each_blocks, detaching);
  19759. run_all(dispose);
  19760. }
  19761. };
  19762. }
  19763. function headerLink(text) {
  19764. return text.toLowerCase().replace(/\s/g, "-");
  19765. }
  19766. function instance$k($$self, $$props, $$invalidate) {
  19767. let { title } = $$props;
  19768. let { tagActions = [] } = $$props;
  19769. let { tagHeaders = [] } = $$props;
  19770. let { actionsCount } = $$props;
  19771. let { isCollapsed } = $$props;
  19772. let { isDarkmode } = $$props;
  19773. let { tocClick } = $$props;
  19774. let { searchClick } = $$props;
  19775. let { query } = $$props;
  19776. function input_input_handler() {
  19777. query = this.value;
  19778. $$invalidate(0, query);
  19779. }
  19780. $$self.$set = $$props => {
  19781. if ("title" in $$props) $$invalidate(1, title = $$props.title);
  19782. if ("tagActions" in $$props) $$invalidate(2, tagActions = $$props.tagActions);
  19783. if ("tagHeaders" in $$props) $$invalidate(3, tagHeaders = $$props.tagHeaders);
  19784. if ("actionsCount" in $$props) $$invalidate(4, actionsCount = $$props.actionsCount);
  19785. if ("isCollapsed" in $$props) $$invalidate(5, isCollapsed = $$props.isCollapsed);
  19786. if ("isDarkmode" in $$props) $$invalidate(6, isDarkmode = $$props.isDarkmode);
  19787. if ("tocClick" in $$props) $$invalidate(7, tocClick = $$props.tocClick);
  19788. if ("searchClick" in $$props) $$invalidate(8, searchClick = $$props.searchClick);
  19789. if ("query" in $$props) $$invalidate(0, query = $$props.query);
  19790. };
  19791. return [
  19792. query,
  19793. title,
  19794. tagActions,
  19795. tagHeaders,
  19796. actionsCount,
  19797. isCollapsed,
  19798. isDarkmode,
  19799. tocClick,
  19800. searchClick,
  19801. input_input_handler
  19802. ];
  19803. }
  19804. class MenuPanel extends SvelteComponent {
  19805. constructor(options) {
  19806. super();
  19807. if (!document.getElementById("svelte-fvssqr-style")) add_css$a();
  19808. init(this, options, instance$k, create_fragment$k, safe_not_equal, {
  19809. title: 1,
  19810. tagActions: 2,
  19811. tagHeaders: 3,
  19812. actionsCount: 4,
  19813. isCollapsed: 5,
  19814. isDarkmode: 6,
  19815. tocClick: 7,
  19816. searchClick: 8,
  19817. query: 0
  19818. });
  19819. }
  19820. }
  19821. /* usr/local/lib/node_modules/snowboard/templates/winter/components/LogoutButton.svelte generated by Svelte v3.19.2 */
  19822. function create_fragment$l(ctx) {
  19823. let a;
  19824. let dispose;
  19825. return {
  19826. c() {
  19827. a = element("a");
  19828. a.innerHTML = `<span class="icon has-text-grey"><i class="fas fa-sign-out-alt" aria-hidden="true"></i></span>
  19829. <span>Logout</span>`;
  19830. attr(a, "href", "javascript:void(0)");
  19831. attr(a, "class", "button is-light");
  19832. },
  19833. m(target, anchor) {
  19834. insert(target, a, anchor);
  19835. dispose = listen(a, "click", /*handleClick*/ ctx[0]);
  19836. },
  19837. p: noop,
  19838. i: noop,
  19839. o: noop,
  19840. d(detaching) {
  19841. if (detaching) detach(a);
  19842. dispose();
  19843. }
  19844. };
  19845. }
  19846. function instance$l($$self, $$props, $$invalidate) {
  19847. let $env;
  19848. component_subscribe($$self, env, $$value => $$invalidate(1, $env = $$value));
  19849. function handleClick() {
  19850. auth.remove($env);
  19851. removeToken($env);
  19852. removeRefreshToken($env);
  19853. }
  19854. return [handleClick];
  19855. }
  19856. class LogoutButton extends SvelteComponent {
  19857. constructor(options) {
  19858. super();
  19859. init(this, options, instance$l, create_fragment$l, safe_not_equal, {});
  19860. }
  19861. }
  19862. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/SelectorPanel.svelte generated by Svelte v3.19.2 */
  19863. function add_css$b() {
  19864. var style = element("style");
  19865. style.id = "svelte-cjzzpf-style";
  19866. style.textContent = ".icon-info.svelte-cjzzpf{cursor:pointer}.content.svelte-cjzzpf{padding:1rem 1.5rem}";
  19867. append(document.head, style);
  19868. }
  19869. function get_each_context$7(ctx, list, i) {
  19870. const child_ctx = ctx.slice();
  19871. child_ctx[10] = list[i];
  19872. return child_ctx;
  19873. }
  19874. // (52:0) {#if isAuth(environment, 'oauth2')}
  19875. function create_if_block_1$c(ctx) {
  19876. let current_block_type_index;
  19877. let if_block;
  19878. let if_block_anchor;
  19879. let current;
  19880. const if_block_creators = [create_if_block_2$7, create_if_block_3$3, create_else_block_1$2];
  19881. const if_blocks = [];
  19882. function select_block_type(ctx, dirty) {
  19883. if (/*authenticating*/ ctx[1]) return 0;
  19884. if (/*authenticated*/ ctx[3]) return 1;
  19885. return 2;
  19886. }
  19887. current_block_type_index = select_block_type(ctx, -1);
  19888. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  19889. return {
  19890. c() {
  19891. if_block.c();
  19892. if_block_anchor = empty();
  19893. },
  19894. m(target, anchor) {
  19895. if_blocks[current_block_type_index].m(target, anchor);
  19896. insert(target, if_block_anchor, anchor);
  19897. current = true;
  19898. },
  19899. p(ctx, dirty) {
  19900. let previous_block_index = current_block_type_index;
  19901. current_block_type_index = select_block_type(ctx, dirty);
  19902. if (current_block_type_index === previous_block_index) {
  19903. if_blocks[current_block_type_index].p(ctx, dirty);
  19904. } else {
  19905. group_outros();
  19906. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  19907. if_blocks[previous_block_index] = null;
  19908. });
  19909. check_outros();
  19910. if_block = if_blocks[current_block_type_index];
  19911. if (!if_block) {
  19912. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  19913. if_block.c();
  19914. }
  19915. transition_in(if_block, 1);
  19916. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  19917. }
  19918. },
  19919. i(local) {
  19920. if (current) return;
  19921. transition_in(if_block);
  19922. current = true;
  19923. },
  19924. o(local) {
  19925. transition_out(if_block);
  19926. current = false;
  19927. },
  19928. d(detaching) {
  19929. if_blocks[current_block_type_index].d(detaching);
  19930. if (detaching) detach(if_block_anchor);
  19931. }
  19932. };
  19933. }
  19934. // (67:2) {:else}
  19935. function create_else_block_1$2(ctx) {
  19936. let div1;
  19937. let div0;
  19938. let p;
  19939. let current;
  19940. const loginbutton = new LoginButton({
  19941. props: {
  19942. authOptions: /*environment*/ ctx[5].auth.options,
  19943. isPKCE: isPKCE(/*environment*/ ctx[5]),
  19944. pkceChallenge: /*pkceChallenge*/ ctx[2]
  19945. }
  19946. });
  19947. return {
  19948. c() {
  19949. div1 = element("div");
  19950. div0 = element("div");
  19951. p = element("p");
  19952. create_component(loginbutton.$$.fragment);
  19953. attr(p, "class", "control");
  19954. attr(div0, "class", "field is-grouped");
  19955. attr(div1, "class", "navbar-item");
  19956. },
  19957. m(target, anchor) {
  19958. insert(target, div1, anchor);
  19959. append(div1, div0);
  19960. append(div0, p);
  19961. mount_component(loginbutton, p, null);
  19962. current = true;
  19963. },
  19964. p(ctx, dirty) {
  19965. const loginbutton_changes = {};
  19966. if (dirty & /*environment*/ 32) loginbutton_changes.authOptions = /*environment*/ ctx[5].auth.options;
  19967. if (dirty & /*environment*/ 32) loginbutton_changes.isPKCE = isPKCE(/*environment*/ ctx[5]);
  19968. if (dirty & /*pkceChallenge*/ 4) loginbutton_changes.pkceChallenge = /*pkceChallenge*/ ctx[2];
  19969. loginbutton.$set(loginbutton_changes);
  19970. },
  19971. i(local) {
  19972. if (current) return;
  19973. transition_in(loginbutton.$$.fragment, local);
  19974. current = true;
  19975. },
  19976. o(local) {
  19977. transition_out(loginbutton.$$.fragment, local);
  19978. current = false;
  19979. },
  19980. d(detaching) {
  19981. if (detaching) detach(div1);
  19982. destroy_component(loginbutton);
  19983. }
  19984. };
  19985. }
  19986. // (59:26)
  19987. function create_if_block_3$3(ctx) {
  19988. let div1;
  19989. let div0;
  19990. let p;
  19991. let current;
  19992. const logoutbutton = new LogoutButton({});
  19993. return {
  19994. c() {
  19995. div1 = element("div");
  19996. div0 = element("div");
  19997. p = element("p");
  19998. create_component(logoutbutton.$$.fragment);
  19999. attr(p, "class", "control");
  20000. attr(div0, "class", "field is-grouped");
  20001. attr(div1, "class", "navbar-item");
  20002. },
  20003. m(target, anchor) {
  20004. insert(target, div1, anchor);
  20005. append(div1, div0);
  20006. append(div0, p);
  20007. mount_component(logoutbutton, p, null);
  20008. current = true;
  20009. },
  20010. p: noop,
  20011. i(local) {
  20012. if (current) return;
  20013. transition_in(logoutbutton.$$.fragment, local);
  20014. current = true;
  20015. },
  20016. o(local) {
  20017. transition_out(logoutbutton.$$.fragment, local);
  20018. current = false;
  20019. },
  20020. d(detaching) {
  20021. if (detaching) detach(div1);
  20022. destroy_component(logoutbutton);
  20023. }
  20024. };
  20025. }
  20026. // (53:2) {#if authenticating}
  20027. function create_if_block_2$7(ctx) {
  20028. let div;
  20029. return {
  20030. c() {
  20031. div = element("div");
  20032. div.innerHTML = `<span class="icon is-medium has-text-danger"><i class="fas fa-2x fa-spinner fa-pulse"></i></span>`;
  20033. attr(div, "class", "navbar-item");
  20034. },
  20035. m(target, anchor) {
  20036. insert(target, div, anchor);
  20037. },
  20038. p: noop,
  20039. i: noop,
  20040. o: noop,
  20041. d(detaching) {
  20042. if (detaching) detach(div);
  20043. }
  20044. };
  20045. }
  20046. // (87:4) {#each Object.keys(environments) as envName}
  20047. function create_each_block$7(ctx) {
  20048. let a;
  20049. let t0_value = /*envName*/ ctx[10] + "";
  20050. let t0;
  20051. let t1;
  20052. let a_data_name_value;
  20053. let dispose;
  20054. return {
  20055. c() {
  20056. a = element("a");
  20057. t0 = text(t0_value);
  20058. t1 = space();
  20059. attr(a, "data-name", a_data_name_value = /*envName*/ ctx[10]);
  20060. attr(a, "href", "javascript:void(0)");
  20061. attr(a, "class", "navbar-item");
  20062. },
  20063. m(target, anchor) {
  20064. insert(target, a, anchor);
  20065. append(a, t0);
  20066. append(a, t1);
  20067. dispose = listen(a, "click", /*handleClick*/ ctx[7]);
  20068. },
  20069. p(ctx, dirty) {
  20070. if (dirty & /*environments*/ 1 && t0_value !== (t0_value = /*envName*/ ctx[10] + "")) set_data(t0, t0_value);
  20071. if (dirty & /*environments*/ 1 && a_data_name_value !== (a_data_name_value = /*envName*/ ctx[10])) {
  20072. attr(a, "data-name", a_data_name_value);
  20073. }
  20074. },
  20075. d(detaching) {
  20076. if (detaching) detach(a);
  20077. dispose();
  20078. }
  20079. };
  20080. }
  20081. // (113:8) {:else}
  20082. function create_else_block$7(ctx) {
  20083. let span;
  20084. return {
  20085. c() {
  20086. span = element("span");
  20087. span.textContent = "None";
  20088. attr(span, "class", "is-capitalized");
  20089. },
  20090. m(target, anchor) {
  20091. insert(target, span, anchor);
  20092. },
  20093. p: noop,
  20094. d(detaching) {
  20095. if (detaching) detach(span);
  20096. }
  20097. };
  20098. }
  20099. // (111:8) {#if environment.auth}
  20100. function create_if_block$f(ctx) {
  20101. let span;
  20102. let t_value = /*environment*/ ctx[5].auth.name + "";
  20103. let t;
  20104. return {
  20105. c() {
  20106. span = element("span");
  20107. t = text(t_value);
  20108. attr(span, "class", "is-capitalized");
  20109. },
  20110. m(target, anchor) {
  20111. insert(target, span, anchor);
  20112. append(span, t);
  20113. },
  20114. p(ctx, dirty) {
  20115. if (dirty & /*environment*/ 32 && t_value !== (t_value = /*environment*/ ctx[5].auth.name + "")) set_data(t, t_value);
  20116. },
  20117. d(detaching) {
  20118. if (detaching) detach(span);
  20119. }
  20120. };
  20121. }
  20122. function create_fragment$m(ctx) {
  20123. let show_if = isAuth(/*environment*/ ctx[5], "oauth2");
  20124. let t0;
  20125. let div1;
  20126. let a0;
  20127. let t1;
  20128. let t2;
  20129. let div0;
  20130. let t3;
  20131. let div4;
  20132. let a1;
  20133. let t4;
  20134. let div3;
  20135. let div2;
  20136. let p0;
  20137. let t5;
  20138. let t6_value = /*environment*/ ctx[5].url + "";
  20139. let t6;
  20140. let t7;
  20141. let p1;
  20142. let t8;
  20143. let current;
  20144. let dispose;
  20145. let if_block0 = show_if && create_if_block_1$c(ctx);
  20146. let each_value = Object.keys(/*environments*/ ctx[0]);
  20147. let each_blocks = [];
  20148. for (let i = 0; i < each_value.length; i += 1) {
  20149. each_blocks[i] = create_each_block$7(get_each_context$7(ctx, each_value, i));
  20150. }
  20151. function select_block_type_1(ctx, dirty) {
  20152. if (/*environment*/ ctx[5].auth) return create_if_block$f;
  20153. return create_else_block$7;
  20154. }
  20155. let current_block_type = select_block_type_1(ctx, -1);
  20156. let if_block1 = current_block_type(ctx);
  20157. return {
  20158. c() {
  20159. if (if_block0) if_block0.c();
  20160. t0 = space();
  20161. div1 = element("div");
  20162. a0 = element("a");
  20163. t1 = text(/*$env*/ ctx[6]);
  20164. t2 = space();
  20165. div0 = element("div");
  20166. for (let i = 0; i < each_blocks.length; i += 1) {
  20167. each_blocks[i].c();
  20168. }
  20169. t3 = space();
  20170. div4 = element("div");
  20171. a1 = element("a");
  20172. a1.innerHTML = `<span class="icon icon-info is-medium has-text-grey-light svelte-cjzzpf"><i class="fas fa-lg fa-info-circle"></i></span>`;
  20173. t4 = space();
  20174. div3 = element("div");
  20175. div2 = element("div");
  20176. p0 = element("p");
  20177. t5 = text("BaseURL: ");
  20178. t6 = text(t6_value);
  20179. t7 = space();
  20180. p1 = element("p");
  20181. t8 = text("Auth:\n ");
  20182. if_block1.c();
  20183. attr(a0, "href", "javascript:void(0)");
  20184. attr(a0, "class", "navbar-link");
  20185. attr(div0, "class", "navbar-dropdown is-right");
  20186. attr(div1, "class", "navbar-item has-dropdown is-capitalized");
  20187. toggle_class(div1, "is-active", /*show*/ ctx[4]);
  20188. attr(a1, "href", "javascript:void(0)");
  20189. attr(a1, "class", "navbar-link is-arrowless");
  20190. attr(div2, "class", "content svelte-cjzzpf");
  20191. attr(div3, "class", "navbar-dropdown is-right");
  20192. attr(div4, "class", "navbar-item has-dropdown is-hoverable");
  20193. },
  20194. m(target, anchor) {
  20195. if (if_block0) if_block0.m(target, anchor);
  20196. insert(target, t0, anchor);
  20197. insert(target, div1, anchor);
  20198. append(div1, a0);
  20199. append(a0, t1);
  20200. append(div1, t2);
  20201. append(div1, div0);
  20202. for (let i = 0; i < each_blocks.length; i += 1) {
  20203. each_blocks[i].m(div0, null);
  20204. }
  20205. insert(target, t3, anchor);
  20206. insert(target, div4, anchor);
  20207. append(div4, a1);
  20208. append(div4, t4);
  20209. append(div4, div3);
  20210. append(div3, div2);
  20211. append(div2, p0);
  20212. append(p0, t5);
  20213. append(p0, t6);
  20214. append(div2, t7);
  20215. append(div2, p1);
  20216. append(p1, t8);
  20217. if_block1.m(p1, null);
  20218. current = true;
  20219. dispose = listen(a0, "click", /*toggleClick*/ ctx[8]);
  20220. },
  20221. p(ctx, [dirty]) {
  20222. if (dirty & /*environment*/ 32) show_if = isAuth(/*environment*/ ctx[5], "oauth2");
  20223. if (show_if) {
  20224. if (if_block0) {
  20225. if_block0.p(ctx, dirty);
  20226. transition_in(if_block0, 1);
  20227. } else {
  20228. if_block0 = create_if_block_1$c(ctx);
  20229. if_block0.c();
  20230. transition_in(if_block0, 1);
  20231. if_block0.m(t0.parentNode, t0);
  20232. }
  20233. } else if (if_block0) {
  20234. group_outros();
  20235. transition_out(if_block0, 1, 1, () => {
  20236. if_block0 = null;
  20237. });
  20238. check_outros();
  20239. }
  20240. if (!current || dirty & /*$env*/ 64) set_data(t1, /*$env*/ ctx[6]);
  20241. if (dirty & /*Object, environments, handleClick*/ 129) {
  20242. each_value = Object.keys(/*environments*/ ctx[0]);
  20243. let i;
  20244. for (i = 0; i < each_value.length; i += 1) {
  20245. const child_ctx = get_each_context$7(ctx, each_value, i);
  20246. if (each_blocks[i]) {
  20247. each_blocks[i].p(child_ctx, dirty);
  20248. } else {
  20249. each_blocks[i] = create_each_block$7(child_ctx);
  20250. each_blocks[i].c();
  20251. each_blocks[i].m(div0, null);
  20252. }
  20253. }
  20254. for (; i < each_blocks.length; i += 1) {
  20255. each_blocks[i].d(1);
  20256. }
  20257. each_blocks.length = each_value.length;
  20258. }
  20259. if (dirty & /*show*/ 16) {
  20260. toggle_class(div1, "is-active", /*show*/ ctx[4]);
  20261. }
  20262. if ((!current || dirty & /*environment*/ 32) && t6_value !== (t6_value = /*environment*/ ctx[5].url + "")) set_data(t6, t6_value);
  20263. if (current_block_type === (current_block_type = select_block_type_1(ctx, dirty)) && if_block1) {
  20264. if_block1.p(ctx, dirty);
  20265. } else {
  20266. if_block1.d(1);
  20267. if_block1 = current_block_type(ctx);
  20268. if (if_block1) {
  20269. if_block1.c();
  20270. if_block1.m(p1, null);
  20271. }
  20272. }
  20273. },
  20274. i(local) {
  20275. if (current) return;
  20276. transition_in(if_block0);
  20277. current = true;
  20278. },
  20279. o(local) {
  20280. transition_out(if_block0);
  20281. current = false;
  20282. },
  20283. d(detaching) {
  20284. if (if_block0) if_block0.d(detaching);
  20285. if (detaching) detach(t0);
  20286. if (detaching) detach(div1);
  20287. destroy_each(each_blocks, detaching);
  20288. if (detaching) detach(t3);
  20289. if (detaching) detach(div4);
  20290. if_block1.d();
  20291. dispose();
  20292. }
  20293. };
  20294. }
  20295. function instance$m($$self, $$props, $$invalidate) {
  20296. let $env;
  20297. let $auth;
  20298. component_subscribe($$self, env, $$value => $$invalidate(6, $env = $$value));
  20299. component_subscribe($$self, auth, $$value => $$invalidate(9, $auth = $$value));
  20300. let { environments } = $$props;
  20301. let { authenticating } = $$props;
  20302. let { pkceChallenge } = $$props;
  20303. let authenticated = false;
  20304. let show = false;
  20305. function handleClick(event) {
  20306. $$invalidate(4, show = false);
  20307. const envName = event.target.dataset["name"];
  20308. env.set(envName);
  20309. const authToken = getToken($env);
  20310. if (authToken) {
  20311. auth.add(envName);
  20312. token$1.set(authToken);
  20313. } else {
  20314. auth.remove(envName);
  20315. token$1.set(null);
  20316. }
  20317. }
  20318. function toggleClick() {
  20319. $$invalidate(4, show = !show);
  20320. }
  20321. $$self.$set = $$props => {
  20322. if ("environments" in $$props) $$invalidate(0, environments = $$props.environments);
  20323. if ("authenticating" in $$props) $$invalidate(1, authenticating = $$props.authenticating);
  20324. if ("pkceChallenge" in $$props) $$invalidate(2, pkceChallenge = $$props.pkceChallenge);
  20325. };
  20326. let environment;
  20327. $$self.$$.update = () => {
  20328. if ($$self.$$.dirty & /*environments, $env*/ 65) {
  20329. $$invalidate(5, environment = environments[$env]);
  20330. }
  20331. if ($$self.$$.dirty & /*$auth, $env*/ 576) {
  20332. {
  20333. $$invalidate(3, authenticated = $auth.split(";").includes($env));
  20334. }
  20335. }
  20336. };
  20337. return [
  20338. environments,
  20339. authenticating,
  20340. pkceChallenge,
  20341. authenticated,
  20342. show,
  20343. environment,
  20344. $env,
  20345. handleClick,
  20346. toggleClick
  20347. ];
  20348. }
  20349. class SelectorPanel extends SvelteComponent {
  20350. constructor(options) {
  20351. super();
  20352. if (!document.getElementById("svelte-cjzzpf-style")) add_css$b();
  20353. init(this, options, instance$m, create_fragment$m, safe_not_equal, {
  20354. environments: 0,
  20355. authenticating: 1,
  20356. pkceChallenge: 2
  20357. });
  20358. }
  20359. }
  20360. /* usr/local/lib/node_modules/snowboard/templates/winter.svelte generated by Svelte v3.19.2 */
  20361. const { document: document_1 } = globals;
  20362. function add_css$c() {
  20363. var style = element("style");
  20364. style.id = "svelte-1s8fs56-style";
  20365. style.textContent = "html{height:100%}body{min-height:100%}.sidenav.svelte-1s8fs56.svelte-1s8fs56{padding:1rem 0 1rem 0.75rem}.main.svelte-1s8fs56.svelte-1s8fs56{padding:3rem;background-color:#fff;box-shadow:0 2px 0 2px #f5f5f5}.main.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{background-color:#000;box-shadow:0 2px 0 2px #363636}.body-inner.svelte-1s8fs56.svelte-1s8fs56{min-height:100vh;background-color:#fafafa}.body-inner.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{background-color:#000}.is-darkmode .input, .is-darkmode .select select, .is-darkmode\n .textarea{background-color:#484848;border-color:#484848;color:#fff}.is-darkmode .input:hover, .is-darkmode\n .is-hovered.input, .is-darkmode .is-hovered.textarea, .is-darkmode\n .select\n select.is-hovered, .is-darkmode .select select:hover, .is-darkmode\n .textarea:hover{border-color:#666}.is-darkmode .select select.is-focused, .is-darkmode\n .select\n select:active, .is-darkmode .select select:focus, .is-darkmode\n .textarea:active, .is-darkmode .textarea:focus{border-color:#888}.is-darkmode .input::placeholder, .is-darkmode\n .select\n select::placeholder, .is-darkmode .textarea::placeholder{color:#ccc}code[class*=\"language-\"], pre[class*=\"language-\"]{font-family:monospace}.token.number, .token.tag{display:inline;padding:inherit;font-size:inherit;line-height:inherit;text-align:inherit;vertical-align:inherit;border-radius:inherit;font-weight:inherit;white-space:inherit;background:inherit;margin:inherit}.icon-brand.svelte-1s8fs56.svelte-1s8fs56{margin-right:0.5rem}.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56{display:none;position:fixed;width:calc(25% - 0.5rem);height:calc(2.5rem + 10px);left:0;bottom:0;font-size:1.33333em;line-height:calc(2.5rem + 5px);text-align:center;color:#b5b5b5;font-weight:300;border-top:1px solid #eee;box-shadow:2px 0 0 #f5f5f5;cursor:pointer}.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56:hover{background:rgba(0, 0, 0, 0.05);box-shadow:2px 0 0 #eee;border-color:#e8e8e8}.menu-collapsible.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{border-color:#363636;box-shadow:2px 0 0 #363636}.menu-collapsible.is-darkmode.svelte-1s8fs56.svelte-1s8fs56:hover{background:rgba(255, 255, 255, 0.2);border-color:#363636;box-shadow:2px 0 0 #363636}.footer.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{background-color:#000}.footer.svelte-1s8fs56 .content.svelte-1s8fs56{transition:margin 0.3s}@media screen and (min-width: 768px){.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56{display:block}.is-collapsed.svelte-1s8fs56 .sidenav.svelte-1s8fs56{width:3.75rem}.is-collapsed.svelte-1s8fs56 .main.svelte-1s8fs56{width:calc(100% - 4.5rem)}.is-collapsed.svelte-1s8fs56 .menu-collapsible.svelte-1s8fs56{width:calc(3rem - 2px)}.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56,.sidenav.svelte-1s8fs56.svelte-1s8fs56,.main.svelte-1s8fs56.svelte-1s8fs56{transition:width 0.3s}.content.svelte-1s8fs56.svelte-1s8fs56{scroll-margin:200px}}";
  20366. append(document_1.head, style);
  20367. }
  20368. // (412:6) <Link href="/" class="navbar-item">
  20369. function create_default_slot_3(ctx) {
  20370. let span0;
  20371. let t0;
  20372. let span1;
  20373. let t1;
  20374. return {
  20375. c() {
  20376. span0 = element("span");
  20377. span0.innerHTML = `<i class="fas fa-lg fa-chalkboard"></i>`;
  20378. t0 = space();
  20379. span1 = element("span");
  20380. t1 = text(/*title*/ ctx[0]);
  20381. attr(span0, "class", "icon icon-brand is-medium has-text-grey-light svelte-1s8fs56");
  20382. attr(span1, "class", "title is-4");
  20383. },
  20384. m(target, anchor) {
  20385. insert(target, span0, anchor);
  20386. insert(target, t0, anchor);
  20387. insert(target, span1, anchor);
  20388. append(span1, t1);
  20389. },
  20390. p(ctx, dirty) {
  20391. if (dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]);
  20392. },
  20393. d(detaching) {
  20394. if (detaching) detach(span0);
  20395. if (detaching) detach(t0);
  20396. if (detaching) detach(span1);
  20397. }
  20398. };
  20399. }
  20400. // (435:8) {#if config.playground.enabled}
  20401. function create_if_block_3$4(ctx) {
  20402. let current;
  20403. const selectorpanel = new SelectorPanel({
  20404. props: {
  20405. environments: /*config*/ ctx[3].playground.environments,
  20406. pkceChallenge: /*challengePair*/ ctx[12],
  20407. authenticating: /*authenticating*/ ctx[6]
  20408. }
  20409. });
  20410. return {
  20411. c() {
  20412. create_component(selectorpanel.$$.fragment);
  20413. },
  20414. m(target, anchor) {
  20415. mount_component(selectorpanel, target, anchor);
  20416. current = true;
  20417. },
  20418. p(ctx, dirty) {
  20419. const selectorpanel_changes = {};
  20420. if (dirty & /*config*/ 8) selectorpanel_changes.environments = /*config*/ ctx[3].playground.environments;
  20421. if (dirty & /*authenticating*/ 64) selectorpanel_changes.authenticating = /*authenticating*/ ctx[6];
  20422. selectorpanel.$set(selectorpanel_changes);
  20423. },
  20424. i(local) {
  20425. if (current) return;
  20426. transition_in(selectorpanel.$$.fragment, local);
  20427. current = true;
  20428. },
  20429. o(local) {
  20430. transition_out(selectorpanel.$$.fragment, local);
  20431. current = false;
  20432. },
  20433. d(detaching) {
  20434. destroy_component(selectorpanel, detaching);
  20435. }
  20436. };
  20437. }
  20438. // (441:8) {#if darkMode.enable}
  20439. function create_if_block_2$8(ctx) {
  20440. let div;
  20441. let a;
  20442. let span;
  20443. let i;
  20444. let dispose;
  20445. return {
  20446. c() {
  20447. div = element("div");
  20448. a = element("a");
  20449. span = element("span");
  20450. i = element("i");
  20451. attr(i, "class", "fas fa-lg");
  20452. toggle_class(i, "fa-moon", /*darkMode*/ ctx[7].active);
  20453. toggle_class(i, "fa-sun", !/*darkMode*/ ctx[7].active);
  20454. attr(span, "class", "icon is-medium has-text-grey-light");
  20455. attr(a, "href", "javascript:void(0)");
  20456. attr(a, "title", "Dark Mode");
  20457. attr(a, "class", "navbar-link is-arrowless");
  20458. attr(div, "class", "navbar-item has-dropdown is-hoverable");
  20459. },
  20460. m(target, anchor) {
  20461. insert(target, div, anchor);
  20462. append(div, a);
  20463. append(a, span);
  20464. append(span, i);
  20465. dispose = listen(a, "click", /*darkToggle*/ ctx[16]);
  20466. },
  20467. p(ctx, dirty) {
  20468. if (dirty & /*darkMode*/ 128) {
  20469. toggle_class(i, "fa-moon", /*darkMode*/ ctx[7].active);
  20470. }
  20471. if (dirty & /*darkMode*/ 128) {
  20472. toggle_class(i, "fa-sun", !/*darkMode*/ ctx[7].active);
  20473. }
  20474. },
  20475. d(detaching) {
  20476. if (detaching) detach(div);
  20477. dispose();
  20478. }
  20479. };
  20480. }
  20481. // (481:8) {#if collapsed}
  20482. function create_if_block_1$d(ctx) {
  20483. let span;
  20484. return {
  20485. c() {
  20486. span = element("span");
  20487. span.textContent = "»";
  20488. attr(span, "class", "icon");
  20489. attr(span, "title", "Expand [");
  20490. },
  20491. m(target, anchor) {
  20492. insert(target, span, anchor);
  20493. },
  20494. d(detaching) {
  20495. if (detaching) detach(span);
  20496. }
  20497. };
  20498. }
  20499. // (484:8) {#if !collapsed}
  20500. function create_if_block$g(ctx) {
  20501. let span0;
  20502. let t1;
  20503. let span1;
  20504. return {
  20505. c() {
  20506. span0 = element("span");
  20507. span0.textContent = "«";
  20508. t1 = space();
  20509. span1 = element("span");
  20510. span1.textContent = "Collapse sidebar";
  20511. attr(span0, "class", "icon");
  20512. attr(span1, "class", "fa-xs");
  20513. },
  20514. m(target, anchor) {
  20515. insert(target, span0, anchor);
  20516. insert(target, t1, anchor);
  20517. insert(target, span1, anchor);
  20518. },
  20519. d(detaching) {
  20520. if (detaching) detach(span0);
  20521. if (detaching) detach(t1);
  20522. if (detaching) detach(span1);
  20523. }
  20524. };
  20525. }
  20526. // (495:8) <Route exact>
  20527. function create_default_slot_2(ctx) {
  20528. let current;
  20529. const home = new Home({
  20530. props: {
  20531. title: /*title*/ ctx[0],
  20532. description: /*description*/ ctx[1]
  20533. }
  20534. });
  20535. return {
  20536. c() {
  20537. create_component(home.$$.fragment);
  20538. },
  20539. m(target, anchor) {
  20540. mount_component(home, target, anchor);
  20541. current = true;
  20542. },
  20543. p(ctx, dirty) {
  20544. const home_changes = {};
  20545. if (dirty & /*title*/ 1) home_changes.title = /*title*/ ctx[0];
  20546. if (dirty & /*description*/ 2) home_changes.description = /*description*/ ctx[1];
  20547. home.$set(home_changes);
  20548. },
  20549. i(local) {
  20550. if (current) return;
  20551. transition_in(home.$$.fragment, local);
  20552. current = true;
  20553. },
  20554. o(local) {
  20555. transition_out(home.$$.fragment, local);
  20556. current = false;
  20557. },
  20558. d(detaching) {
  20559. destroy_component(home, detaching);
  20560. }
  20561. };
  20562. }
  20563. // (498:8) <Route exact path="/:slug">
  20564. function create_default_slot_1(ctx) {
  20565. let current;
  20566. const action_1 = new Action({
  20567. props: {
  20568. action: /*action*/ ctx[8],
  20569. config: /*config*/ ctx[3],
  20570. environment: /*environment*/ ctx[11],
  20571. challengePair: /*challengePair*/ ctx[12],
  20572. darkMode: /*darkMode*/ ctx[7]
  20573. }
  20574. });
  20575. return {
  20576. c() {
  20577. create_component(action_1.$$.fragment);
  20578. },
  20579. m(target, anchor) {
  20580. mount_component(action_1, target, anchor);
  20581. current = true;
  20582. },
  20583. p(ctx, dirty) {
  20584. const action_1_changes = {};
  20585. if (dirty & /*action*/ 256) action_1_changes.action = /*action*/ ctx[8];
  20586. if (dirty & /*config*/ 8) action_1_changes.config = /*config*/ ctx[3];
  20587. if (dirty & /*environment*/ 2048) action_1_changes.environment = /*environment*/ ctx[11];
  20588. if (dirty & /*darkMode*/ 128) action_1_changes.darkMode = /*darkMode*/ ctx[7];
  20589. action_1.$set(action_1_changes);
  20590. },
  20591. i(local) {
  20592. if (current) return;
  20593. transition_in(action_1.$$.fragment, local);
  20594. current = true;
  20595. },
  20596. o(local) {
  20597. transition_out(action_1.$$.fragment, local);
  20598. current = false;
  20599. },
  20600. d(detaching) {
  20601. destroy_component(action_1, detaching);
  20602. }
  20603. };
  20604. }
  20605. // (494:6) <Router>
  20606. function create_default_slot$2(ctx) {
  20607. let t;
  20608. let current;
  20609. const route0 = new Route({
  20610. props: {
  20611. exact: true,
  20612. $$slots: { default: [create_default_slot_2] },
  20613. $$scope: { ctx }
  20614. }
  20615. });
  20616. const route1 = new Route({
  20617. props: {
  20618. exact: true,
  20619. path: "/:slug",
  20620. $$slots: { default: [create_default_slot_1] },
  20621. $$scope: { ctx }
  20622. }
  20623. });
  20624. return {
  20625. c() {
  20626. create_component(route0.$$.fragment);
  20627. t = space();
  20628. create_component(route1.$$.fragment);
  20629. },
  20630. m(target, anchor) {
  20631. mount_component(route0, target, anchor);
  20632. insert(target, t, anchor);
  20633. mount_component(route1, target, anchor);
  20634. current = true;
  20635. },
  20636. p(ctx, dirty) {
  20637. const route0_changes = {};
  20638. if (dirty & /*$$scope, title, description*/ 16777219) {
  20639. route0_changes.$$scope = { dirty, ctx };
  20640. }
  20641. route0.$set(route0_changes);
  20642. const route1_changes = {};
  20643. if (dirty & /*$$scope, action, config, environment, darkMode*/ 16779656) {
  20644. route1_changes.$$scope = { dirty, ctx };
  20645. }
  20646. route1.$set(route1_changes);
  20647. },
  20648. i(local) {
  20649. if (current) return;
  20650. transition_in(route0.$$.fragment, local);
  20651. transition_in(route1.$$.fragment, local);
  20652. current = true;
  20653. },
  20654. o(local) {
  20655. transition_out(route0.$$.fragment, local);
  20656. transition_out(route1.$$.fragment, local);
  20657. current = false;
  20658. },
  20659. d(detaching) {
  20660. destroy_component(route0, detaching);
  20661. if (detaching) detach(t);
  20662. destroy_component(route1, detaching);
  20663. }
  20664. };
  20665. }
  20666. function create_fragment$n(ctx) {
  20667. let div8;
  20668. let nav;
  20669. let div0;
  20670. let t0;
  20671. let a0;
  20672. let t3;
  20673. let div2;
  20674. let div1;
  20675. let t4;
  20676. let t5;
  20677. let div6;
  20678. let div4;
  20679. let t6;
  20680. let div3;
  20681. let t7;
  20682. let t8;
  20683. let div5;
  20684. let t9;
  20685. let footer;
  20686. let div7;
  20687. let p;
  20688. let strong0;
  20689. let t10;
  20690. let t11;
  20691. let a1;
  20692. let current;
  20693. let dispose;
  20694. const link = new Link({
  20695. props: {
  20696. href: "/",
  20697. class: "navbar-item",
  20698. $$slots: { default: [create_default_slot_3] },
  20699. $$scope: { ctx }
  20700. }
  20701. });
  20702. let if_block0 = /*config*/ ctx[3].playground.enabled && create_if_block_3$4(ctx);
  20703. let if_block1 = /*darkMode*/ ctx[7].enable && create_if_block_2$8(ctx);
  20704. const menupanel = new MenuPanel({
  20705. props: {
  20706. title: /*title*/ ctx[0],
  20707. tagActions: /*filteredActions*/ ctx[10],
  20708. tagHeaders: toc(/*description*/ ctx[1]),
  20709. currentSlug: /*action*/ ctx[8] && /*action*/ ctx[8].slug,
  20710. actionsCount: /*actions*/ ctx[2].length,
  20711. isCollapsed: /*collapsed*/ ctx[5],
  20712. isDarkmode: /*darkMode*/ ctx[7].active,
  20713. query: /*query*/ ctx[9],
  20714. tocClick,
  20715. searchClick: /*searchClick*/ ctx[15]
  20716. }
  20717. });
  20718. let if_block2 = /*collapsed*/ ctx[5] && create_if_block_1$d(ctx);
  20719. let if_block3 = !/*collapsed*/ ctx[5] && create_if_block$g(ctx);
  20720. const router_1 = new Router({
  20721. props: {
  20722. $$slots: { default: [create_default_slot$2] },
  20723. $$scope: { ctx }
  20724. }
  20725. });
  20726. return {
  20727. c() {
  20728. div8 = element("div");
  20729. nav = element("nav");
  20730. div0 = element("div");
  20731. create_component(link.$$.fragment);
  20732. t0 = space();
  20733. a0 = element("a");
  20734. a0.innerHTML = `<span aria-hidden="true"></span>
  20735. <span aria-hidden="true"></span>
  20736. <span aria-hidden="true"></span>`;
  20737. t3 = space();
  20738. div2 = element("div");
  20739. div1 = element("div");
  20740. if (if_block0) if_block0.c();
  20741. t4 = space();
  20742. if (if_block1) if_block1.c();
  20743. t5 = space();
  20744. div6 = element("div");
  20745. div4 = element("div");
  20746. create_component(menupanel.$$.fragment);
  20747. t6 = space();
  20748. div3 = element("div");
  20749. if (if_block2) if_block2.c();
  20750. t7 = space();
  20751. if (if_block3) if_block3.c();
  20752. t8 = space();
  20753. div5 = element("div");
  20754. create_component(router_1.$$.fragment);
  20755. t9 = space();
  20756. footer = element("footer");
  20757. div7 = element("div");
  20758. p = element("p");
  20759. strong0 = element("strong");
  20760. t10 = text(/*title*/ ctx[0]);
  20761. t11 = text("\n powered by\n ");
  20762. a1 = element("a");
  20763. a1.innerHTML = `<strong>Snowboard.</strong>`;
  20764. attr(a0, "href", "javascript:void(0)");
  20765. attr(a0, "role", "button");
  20766. attr(a0, "class", "navbar-burger");
  20767. attr(a0, "aria-label", "menu");
  20768. attr(a0, "aria-expanded", "false");
  20769. attr(a0, "data-target", "mainnav");
  20770. attr(div0, "class", "navbar-brand");
  20771. attr(div1, "class", "navbar-end");
  20772. attr(div2, "class", "navbar-menu");
  20773. attr(nav, "class", "navbar is-fixed-top has-shadow");
  20774. attr(nav, "role", "navigation");
  20775. attr(nav, "aria-label", "main navigation");
  20776. attr(div3, "class", "menu-collapsible svelte-1s8fs56");
  20777. toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[7].active);
  20778. attr(div4, "class", "column is-one-quarter sidenav svelte-1s8fs56");
  20779. attr(div4, "id", "mainnav");
  20780. toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[4]);
  20781. attr(div5, "class", "column is-three-quarters main svelte-1s8fs56");
  20782. toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[7].active);
  20783. attr(div6, "class", "columns svelte-1s8fs56");
  20784. toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[5]);
  20785. attr(a1, "href", "https://github.com/bukalapak/snowboard");
  20786. attr(a1, "target", "_blank");
  20787. attr(div7, "class", "content column is-paddingless has-text-centered svelte-1s8fs56");
  20788. toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[5]);
  20789. attr(footer, "class", "footer svelte-1s8fs56");
  20790. toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[7].active);
  20791. attr(div8, "class", "body-inner svelte-1s8fs56");
  20792. toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[7].active);
  20793. },
  20794. m(target, anchor) {
  20795. insert(target, div8, anchor);
  20796. append(div8, nav);
  20797. append(nav, div0);
  20798. mount_component(link, div0, null);
  20799. append(div0, t0);
  20800. append(div0, a0);
  20801. append(nav, t3);
  20802. append(nav, div2);
  20803. append(div2, div1);
  20804. if (if_block0) if_block0.m(div1, null);
  20805. append(div1, t4);
  20806. if (if_block1) if_block1.m(div1, null);
  20807. append(div8, t5);
  20808. append(div8, div6);
  20809. append(div6, div4);
  20810. mount_component(menupanel, div4, null);
  20811. append(div4, t6);
  20812. append(div4, div3);
  20813. if (if_block2) if_block2.m(div3, null);
  20814. append(div3, t7);
  20815. if (if_block3) if_block3.m(div3, null);
  20816. append(div6, t8);
  20817. append(div6, div5);
  20818. mount_component(router_1, div5, null);
  20819. append(div8, t9);
  20820. append(div8, footer);
  20821. append(footer, div7);
  20822. append(div7, p);
  20823. append(p, strong0);
  20824. append(strong0, t10);
  20825. append(p, t11);
  20826. append(p, a1);
  20827. current = true;
  20828. dispose = [
  20829. listen(a0, "click", /*burgerClick*/ ctx[13]),
  20830. listen(div3, "click", /*collapseToggle*/ ctx[14])
  20831. ];
  20832. },
  20833. p(ctx, [dirty]) {
  20834. const link_changes = {};
  20835. if (dirty & /*$$scope, title*/ 16777217) {
  20836. link_changes.$$scope = { dirty, ctx };
  20837. }
  20838. link.$set(link_changes);
  20839. if (/*config*/ ctx[3].playground.enabled) {
  20840. if (if_block0) {
  20841. if_block0.p(ctx, dirty);
  20842. transition_in(if_block0, 1);
  20843. } else {
  20844. if_block0 = create_if_block_3$4(ctx);
  20845. if_block0.c();
  20846. transition_in(if_block0, 1);
  20847. if_block0.m(div1, t4);
  20848. }
  20849. } else if (if_block0) {
  20850. group_outros();
  20851. transition_out(if_block0, 1, 1, () => {
  20852. if_block0 = null;
  20853. });
  20854. check_outros();
  20855. }
  20856. if (/*darkMode*/ ctx[7].enable) {
  20857. if (if_block1) {
  20858. if_block1.p(ctx, dirty);
  20859. } else {
  20860. if_block1 = create_if_block_2$8(ctx);
  20861. if_block1.c();
  20862. if_block1.m(div1, null);
  20863. }
  20864. } else if (if_block1) {
  20865. if_block1.d(1);
  20866. if_block1 = null;
  20867. }
  20868. const menupanel_changes = {};
  20869. if (dirty & /*title*/ 1) menupanel_changes.title = /*title*/ ctx[0];
  20870. if (dirty & /*filteredActions*/ 1024) menupanel_changes.tagActions = /*filteredActions*/ ctx[10];
  20871. if (dirty & /*description*/ 2) menupanel_changes.tagHeaders = toc(/*description*/ ctx[1]);
  20872. if (dirty & /*action*/ 256) menupanel_changes.currentSlug = /*action*/ ctx[8] && /*action*/ ctx[8].slug;
  20873. if (dirty & /*actions*/ 4) menupanel_changes.actionsCount = /*actions*/ ctx[2].length;
  20874. if (dirty & /*collapsed*/ 32) menupanel_changes.isCollapsed = /*collapsed*/ ctx[5];
  20875. if (dirty & /*darkMode*/ 128) menupanel_changes.isDarkmode = /*darkMode*/ ctx[7].active;
  20876. if (dirty & /*query*/ 512) menupanel_changes.query = /*query*/ ctx[9];
  20877. menupanel.$set(menupanel_changes);
  20878. if (/*collapsed*/ ctx[5]) {
  20879. if (!if_block2) {
  20880. if_block2 = create_if_block_1$d(ctx);
  20881. if_block2.c();
  20882. if_block2.m(div3, t7);
  20883. } else {
  20884. }
  20885. } else if (if_block2) {
  20886. if_block2.d(1);
  20887. if_block2 = null;
  20888. }
  20889. if (!/*collapsed*/ ctx[5]) {
  20890. if (!if_block3) {
  20891. if_block3 = create_if_block$g(ctx);
  20892. if_block3.c();
  20893. if_block3.m(div3, null);
  20894. } else {
  20895. }
  20896. } else if (if_block3) {
  20897. if_block3.d(1);
  20898. if_block3 = null;
  20899. }
  20900. if (dirty & /*darkMode*/ 128) {
  20901. toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[7].active);
  20902. }
  20903. if (dirty & /*showMenu*/ 16) {
  20904. toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[4]);
  20905. }
  20906. const router_1_changes = {};
  20907. if (dirty & /*$$scope, action, config, environment, darkMode, title, description*/ 16779659) {
  20908. router_1_changes.$$scope = { dirty, ctx };
  20909. }
  20910. router_1.$set(router_1_changes);
  20911. if (dirty & /*darkMode*/ 128) {
  20912. toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[7].active);
  20913. }
  20914. if (dirty & /*collapsed*/ 32) {
  20915. toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[5]);
  20916. }
  20917. if (!current || dirty & /*title*/ 1) set_data(t10, /*title*/ ctx[0]);
  20918. if (dirty & /*collapsed*/ 32) {
  20919. toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[5]);
  20920. }
  20921. if (dirty & /*darkMode*/ 128) {
  20922. toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[7].active);
  20923. }
  20924. if (dirty & /*darkMode*/ 128) {
  20925. toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[7].active);
  20926. }
  20927. },
  20928. i(local) {
  20929. if (current) return;
  20930. transition_in(link.$$.fragment, local);
  20931. transition_in(if_block0);
  20932. transition_in(menupanel.$$.fragment, local);
  20933. transition_in(router_1.$$.fragment, local);
  20934. current = true;
  20935. },
  20936. o(local) {
  20937. transition_out(link.$$.fragment, local);
  20938. transition_out(if_block0);
  20939. transition_out(menupanel.$$.fragment, local);
  20940. transition_out(router_1.$$.fragment, local);
  20941. current = false;
  20942. },
  20943. d(detaching) {
  20944. if (detaching) detach(div8);
  20945. destroy_component(link);
  20946. if (if_block0) if_block0.d();
  20947. if (if_block1) if_block1.d();
  20948. destroy_component(menupanel);
  20949. if (if_block2) if_block2.d();
  20950. if (if_block3) if_block3.d();
  20951. destroy_component(router_1);
  20952. run_all(dispose);
  20953. }
  20954. };
  20955. }
  20956. function getQuery(slug) {
  20957. if (!slug) return "";
  20958. if (slug.startsWith("rg~")) {
  20959. const tagPrefix = slug.substr(0, 2);
  20960. const tagSlug = slug.substr(3);
  20961. return `${tagPrefix}:${tagSlug}`;
  20962. }
  20963. if (slug.startsWith("g~")) {
  20964. const groupPrefix = slug.substr(0, 1);
  20965. const groupSlug = slug.substr(2);
  20966. return `${groupPrefix}:${groupSlug}`;
  20967. }
  20968. return "";
  20969. }
  20970. function tocClick(event) {
  20971. navigateTo("/");
  20972. let href = event.target.getAttribute("href");
  20973. const target = document.getElementById(href.substr(1));
  20974. window.scrollTo(0, target ? target.offsetTop - 80 : 20);
  20975. }
  20976. function instance$n($$self, $$props, $$invalidate) {
  20977. let $router;
  20978. let $env;
  20979. component_subscribe($$self, router, $$value => $$invalidate(18, $router = $$value));
  20980. component_subscribe($$self, env, $$value => $$invalidate(19, $env = $$value));
  20981. Router.hashchange = true;
  20982. let { title } = $$props;
  20983. let { description } = $$props;
  20984. let { actions } = $$props;
  20985. let { tagActions } = $$props;
  20986. let { config } = $$props;
  20987. function findAction(slug) {
  20988. return actions.find(el => el.slug === slug);
  20989. }
  20990. function getAction(slug) {
  20991. if (!slug) return;
  20992. if (slug.startsWith("rg~")) {
  20993. const tagSlug = slug.substr(3);
  20994. const firstGroup = firstTagGroup(tagSlug);
  20995. if (firstGroup) {
  20996. const groupSlug = `${tagSlug}~${slugify(firstGroup.title)}`;
  20997. const selected = firstGroupAction(groupSlug);
  20998. return findAction(selected.slug);
  20999. }
  21000. return;
  21001. }
  21002. if (slug.startsWith("g~")) {
  21003. const groupSlug = slug.substr(2);
  21004. const selected = firstGroupAction(groupSlug);
  21005. return findAction(selected.slug);
  21006. }
  21007. return findAction(slug);
  21008. }
  21009. function firstTagGroup(tagSlug) {
  21010. let matches = [];
  21011. tagActions.forEach(tag => {
  21012. if (slugify(tag.title) === tagSlug) {
  21013. matches.push(tag);
  21014. }
  21015. });
  21016. if (matches.length > 0) {
  21017. return matches[0].children[0];
  21018. }
  21019. }
  21020. function firstGroupAction(groupSlug) {
  21021. let matches = [];
  21022. const slugs = groupSlug.split("~");
  21023. tagActions.forEach(tag => {
  21024. matches = matches.concat(tag.children.filter(child => slugify(child.title) === slugs[1] && slugify(tag.title) === slugs[0]));
  21025. });
  21026. if (matches.length > 0) {
  21027. return matches[0].actions[0];
  21028. }
  21029. }
  21030. if (config.playground.enabled) {
  21031. const savedEnv = getEnv();
  21032. if (savedEnv && Object.keys(config.playground.environments).includes(savedEnv)) {
  21033. env.set(savedEnv);
  21034. } else {
  21035. env.set(config.playground.env);
  21036. }
  21037. const authToken = getToken($env);
  21038. if (authToken) {
  21039. auth.add($env);
  21040. token$1.set(authToken);
  21041. }
  21042. }
  21043. let showMenu = true;
  21044. let collapsed = false;
  21045. let authenticating = false;
  21046. let challengePair = getPKCE();
  21047. function burgerClick() {
  21048. $$invalidate(4, showMenu = !showMenu);
  21049. }
  21050. function collapseToggle() {
  21051. $$invalidate(5, collapsed = !collapsed);
  21052. }
  21053. function searchClick() {
  21054. collapseToggle();
  21055. const searchInput = document.getElementById("search-input-text");
  21056. if (searchInput) {
  21057. searchInput.focus();
  21058. }
  21059. }
  21060. const darkMode = {
  21061. enable: true,
  21062. store: window.localStorage,
  21063. toggle: "darkmode-toggle",
  21064. mode: ["light", "dark"],
  21065. active: false
  21066. };
  21067. function darkToggle() {
  21068. $$invalidate(7, darkMode.active = !darkMode.active, darkMode);
  21069. document.getElementById(`bulma-theme-${darkMode.mode[Number(!darkMode.active)]}`).media = "none";
  21070. document.getElementById(`bulma-theme-${darkMode.mode[Number(darkMode.active)]}`).media = "";
  21071. darkMode.store.setItem(darkMode.toggle, darkMode.mode[Number(darkMode.active)]);
  21072. }
  21073. if (darkMode.store.getItem(darkMode.toggle) === darkMode.mode[1]) {
  21074. darkToggle();
  21075. }
  21076. onMount(async () => {
  21077. if (isAuth(environment, "oauth2")) {
  21078. const authParam = querystringify_1.parse(location.search);
  21079. if (authParam.code) {
  21080. $$invalidate(6, authenticating = true);
  21081. navigateTo(config.basePath);
  21082. const { accessToken, refreshToken } = await exchangeToken(authParam.code, environment.auth.options, isPKCE(environment), challengePair);
  21083. if (accessToken) {
  21084. setToken($env, accessToken);
  21085. auth.add($env);
  21086. token$1.set(accessToken);
  21087. if (refreshToken) {
  21088. setRefreshToken($env, refreshToken);
  21089. }
  21090. }
  21091. $$invalidate(6, authenticating = false);
  21092. clearPKCE();
  21093. clearState();
  21094. }
  21095. }
  21096. });
  21097. document.onkeyup = function (e) {
  21098. if ((e.which || e.keyCode) == 219) {
  21099. collapseToggle();
  21100. }
  21101. };
  21102. $$self.$set = $$props => {
  21103. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  21104. if ("description" in $$props) $$invalidate(1, description = $$props.description);
  21105. if ("actions" in $$props) $$invalidate(2, actions = $$props.actions);
  21106. if ("tagActions" in $$props) $$invalidate(17, tagActions = $$props.tagActions);
  21107. if ("config" in $$props) $$invalidate(3, config = $$props.config);
  21108. };
  21109. let action;
  21110. let query;
  21111. let filteredActions;
  21112. let environment;
  21113. $$self.$$.update = () => {
  21114. if ($$self.$$.dirty & /*$router*/ 262144) {
  21115. $$invalidate(8, action = getAction($router.params.slug));
  21116. }
  21117. if ($$self.$$.dirty & /*$router*/ 262144) {
  21118. $$invalidate(9, query = getQuery($router.params.slug));
  21119. }
  21120. if ($$self.$$.dirty & /*tagActions, query*/ 131584) {
  21121. $$invalidate(10, filteredActions = filterActions(tagActions, query));
  21122. }
  21123. if ($$self.$$.dirty & /*action, title*/ 257) {
  21124. {
  21125. document.title = action && `${action.title} - ${title}` || title;
  21126. }
  21127. }
  21128. if ($$self.$$.dirty & /*config, $env*/ 524296) {
  21129. $$invalidate(11, environment = config.playground.enabled && config.playground.environments[$env]);
  21130. }
  21131. };
  21132. return [
  21133. title,
  21134. description,
  21135. actions,
  21136. config,
  21137. showMenu,
  21138. collapsed,
  21139. authenticating,
  21140. darkMode,
  21141. action,
  21142. query,
  21143. filteredActions,
  21144. environment,
  21145. challengePair,
  21146. burgerClick,
  21147. collapseToggle,
  21148. searchClick,
  21149. darkToggle,
  21150. tagActions
  21151. ];
  21152. }
  21153. class Winter extends SvelteComponent {
  21154. constructor(options) {
  21155. super();
  21156. if (!document_1.getElementById("svelte-1s8fs56-style")) add_css$c();
  21157. init(this, options, instance$n, create_fragment$n, safe_not_equal, {
  21158. title: 0,
  21159. description: 1,
  21160. actions: 2,
  21161. tagActions: 17,
  21162. config: 3
  21163. });
  21164. }
  21165. }
  21166. const app = new Winter({
  21167. target: document.body,
  21168. props: {"title":"mailcow API","description":"mailcow is complete e-mailing solution with advanced antispam, antivirus, nice UI and API.\n\nIn order to use this API you have to create a API key and add your IP address to the whitelist of allowed IPs this can be done by logging into the Mailcow UI using your admin account, then go to Configuration > Access > Edit administrator details > API. There you will find a collapsed API menu.\n\n**This documentation is in Work In Progress status. It contains only few endpoints.**","version":"","servers":[{"url":"https://mailcow.host/"}],"tags":[{"title":"Domains","description":"","children":[{"title":"Get domains","description":"","children":[]},{"title":"Create domain","description":"","children":[]},{"title":"Update domain","description":"","children":[]},{"title":"Delete domain","description":"","children":[]}]},{"title":"Domain antispam policies","description":"You can create antispam whitelist and blacklist policies","children":[{"title":"List whitelist domain policy","description":"","children":[]},{"title":"List blacklist domain policy","description":"","children":[]},{"title":"Create domain policy","description":"","children":[]},{"title":"Delete domain policy","description":"","children":[]}]},{"title":"Mailboxes","description":"","children":[{"title":"Get mailboxes","description":"","children":[]},{"title":"Create mailbox","description":"","children":[]},{"title":"Update mailbox","description":"","children":[]},{"title":"Update mailbox ACL","description":"","children":[]},{"title":"Update Pushover settings","description":"","children":[]},{"title":"Delete mailbox","description":"","children":[]},{"title":"Quarantine Notifications","description":"","children":[]}]},{"title":"Aliases","description":"","children":[{"title":"Get aliases","description":"","children":[]},{"title":"Create alias","description":"","children":[]},{"title":"Update alias","description":"","children":[]},{"title":"Delete alias","description":"","children":[]}]},{"title":"Sync jobs","description":"","children":[{"title":"Get sync jobs","description":"","children":[]},{"title":"Create sync job","description":"","children":[]},{"title":"Update sync job","description":"","children":[]},{"title":"Delete sync job","description":"","children":[]}]},{"title":"Fordwarding Hosts","description":"","children":[{"title":"Get Forwarding Hosts","description":"","children":[]},{"title":"Add Forward Host","description":"","children":[]},{"title":"Delete Forward Host","description":"","children":[]}]},{"title":"Logs","description":"","children":[{"title":"Get Postfix logs","description":"","children":[]},{"title":"Get Rspamd logs","description":"","children":[]},{"title":"Get Dovecot logs","description":"","children":[]},{"title":"Get ACME logs","description":"","children":[]},{"title":"Get SOGo logs","description":"","children":[]},{"title":"Get Watchdog logs","description":"","children":[]},{"title":"Get Api logs","description":"","children":[]},{"title":"Get Ratelimit logs","description":"","children":[]},{"title":"Get Netfilter logs","description":"","children":[]},{"title":"Get Autodiscover logs","description":"","children":[]}]},{"title":"Queue Manager","description":"","children":[{"title":"Get Queue","description":"","children":[]},{"title":"Flush Queue","description":"","children":[]},{"title":"Delete Queue","description":"","children":[]}]},{"title":"Quarantine","description":"","children":[{"title":"Get mails in Quarantine","description":"","children":[]},{"title":"Delete mails in Quarantine","description":"","children":[]}]},{"title":"Fail2Ban","description":"","children":[{"title":"Get Fail2Ban Config","description":"","children":[]},{"title":"Edit Fail2Ban","description":"","children":[]}]},{"title":"DKIM","description":"","children":[{"title":"Get DKIM Key","description":"","children":[]},{"title":"Generate DKIM Key","description":"","children":[]},{"title":"Duplicate DKIM Key","description":"","children":[]},{"title":"Delete DKIM Key","description":"","children":[]}]},{"title":"Domain admin","description":"","children":[{"title":"Get Domain Admins","description":"","children":[]},{"title":"Create Domain Admin user","description":"","children":[]},{"title":"Delete Domain Admin","description":"","children":[]}]},{"title":"Address Rewriting","description":"","children":[{"title":"Get BCC Map","description":"","children":[]},{"title":"Create BCC Map","description":"","children":[]},{"title":"Delete BCC Map","description":"","children":[]},{"title":"Get Recipient Map","description":"","children":[]},{"title":"Create Recipient Map","description":"","children":[]},{"title":"Delete Recipient Map","description":"","children":[]}]},{"title":"Outgoing TLS Policy Map Overrides","description":"","children":[{"title":"Get TLS Policy Map","description":"","children":[]},{"title":"Create TLS Policy Map","description":"","children":[]},{"title":"Delete TLS Policy Map","description":"","children":[]}]},{"title":"oAuth Clients","description":"","children":[{"title":"Get oAuth Clients","description":"","children":[]},{"title":"Create oAuth Client","description":"","children":[]},{"title":"Delete oAuth Client","description":"","children":[]}]},{"title":"Routing","description":"","children":[{"title":"Get Sender-Dependent Transports","description":"","children":[]},{"title":"Create Sender-Dependent Transports","description":"","children":[]},{"title":"Delete Sender-Dependent Transports","description":"","children":[]},{"title":"Get Transport Maps","description":"","children":[]},{"title":"Create Transport Maps","description":"","children":[]},{"title":"Delete Transport Maps","description":"","children":[]}]},{"title":"Resources","description":"","children":[{"title":"Get Resources","description":"","children":[]},{"title":"Create Resources","description":"","children":[]},{"title":"Delete Resources","description":"","children":[]}]},{"title":"App Passwords","description":"","children":[{"title":"Get App Password","description":"","children":[]},{"title":"Create App Password","description":"","children":[]},{"title":"Delete App Password","description":"","children":[]}]},{"title":"status","description":"","children":[{"title":"Get container status","description":"","children":[]},{"title":"Get vmail status","description":"","children":[]},{"title":"Get solr status","description":"","children":[]}]},{"title":"Ratelimits","description":"","children":[{"title":"Get Ratelimits","description":"","children":[]}]}],"actions":[{"title":"Get domains","path":"/api/v1/get/domain/{id}","pathTemplate":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id","method":"get","description":"\nYou can list all domains existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","mailcow.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"bytes_total\": \"5076666944\",\n \"msgs_total\": \"172440\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain.tld\",\n \"description\": \"Some description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"&#10008;\",\n \"gal\": \"&#10008;\",\n \"backupmx_int\": 0,\n \"gal_int\": 0,\n \"lang\": \"en\",\n \"rl\": false,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"&#10008;\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n },\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"bytes_total\": \"5076666944\",\n \"msgs_total\": \"172440\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain2.tld\",\n \"description\": \"domain description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"&#10004;\",\n \"gal\": \"&#10008;\",\n \"backupmx_int\": 1,\n \"gal_int\": 0,\n \"lang\": \"cs\",\n \"rl\": false,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"&#10008;\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n }\n]\n","schema":""}}],"tags":["Domains","Get domains"]},{"title":"Create domain","path":"/api/v1/add/domain","pathTemplate":"/api/v1/add/domain","slug":"post~api~v1~add~domain","method":"post","description":"\nYou may create your own domain using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"You can also define rate limiting. If `rl_value` is not empty string, them ratelimit object is created and returned in response.","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"Fully qualified domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"description","description":"Description of domain","required":false,"members":[],"schema":{"type":"string"}},{"key":"aliases","description":"limit count of aliases associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"mailboxes","description":"limit count of mailboxes associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"defquota","description":"predefined mailbox quota in `add mailbox` form","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxquota","description":"maximum quota per mailbox","required":false,"members":[],"schema":{"type":"number"}},{"key":"quota","description":"maximum quota for this domain (for all mailboxes in sum)","required":false,"members":[],"schema":{"type":"number"}},{"key":"active","description":"is domain active or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"rl_value","description":"rate limit value","required":false,"members":[],"schema":{"type":"number"}},{"key":"rl_frame","required":false,"members":[],"schema":{"type":"enum"}},{"key":"backupmx","description":"relay domain or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"relay_all_recipients","description":"if not, them you have to create \"dummy\" mailbox for each address to relay","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"lang","description":"language code","required":false,"members":[],"schema":{"type":"enum"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"description\":\"some decsription\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"rl_value\":\"10\",\n \"rl_frame\":\"s\",\n \"backupmx\":\"0\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"rl_value\": {\n \"type\": \"number\"\n },\n \"rl_frame\": {\n \"enum\": [\n \"s\",\n \"m\",\n \"h\"\n ]\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\": \"success\",\n \"log\": [\n \"ratelimit\",\n \"edit\",\n \"domain\",\n {\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"object\": \"domain.tld\"\n }\n ],\n \"msg\": [\n \"rl_saved\",\n \"domain.tld\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"domain\",\n {\n \"domain\": \"domain.tld\",\n \"description\": \"some decsription\",\n \"aliases\": \"400\",\n \"mailboxes\": \"10\",\n \"defquota\": \"3072\",\n \"maxquota\": \"10240\",\n \"quota\": \"10240\",\n \"active\": \"1\",\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"backupmx\": \"0\",\n \"relay_all_recipients\": \"0\",\n \"lang\":\"cs\"\n },\n null\n ],\n \"msg\": [\n \"domain_added\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Create domain"]},{"title":"Update domain","path":"/api/v1/edit/domain","pathTemplate":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain","method":"post","description":"\nYou can update one or more domains per request. You can also send just attributes you want to change.\nExample: You can add domain names to items list and in attr object just include `\"active\": \"0\"` to deactivate domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domain names you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"domain.tld\"\n ],\n \"attr\":{\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"gal\": {\n \"type\": \"boolean\"\n },\n \"relayhost\": {\n \"type\": \"number\"\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\"\n ],\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang:\"cs\"\n },\n null\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Update domain"]},{"title":"Delete domain","path":"/api/v1/delete/domain","pathTemplate":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain","method":"post","description":"\nYou can delete one or more domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domains you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"domain.tld\",\n \"domain2.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain2.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Delete domain"]},{"title":"List whitelist domain policy","path":"/api/v1/get/policy_wl_domain/{domain}","pathTemplate":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain","method":"get","description":"\nYou can list all whitelist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@gooddomain.tld\",\n \"prefid\": 1\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List whitelist domain policy"]},{"title":"List blacklist domain policy","path":"/api/v1/get/policy_bl_domain/{domain}","pathTemplate":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain","method":"get","description":"\nYou can list all blacklist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@baddomain.tld\",\n \"prefid\": 2\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List blacklist domain policy"]},{"title":"Create domain policy","path":"/api/v1/add/domain-policy","pathTemplate":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy","method":"post","description":"\nYou may create your own domain policy using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"domain name to which policy is associated to","required":false,"members":[],"schema":{"type":"string"}},{"key":"object_list","required":false,"members":[],"schema":{"type":"enum"}},{"key":"object_from","description":"exact address or use wildcard to match whole domain","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"object_list\": {\n \"enum\": [\n \"wl\",\n \"bl\"\n ]\n },\n \"object_from\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"add\",\n \"domain\",\n {\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n }\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Create domain policy"]},{"title":"Delete domain policy","path":"/api/v1/delete/domain-policy","pathTemplate":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy","method":"post","description":"\nYou can delete one o more domain policies.","parameters":[],"transactions":[{"request":{"title":"json","description":"Delete domain policy by ID","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of domain policys you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"1\",\n \"2\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"1\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Delete domain policy"]},{"title":"Get mailboxes","path":"/api/v1/get/mailbox/{id}","pathTemplate":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id","method":"get","description":"\nYou can list all mailboxes existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","user@domain.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_quota\":10737418240,\n \"username\":\"info@doman3.tld\",\n \"rl\":false,\n \"is_relayed\":0,\n \"name\":\"Full name\",\n \"active\":\"&#10004;\",\n \"active_int\":1,\n \"domain\":\"doman3.tld\",\n \"local_part\":\"info\",\n \"quota\":3221225472,\n \"attributes\":{\n \"force_pw_update\":\"0\",\n \"tls_enforce_in\":\"0\",\n \"tls_enforce_out\":\"0\",\n \"sogo_access\":\"1\",\n \"mailbox_format\":\"maildir:\",\n \"quarantine_notification\":\"never\"\n },\n \"quota_used\":0,\n \"percent_in_use\":0,\n \"messages\":0,\n \"spam_aliases\":0,\n \"percent_class\":\"success\"\n }\n]\n","schema":""}}],"tags":["Mailboxes","Get mailboxes"]},{"title":"Create mailbox","path":"/api/v1/add/mailbox","pathTemplate":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox","method":"post","description":"\nYou may create your own mailbox using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_part","description":"left part of email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"name","description":"Full name of the mailbox user","required":false,"members":[],"schema":{"type":"string"}},{"key":"quota","description":"mailbox quota","required":false,"members":[],"schema":{"type":"number"}},{"key":"pasword","description":"mailbox password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"mailbox password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"is mailbox active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"atedismonsin\",\n \"password2\":\"atedismonsin\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_part\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"mailbox\",\n {\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_added\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Create mailbox"]},{"title":"Update mailbox","path":"/api/v1/edit/mailbox","pathTemplate":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox","method":"post","description":"\nYou can update one or more mailboxes per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"sender_acl":["default","info@domain2.tld","domain3.tld","asterix"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"info@domain.tld\"\n ],\n \"attr\":{\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"\",\n \"password2\":\"\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"sender_acl\": {\n \"type\": \"array\"\n },\n \"force_pw_update\": {\n \"type\": \"boolean\"\n },\n \"sogo_access\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\"\n ],\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox"]},{"title":"Update mailbox ACL","path":"/api/v1/edit/user-acl","pathTemplate":"/api/v1/edit/user-acl","slug":"post~api~v1~edit~user-acl","method":"post","description":"\nUsing this endpoints its possible to update the ACL's for mailboxes","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"user_acl":["spam_alias","tls_policy","spam_score","spam_policy","delimiter_action","syncjobs","eas_reset","quarantine","sogo_profile_reset","quarantine_attachments","quarantine_notification","app_passwds","pushover"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\": [\"info@domain.tld\"],\n \"attr\": {\n \"user_acl\": [\"spam_alias\",\"tls_policy\",\"spam_score\",\"spam_policy\",\"delimiter_action\",\"syncjobs\",\"eas_reset\",\"quarantine\",\"sogo_profile_reset\",\"quarantine_attachments\",\"quarantine_notification\",\"app_passwds\",\"pushover\"]\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_acl\": {\n \"type\": \"array\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"acl\",\n \"edit\",\n \"user\",\n {\n \"username\": [\n \"info@domain.tld\"\n ],\n \"user_acl\": [\n \"spam_alias\",\n \"tls_policy\",\n \"spam_score\",\n \"spam_policy\",\n \"delimiter_action\",\n \"syncjobs\",\n \"eas_reset\",\n \"quarantine\",\n \"sogo_profile_reset\",\n \"quarantine_attachments\",\n \"quarantine_notification\",\n \"app_passwds\",\n \"pushover\"\n ]\n }\n ],\n \"msg\": [\n \"acl_saved\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox ACL"]},{"title":"Update Pushover settings","path":"/api/v1/edit/pushover","pathTemplate":"/api/v1/edit/pushover","slug":"post~api~v1~edit~pushover","method":"post","description":"\nUsing this endpoint it is possible to update the pushover settings for mailboxes","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\": [\"info@domain.tld\"],\n \"attr\":\n {\n \"evaluate_x_prio\": \"0\",\n \"only_x_prio\": \"0\",\n \"active\": \"0\",\n \"token\":\"9023e2ohcwed27d1idu2\",\n \"key\":\"21e8918e1jksdjcpis712\",\n \"title\":\"Mail\",\n \"text\":\"\",\n \"senders\":\"\",\n \"senders_regex\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"evaluate_x_prio\": {\n \"type\": \"number\"\n },\n \"only_x_prio\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"number\"\n },\n \"token\": {\n \"type\": \"string\"\n },\n \"key\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"senders\": {\n \"type\": \"string\"\n },\n \"senders_regex\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"pushover\",\n \"edit\",\n {\n \"username\": [\n \"info@domain.tld\"\n ],\n \"evaluate_x_prio\": \"0\",\n \"only_x_prio\": \"0\",\n \"active\": \"0\",\n \"token\": \"9023e2ohcwed27d1idu2\",\n \"key\": \"21e8918e1jksdjcpis712\",\n \"title\": \"Mail\",\n \"text\": \"\",\n \"senders\": \"\",\n \"senders_regex\": \"\"\n }\n ],\n \"msg\": \"pushover_settings_edited\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update Pushover settings"]},{"title":"Delete mailbox","path":"/api/v1/delete/mailbox","pathTemplate":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox","method":"post","description":"\nYou can delete one or more mailboxes.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"info@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"sales@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Delete mailbox"]},{"title":"Quarantine Notifications","path":"/api/v1/edit/quarantine_notification","pathTemplate":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification","method":"post","description":"\nYou can update one or more mailboxes per request.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want set qurantine notifications","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"mailbox1@domain.tld\",\n \"mailbox2@domain.tld\"\n ],\n \"attr\":{\n \"quarantine_notification\":\"hourly\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"quarantine_notification\": {\n \"enum\": [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"never\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"","schema":""}}],"tags":["Mailboxes","Quarantine Notifications"]},{"title":"Get aliases","path":"/api/v1/get/alias/{id}","pathTemplate":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id","method":"get","description":"\nYou can list mailbox aliases existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"in_primary_domain\": \"\",\n \"id\": 6,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"alias@domain.tld\",\n \"is_catch_all\": 0,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"created\": \"2019-04-04 19:29:49\",\n \"modified\": null\n },\n {\n \"in_primary_domain\": \"\",\n \"id\": 10,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"@domain.tld\",\n \"is_catch_all\": 1,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"created\": \"2019-04-27 13:42:39\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Aliases","Get aliases"]},{"title":"Create alias","path":"/api/v1/add/alias","pathTemplate":"/api/v1/add/alias","slug":"post~api~v1~add~alias","method":"post","description":"\nYou may create your own mailbox alias using this action. It takes a JSON object containing a domain informations.\nOnly one `goto*` option can be used, for ex. if you want learn as spam, then send just `goto_spam = 1` in request body.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"address","description":"alias address, for catchall use \"@domain.tld\"","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto","description":"destination address, comma separated","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto_null","description":"silently ignore","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_spam","description":"learn as spam","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_ham","description":"learn as ham","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"is alias active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"alias\",\n {\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_added\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Create alias"]},{"title":"Update alias","path":"/api/v1/edit/alias","pathTemplate":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias","method":"post","description":"\nYou can update one or more aliases per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"6\"\n ],\n \"attr\":{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"private_comment\": {\n \"type\": \"string\"\n },\n \"public_comment\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"alias\",\n {\n \"id\":[\n \"6\"\n ],\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_modified\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Update alias"]},{"title":"Delete alias","path":"/api/v1/delete/alias","pathTemplate":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias","method":"post","description":"\nYou can delete one or more aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\n \"6\",\n \"9\"\n]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias2@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Delete alias"]},{"title":"Get sync jobs","path":"/api/v1/get/syncjobs/all/no_log","pathTemplate":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log","method":"get","description":"\nYou can list all syn jobs existing in system.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"user2\": \"mailbox@domain.tld\",\n \"host1\": \"imap.server.tld\",\n \"authmech1\": \"PLAIN\",\n \"regextrans2\": \"\",\n \"authmd51\": 0,\n \"domain2\": \"\",\n \"subfolder2\": \"External\",\n \"user1\": \"username\",\n \"exclude\": \"(?i)spam|(?i)junk\",\n \"maxage\": 0,\n \"mins_interval\": \"20\",\n \"maxbytespersecond\": \"0\",\n \"port1\": 993,\n \"enc1\": \"TLS\",\n \"delete2duplicates\": 1,\n \"delete1\": 0,\n \"delete2\": 0,\n \"automap\": 1,\n \"skipcrossduplicates\": 0,\n \"custom_params\": \"\",\n \"timeout1\": 600,\n \"timeout2\": 600,\n \"subscribeall\": 1,\n \"is_running\": 0,\n \"last_run\": \"2019-05-22 11:40:02\",\n \"created\": \"2019-05-22 11:37:25\",\n \"modified\": \"2019-05-22 11:40:02\",\n \"active\": \"&#10003;\",\n \"active_int\": 1,\n \"log\": \"\"\n }\n]\n","schema":""}}],"tags":["Sync jobs","Get sync jobs"]},{"title":"Create sync job","path":"/api/v1/add/syncjob","pathTemplate":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob","method":"post","description":"\nYou can create new sync job using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"The target mailbox","required":false,"members":[],"schema":{"type":"string"}},{"key":"delete2duplicates","description":"Delete duplicates on destination","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete1","description":"Delete from source when completed","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete2","description":"Delete messages on destination that are not on source","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"automap","description":"Try to automap folders (\"Sent items\", \"Sent\" => \"Sent\" etc.)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"skipcrossduplicates","description":"Skip duplicate messages across folders (first come, first serve)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"Is sync job active","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"subscribeall","description":"Subscribe all folders","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"host1","description":"Hostname","required":false,"members":[],"schema":{"type":"string"}},{"key":"port1","description":"Port","required":false,"members":[],"schema":{"type":"string"}},{"key":"user1","description":"Username","required":false,"members":[],"schema":{"type":"string"}},{"key":"password1","description":"Password","required":false,"members":[],"schema":{"type":"string"}},{"key":"enc1","description":"Encryption","required":false,"members":[],"schema":{"type":"enum"}},{"key":"mins_interval","description":"Interval (min)","required":false,"members":[],"schema":{"type":"number"}},{"key":"subfolder2","description":"Sync into subfolder on destination (empty = do not use subfolder)","required":false,"members":[],"schema":{"type":"string"}},{"key":"maxage","description":"Maximum age of messages in days that will be polled from remote (0 = ignore age)","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxbytespersecond","description":"Max. bytes per second (0 = unlimited)","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout1","description":"Timeout for connection to remote host","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout2","description":"Timeout for connection to local host","required":false,"members":[],"schema":{"type":"number"}},{"key":"exclude","description":"Exclude objects (regex)","required":false,"members":[],"schema":{"type":"string"}},{"key":"custom_params","description":"Custom parameters passed to imapsync command","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\",\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"syncjob\",\n {\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":993,\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"mailbox@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Create sync job"]},{"title":"Update sync job","path":"/api/v1/edit/syncjob","pathTemplate":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob","method":"post","description":"\nYou can update one or more sync jobs per request. You can also send just attributes you want to change.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"1\"\n ],\n \"attr\":{\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"active\":\"1\",\n \"subscribeall\":\"1\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Update sync job"]},{"title":"Delete sync job","path":"/api/v1/delete/syncjob","pathTemplate":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob","method":"post","description":"\nYou can delete one or more sync jobs.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"6\",\n \"9\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Delete sync job"]},{"title":"Get Forwarding Hosts","path":"/api/v1/get/fwdhost/all","pathTemplate":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all","method":"get","description":"\nYou can list all Forwarding Hosts in your mailcow.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"host\": \"5.1.76.202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n },\n {\n \"host\": \"2a00:f820:417::202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n }\n]\n","schema":""}}],"tags":["Fordwarding Hosts","Get Forwarding Hosts"]},{"title":"Add Forward Host","path":"/api/v1/add/fwdhost","pathTemplate":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost","method":"post","description":"\nAdd a new Forwarding host to mailcow. You can chose to enable or disable spam filtering of incoming emails by specifing `filter_spam` 0 = inactive, 1 = active.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"contains the hostname you want to add","required":false,"members":[],"schema":{"type":"string"}},{"key":"filter_spam","description":"1 to enable spam filter, 0 to disable spam filter","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"filter_spam\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"add\",\n {\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n }\n ],\n \"msg\": [\n \"forwarding_host_added\",\n \"5.1.76.202, 2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Add Forward Host"]},{"title":"Delete Forward Host","path":"/api/v1/delete/fwdhost","pathTemplate":"/api/v1/delete/fwdhost","slug":"post~api~v1~delete~fwdhost","method":"post","description":"\nUsing this endpoint you can delete a forwarding host, in order to do so you need to know the IP of the host.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"ip","description":"contains the ip of the fowarding host you want to delete","required":false,"members":[],"schema":{"type":"string"}}]},"example":"[\"5.1.76.202\",\"2a00:f820:417::202\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"ip\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"delete\",\n {\n \"forwardinghost\": [\n \"5.1.76.202\",\n \"2a00:f820:417::202\"\n ]\n }\n ],\n \"msg\": [\n \"forwarding_host_removed\",\n \"5.1.76.202\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"delete\",\n {\n \"forwardinghost\": [\n \"5.1.76.202\",\n \"2a00:f820:417::202\"\n ]\n }\n ],\n \"msg\": [\n \"forwarding_host_removed\",\n \"2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Delete Forward Host"]},{"title":"Get Postfix logs","path":"/api/v1/get/logs/postfix/{count}","pathTemplate":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count","method":"get","description":"\nThis Api endpoint lists all Postfix logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569937433\",\n \"program\": \"postfix/qmgr\",\n \"priority\": \"info\",\n \"message\": \"EF1711500458: removed\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Postfix logs"]},{"title":"Get Rspamd logs","path":"/api/v1/get/logs/rspamd-history/{count}","pathTemplate":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count","method":"get","description":"\nThis Api endpoint lists all Rspamd logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n {\n \"time_virtual\": 0.235653,\n \"rcpt_mime\": [\n \"github@mailcow.tld\"\n ],\n \"message-id\": \"cm.0521259281087.phrkjuk.wdljulyl.i@cmail20.com\",\n \"ip\": \"1.1.1.1\",\n \"rcpt_smtp\": [\n \"github@mailcow.tld\"\n ],\n \"action\": \"soft reject\",\n \"time_real\": 2.856102,\n \"score\": 11.59,\n \"is_skipped\": false,\n \"size\": 35513,\n \"user\": \"unknown\",\n \"sender_mime\": \"noreply@github.com\",\n \"symbols\": {\n \"FROM_NEQ_ENVFROM\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0,\n \"name\": \"FROM_NEQ_ENVFROM\",\n \"description\": \"From address is different to the envelope\"\n },\n \"FORGED_SENDER\": {\n \"metric_score\": 0.3,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0.3,\n \"name\": \"FORGED_SENDER\",\n \"description\": \"Sender is forged (different From: header and smtp MAIL FROM: addresses)\"\n },\n \"RWL_MAILSPIKE_NEUTRAL\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.rep.mailspike.net : 127.0.0.13\"\n ],\n \"score\": 0,\n \"name\": \"RWL_MAILSPIKE_NEUTRAL\",\n \"description\": \"Neutral result from Mailspike\"\n },\n \"HAS_LIST_UNSUB\": {\n \"metric_score\": -0.01,\n \"score\": -0.01,\n \"name\": \"HAS_LIST_UNSUB\",\n \"description\": \"Has List-Unsubscribe header\"\n },\n \"URI_COUNT_ODD\": {\n \"metric_score\": 1,\n \"options\": [\n \"25\"\n ],\n \"score\": 1,\n \"name\": \"URI_COUNT_ODD\",\n \"description\": \"Odd number of URIs in multipart\\/alternative message\"\n },\n \"MIME_TRACE\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"MIME_TRACE\",\n \"options\": [\n \"0:+\",\n \"1:+\",\n \"2:~\"\n ]\n },\n \"R_DKIM_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"github.com:s=cm\",\n \"cmail2.com:s=cs2013\"\n ],\n \"score\": 0,\n \"name\": \"R_DKIM_ALLOW\",\n \"description\": \"DKIM verification succeed\"\n },\n \"FROM_HAS_DN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"FROM_HAS_DN\",\n \"description\": \"From header has a display name\"\n },\n \"MIME_GOOD\": {\n \"metric_score\": -0.1,\n \"options\": [\n \"multipart\\/alternative\",\n \"text\\/plain\"\n ],\n \"score\": -0.1,\n \"name\": \"MIME_GOOD\",\n \"description\": \"Known content-type\"\n },\n \"REPLYTO_ADDR_EQ_FROM\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"REPLYTO_ADDR_EQ_FROM\",\n \"description\": \"Reply-To header is identical to SMTP From\"\n },\n \"TO_MATCH_ENVRCPT_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_MATCH_ENVRCPT_ALL\",\n \"description\": \"All of the recipients match the envelope\"\n },\n \"ASN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ASN\",\n \"options\": [\n \"asn:55819, ipnet:203.55.21.0\\/24, country:AU\"\n ]\n },\n \"HTML_SHORT_LINK_IMG_1\": {\n \"metric_score\": 2,\n \"score\": 2,\n \"name\": \"HTML_SHORT_LINK_IMG_1\",\n \"description\": \"Short html part (0..1K) with a link to an image\"\n },\n \"SCHAALIT_URI_823\": {\n \"metric_score\": 5,\n \"score\": 5,\n \"name\": \"SCHAALIT_URI_823\",\n \"options\": [\n \"SCHAALIT_URI_823\"\n ]\n },\n \"DMARC_POLICY_ALLOW\": {\n \"metric_score\": -0.5,\n \"options\": [\n \"github.com\",\n \"none\"\n ],\n \"score\": 0,\n \"name\": \"DMARC_POLICY_ALLOW\",\n \"description\": \"DMARC permit policy\"\n },\n \"MANY_INVISIBLE_PARTS\": {\n \"metric_score\": 1,\n \"options\": [\n \"4\"\n ],\n \"score\": 0.3,\n \"name\": \"MANY_INVISIBLE_PARTS\",\n \"description\": \"Many parts are visually hidden\"\n },\n \"DKIM_TRACE\": {\n \"metric_score\": 0,\n \"options\": [\n \"github.com:+\",\n \"cmail2.com:+\"\n ],\n \"score\": 0,\n \"name\": \"DKIM_TRACE\",\n \"description\": \"DKIM trace symbol\"\n },\n \"MX_GOOD\": {\n \"metric_score\": -0.01,\n \"options\": [\n \"mx20.inbound.createsend.com\",\n \"mx21.inbound.createsend.com\"\n ],\n \"score\": -0.01,\n \"name\": \"MX_GOOD\",\n \"description\": \"MX was ok\"\n },\n \"TO_DN_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_DN_ALL\",\n \"description\": \"All the recipients have display names\"\n },\n \"RCPT_MAILCOW_DOMAIN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"RCPT_MAILCOW_DOMAIN\",\n \"options\": [\n \"gc-mc.de\"\n ]\n },\n \"XM_UA_NO_VERSION\": {\n \"metric_score\": 0.01,\n \"score\": 0.01,\n \"name\": \"XM_UA_NO_VERSION\",\n \"description\": \"X-Mailer\\/User-Agent has no version\"\n },\n \"HAS_REPLYTO\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\"\n ],\n \"score\": 0,\n \"name\": \"HAS_REPLYTO\",\n \"description\": \"Has Reply-To header\"\n },\n \"R_SPF_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"+ip4:203.55.21.0\\/24\"\n ],\n \"score\": 0,\n \"name\": \"R_SPF_ALLOW\",\n \"description\": \"SPF verification allows sending\"\n },\n \"URIBL_GREY\": {\n \"metric_score\": 1.5,\n \"options\": [\n \"cmail2.com.multi.uribl.com\",\n \"cmail20.com.multi.uribl.com\",\n \"updatemyprofile.com.multi.uribl.com\"\n ],\n \"score\": 1.5,\n \"name\": \"URIBL_GREY\",\n \"description\": \"uribl.com grey url\"\n },\n \"CLAM_VIRUS_FAIL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"CLAM_VIRUS_FAIL\",\n \"options\": [\n \"failed to scan and retransmits exceed\"\n ]\n },\n \"GREYLIST\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"GREYLIST\",\n \"options\": [\n \"greylisted\",\n \"Wed, 25 Sep 2019 19:27:10 GMT\",\n \"new record\"\n ]\n },\n \"ARC_NA\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ARC_NA\",\n \"description\": \"ARC signature absent\"\n },\n \"RCVD_COUNT_ZERO\": {\n \"metric_score\": 0,\n \"options\": [\n \"0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_COUNT_ZERO\",\n \"description\": \"Message has no Received headers\"\n },\n \"BAD_REP_POLICIES\": {\n \"metric_score\": 0.1,\n \"score\": 0.1,\n \"name\": \"BAD_REP_POLICIES\",\n \"description\": \"Contains valid policies but are also marked by fuzzy\\/bayes\\/surbl\\/rbl\"\n },\n \"RCPT_COUNT_ONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"1\"\n ],\n \"score\": 0,\n \"name\": \"RCPT_COUNT_ONE\",\n \"description\": \"One recipient\"\n },\n \"RBL_UCEPROTECT_LEVEL1\": {\n \"metric_score\": 3.5,\n \"score\": 3.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL1\",\n \"options\": [\n \"17.21.55.203.dnsbl-1.uceprotect.net\"\n ]\n },\n \"DWL_DNSWL_HI\": {\n \"metric_score\": -3.5,\n \"options\": [\n \"github.com.dwl.dnswl.org : 127.0.9.3\"\n ],\n \"score\": -3.5,\n \"name\": \"DWL_DNSWL_HI\",\n \"description\": \"Message has a valid dkim signature originated from domain listed at https:\\/\\/www.dnswl.org, high trust\"\n },\n \"RCVD_IN_DNSWL_NONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.list.dnswl.org : 127.0.15.0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_IN_DNSWL_NONE\",\n \"description\": \"Sender listed at https:\\/\\/www.dnswl.org, no trust\"\n },\n \"RBL_UCEPROTECT_LEVEL2\": {\n \"metric_score\": 1.5,\n \"score\": 1.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL2\",\n \"options\": [\n \"17.21.55.203.dnsbl-2.uceprotect.net\"\n ]\n }\n },\n \"subject\": \"[mailcow/mailcow-dockerized] Unable to change name of alias email address (#2997)\",\n \"required_score\": 15,\n \"unix_time\": 1569439327,\n \"sender_smtp\": \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n }\n}\n","schema":""}}],"tags":["Logs","Get Rspamd logs"]},{"title":"Get Dovecot logs","path":"/api/v1/get/logs/dovecot/{count}","pathTemplate":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count","method":"get","description":"\nThis Api endpoint lists all Dovecot logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938740\",\n \"program\": \"dovecot\",\n \"priority\": \"info\",\n \"message\": \"managesieve-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.22.1.3, lip=172.22.1.250\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Dovecot logs"]},{"title":"Get ACME logs","path":"/api/v1/get/logs/acme/{count}","pathTemplate":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count","method":"get","description":"\nThis Api endpoint lists all ACME logs from issued Lets Enctypts certificates.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569927728\",\n \"message\": \"Certificate validation done, neither changed nor due for renewal, sleeping for another day.\"\n }\n]\n","schema":""}}],"tags":["Logs","Get ACME logs"]},{"title":"Get SOGo logs","path":"/api/v1/get/logs/sogo/{count}","pathTemplate":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count","method":"get","description":"\nThis Api endpoint lists all SOGo logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938874\",\n \"program\": \"sogod\",\n \"priority\": \"notice\",\n \"message\": \"[109]: mailcowdockerized_watchdog-mailcow_1.mailcowdockerized_mailcow-network \\\"GET \\/SOGo.index\\/ HTTP\\/1.1\\\" 200 2531\\/0 0.005 - - 0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get SOGo logs"]},{"title":"Get Watchdog logs","path":"/api/v1/get/logs/watchdog/{count}","pathTemplate":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count","method":"get","description":"\nThis Api endpoint lists all Watchdog logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938958\",\n \"service\": \"Fail2ban\",\n \"lvl\": \"100\",\n \"hpnow\": \"1\",\n \"hptotal\": \"1\",\n \"hpdiff\": \"0\"\n },\n {\n \"time\": \"1569938956\",\n \"service\": \"Rspamd\",\n \"lvl\": \"100\",\n \"hpnow\": \"5\",\n \"hptotal\": \"5\",\n \"hpdiff\": \"0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Watchdog logs"]},{"title":"Get Api logs","path":"/api/v1/get/logs/api/{count}","pathTemplate":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count","method":"get","description":"\nThis Api endpoint lists all Api logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569939001,\n \"uri\": \"\\/api\\/v1\\/get\\/logs\\/api\\/2\",\n \"method\": \"GET\",\n \"remote\": \"1.1.1.1\",\n \"data\": \"\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Api logs"]},{"title":"Get Ratelimit logs","path":"/api/v1/get/logs/ratelimited/{count}","pathTemplate":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count","method":"get","description":"\nThis Api endpoint lists all Ratelimit logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569269003,\n \"rcpt\": \"hello@mailcow.email\",\n \"from\": \"awesome@mailcow.email\",\n \"user\": \"awesome@mailcow.email\",\n \"rl_info\": \"mailcow(RLsdz3tuabozgd4oacbdh8kc78)\",\n \"rl_name\": \"mailcow\",\n \"rl_hash\": \"RLsdz3tuabozgd4oacbdh8kc78\",\n \"qid\": \"E3CF91500458\",\n \"ip\": \"172.22.1.248\",\n \"message_id\": \"6a-5d892500-7-240abd80@90879116\",\n \"header_subject\": \"Mailcow is amazing\",\n \"header_from\": \"\\\"Awesome\\\" <awesome@mailcow.email>\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Ratelimit logs"]},{"title":"Get Netfilter logs","path":"/api/v1/get/logs/netfilter/{count}","pathTemplate":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count","method":"get","description":"\nThis Api endpoint lists all Netfilter logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569754911,\n \"priority\": \"info\",\n \"message\": \"Whitelist was changed, it has 1 entries\"\n },\n {\n \"time\": 1569754911,\n \"priority\": \"crit\",\n \"message\": \"Add host\\/network 1.1.1.1\\/32 to blacklist\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Netfilter logs"]},{"title":"Get Autodiscover logs","path":"/api/v1/get/logs/autodiscover/{count}","pathTemplate":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count","method":"get","description":"\nThis Api endpoint lists all Autodiscover logs.\nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569684212,\n \"ua\": \"Microsoft Office\\/16.0 (Windows NT 6.2; MAPICPL 16.0.11328; Pro)\",\n \"user\": \"awesome@mailcow.de\",\n \"service\": \"activesync\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Autodiscover logs"]},{"title":"Get Queue","path":"/api/v1/get/mailq/all","pathTemplate":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all","method":"get","description":"\nGet the current mail queue and everything it contains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"queue_name\": \"incoming\",\n \"queue_id\": \"B98C6260CA1\",\n \"arrival_time\": 1570091234,\n \"message_size\": 1848,\n \"sender\": \"sender@mailcow.tld\",\n \"recipients\": [\n \"recipient@awesomecow.tld\"\n ]\n }\n]\n","schema":""}}],"tags":["Queue Manager","Get Queue"]},{"title":"Flush Queue","path":"/api/v1/edit/mailq","pathTemplate":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq","method":"post","description":"\nUsing this API you can flush the current mail queue. This will try to deliver all mails currently in it.\nThis API uses the command: `postqueue -f`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use flush to flush the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"flush\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Flush Queue"]},{"title":"Delete Queue","path":"/api/v1/delete/mailq","pathTemplate":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq","method":"post","description":"\nUsing this API you can delete the current mail queue. This will delete all mails in it.\nThis API uses the command: `postsuper -d`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use super_delete to delete the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"super_delete\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Delete Queue"]},{"title":"Get mails in Quarantine","path":"/api/v1/get/quarantine/all","pathTemplate":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all","method":"get","description":"\nGet all mails that are currently in Quarantine.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"id\": 33,\n \"qid\": \"8224615004C1\",\n \"subject\": \"mailcow is awesome\",\n \"virus_flag\": 0,\n \"score\": 15.48,\n \"rcpt\": \"admin@domain.tld\",\n \"sender\": \"bounces@send.domain.tld\",\n \"created\": 1572688831,\n \"notified\": 1\n}\n","schema":""}}],"tags":["Quarantine","Get mails in Quarantine"]},{"title":"Delete mails in Quarantine","path":"/api/v1/delete/qitem","pathTemplate":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem","method":"post","description":"\nUsing this endpoint you can delete a email from quarantine, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of emails you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"33\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"quarantine\",\n \"delete\",\n {\n \"id\": [\n \"33\"\n ]\n }\n ],\n \"msg\": [\n \"item_deleted\",\n \"33\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Quarantine","Delete mails in Quarantine"]},{"title":"Get Fail2Ban Config","path":"/api/v1/get/fail2ban","pathTemplate":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban","method":"get","description":"\nGets the current Fail2Ban configuration.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ban_time\": 604800,\n \"netban_ipv4\": 32,\n \"netban_ipv6\": 128,\n \"max_attempts\": 1,\n \"retry_window\": 7200,\n \"whitelist\": \"1.1.1.1\",\n \"blacklist\": \"45.82.153.37\\/32\\n92.118.38.52\\/32\",\n \"perm_bans\": [\n \"45.82.153.37\\/32\",\n \"92.118.38.52\\/32\"\n ]\n}\n","schema":""}}],"tags":["Fail2Ban","Get Fail2Ban Config"]},{"title":"Edit Fail2Ban","path":"/api/v1/edit/fail2ban","pathTemplate":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban","method":"post","description":"\nUsing this endpoint you can edit the Fail2Ban config and black or whitelist new ips.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":[],"description":"has to be none","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"description":"array containing the fail2ban settings","required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"none\"\n ],\n \"attr\": {\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"ban_time\": {\n \"type\": \"number\"\n },\n \"max_attempts\": {\n \"type\": \"number\"\n },\n \"retry_window\": {\n \"type\": \"number\"\n },\n \"netban_ipv4\": {\n \"type\": \"number\"\n },\n \"netban_ipv6\": {\n \"type\": \"number\"\n },\n \"whitelist\": {\n \"type\": \"string\"\n },\n \"backlist\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"type\": \"success\",\n \"log\": [\n \"fail2ban\",\n \"edit\",\n {\n \"network\": [\n \"none\"\n ],\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n ],\n \"msg\": \"f2b_modified\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fail2Ban","Edit Fail2Ban"]},{"title":"Get DKIM Key","path":"/api/v1/get/dkim/{domain}","pathTemplate":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain","method":"get","description":"\nUsing this endpoint you can get the DKIM public key for a specific domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"pubkey\": \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"length\": \"2048\",\n \"dkim_txt\": \"v=DKIM1;k=rsa;t=s;s=email;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"dkim_selector\": \"dkim\",\n \"privkey\": \"\"\n}\n","schema":""}}],"tags":["DKIM","Get DKIM Key"]},{"title":"Generate DKIM Key","path":"/api/v1/add/dkim","pathTemplate":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim","method":"post","description":"\nUsing this endpoint you can generate new DKIM keys.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"the domain which a key should be generated for","required":false,"members":[],"schema":{"type":"string"}},{"key":"dkim_selector","description":"the DKIM selector default dkim","required":false,"members":[],"schema":{"type":"string"}},{"key":"key_size","description":"the key size (1024 or 2048)","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"domains\":\"mailcow.tld\",\n \"dkim_selector\":\"dkim\",\n \"key_size\":\"2048\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"dkim_selector\": {\n \"type\": \"string\"\n },\n \"key_size\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"add\",\n {\n \"domains\": \"hanspeterlol.de\",\n \"dkim_selector\": \"dkim\",\n \"key_size\": \"2048\"\n }\n ],\n \"msg\": [\n \"dkim_added\",\n \"hanspeterlol.de\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Generate DKIM Key"]},{"title":"Duplicate DKIM Key","path":"/api/v1/add/dkim_duplicate","pathTemplate":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate","method":"post","description":"\nUsing this endpoint you can duplicate the DKIM Key of one domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"fron_domain","description":"the domain where the dkim key should be copied from","required":false,"members":[],"schema":{"type":"string"}},{"key":"to_domain","description":"the domain where the dkim key should be copied to","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"from_domain\":\"mailcow.tld\",\n \"to_domain\":\"awesomecow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"fron_domain\": {\n \"type\": \"string\"\n },\n \"to_domain\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"duplicate\",\n {\n \"from_domain\": \"mailcow.tld\",\n \"to_domain\": \"awesomecow.tld\"\n }\n ],\n \"msg\": [\n \"dkim_duplicated\",\n \"mailcow.tld\",\n \"awesomecow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Duplicate DKIM Key"]},{"title":"Delete DKIM Key","path":"/api/v1/delete/dkim","pathTemplate":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim","method":"post","description":"\nUsing this endpoint a existing DKIM Key can be deleted","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\"mailcow.tld\"]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"delete\",\n {\n \"domains\": [\n \"mailcow.tld\"\n ]\n }\n ],\n \"msg\": [\n \"dkim_removed\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Delete DKIM Key"]},{"title":"Get Domain Admins","path":"/api/v1/get/domain-admin/all","pathTemplate":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all","method":"get","description":"\n","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"username\": \"testadmin\",\n \"tfa_active\": \"&#10005;\",\n \"active\": \"&#10003;\",\n \"tfa_active_int\": null,\n \"active_int\": 1,\n \"created\": \"2019-10-02 10:29:41\",\n \"selected_domains\": [\n \"mailcow.tld\"\n ],\n \"unselected_domains\": [\n \"awesomemailcow.de\",\n \"mailcowisgreat.de\"\n ]\n }\n]\n","schema":""}}],"tags":["Domain admin","Get Domain Admins"]},{"title":"Create Domain Admin user","path":"/api/v1/add/domain-admin","pathTemplate":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin","method":"post","description":"\nUsing this endpoint you can create a new Domain Admin user. This user has full control over a domain, and can create new mailboxes and aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username for the admin user","required":false,"members":[],"schema":{"type":"string"}},{"key":"domains","description":"the domains the user should be a admin of","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"supersecurepw\",\n \"password2\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"domains\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"add\",\n {\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"*\",\n \"password2\": \"*\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"domain_admin_added\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Create Domain Admin user"]},{"title":"Delete Domain Admin","path":"/api/v1/delete/domain-admin","pathTemplate":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin","method":"post","description":"\nUsing this endpoint a existing Domain Admin user can be deleted.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["username"],"description":"contains list of usernames of the users you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"testadmin\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"delete\",\n {\n \"username\": [\n \"testadmin\"\n ]\n }\n ],\n \"msg\": [\n \"domain_admin_removed\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Delete Domain Admin"]},{"title":"Get BCC Map","path":"/api/v1/get/bcc/{id}","pathTemplate":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id","method":"get","description":"\nUsing this endpoint you can get all BCC maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"local_dest\": \"@mailcow.tld\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"type\": \"sender\",\n \"created\": \"2019-10-02 21:44:34\",\n \"domain\": \"mailcow.tld\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get BCC Map"]},{"title":"Create BCC Map","path":"/api/v1/add/bcc","pathTemplate":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc","method":"post","description":"\nUsing this endpoint you can create a BCC map to forward all mails via a bcc for a given domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_dest","description":"the domain which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"type","description":"the type of bcc map can be `sender` or `recipient`","required":false,"members":[],"schema":{"type":"string"}},{"key":"bcc_dest","description":"the email address where all mails should be send to","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_dest\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"bcc_dest\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"add\",\n {\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": \"bcc_saved\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create BCC Map"]},{"title":"Delete BCC Map","path":"/api/v1/delete/bcc","pathTemplate":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc","method":"post","description":"\nUsing this endpoint you can delete a BCC map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of bcc maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"delete\",\n {\n \"id\": [\n \"4\"\n ]\n },\n null\n ],\n \"msg\": [\n \"bcc_deleted\",\n \"4\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete BCC Map"]},{"title":"Get Recipient Map","path":"/api/v1/get/recipient_map/{id}","pathTemplate":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id","method":"get","description":"\nUsing this endpoint you can get all recipient maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"created\": \"2019-10-02 22:06:29\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get Recipient Map"]},{"title":"Create Recipient Map","path":"/api/v1/add/recipient_map","pathTemplate":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map","method":"post","description":"\nUsing this endpoint you can create a recipient map to forward all mails from one email address to another.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"recipient_map_old","description":"the email address which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"recipient_map_new","description":"the email address that should receive the forwarded emails","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"recipient_map_old\": {\n \"type\": \"string\"\n },\n \"recipient_map_new\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"add\",\n {\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_saved\",\n \"recipient@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create Recipient Map"]},{"title":"Delete Recipient Map","path":"/api/v1/delete/recipient_map","pathTemplate":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map","method":"post","description":"\nUsing this endpoint you can delete a recipient map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of recipient maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete Recipient Map"]},{"title":"Get TLS Policy Map","path":"/api/v1/get/tls-policy-map/{id}","pathTemplate":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id","method":"get","description":"\nUsing this endpoint you can get all TLS policy map override maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"created\": \"2019-10-03 08:42:12\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Outgoing TLS Policy Map Overrides","Get TLS Policy Map"]},{"title":"Create TLS Policy Map","path":"/api/v1/add/tls-policy-map","pathTemplate":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map","method":"post","description":"\nUsing this endpoint you can create a TLS policy map override.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"dest","description":"the target domain or email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"policy","description":"the policy","required":false,"members":[],"schema":{"type":"enum"}},{"key":"parameters","description":"custom parameters you find out more about them [here](http://www.postfix.org/postconf.5.html#smtp_tls_policy_maps)","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"dest\": {\n \"type\": \"string\"\n },\n \"policy\": {\n \"enum\": [\n \"none\",\n \"may\",\n \"encrypt\",\n \"dane\",\n \"'dane\",\n \"fingerprint\",\n \"verify\",\n \"secure\"\n ]\n },\n \"parameters\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object"],"description":"contains request object","required":false,"members":[],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"add\",\n {\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_saved\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Create TLS Policy Map"]},{"title":"Delete TLS Policy Map","path":"/api/v1/delete/tls-policy-map","pathTemplate":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map","method":"post","description":"\nUsing this endpoint you can delete a TLS Policy Map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of tls policy maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Delete TLS Policy Map"]},{"title":"Get oAuth Clients","path":"/api/v1/get/oauth2-client/{id}","pathTemplate":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id","method":"get","description":"\nUsing this endpoint you can get all oAuth clients.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"client_id\": \"17c76aaa88c0\",\n \"client_secret\": \"73fc668a88147e32a31ff80c\",\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\",\n \"grant_types\": null,\n \"scope\": \"profile\",\n \"user_id\": null\n }\n]\n","schema":""}}],"tags":["oAuth Clients","Get oAuth Clients"]},{"title":"Create oAuth Client","path":"/api/v1/add/oauth2-client","pathTemplate":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client","method":"post","description":"\nUsing this endpoint you can create a oAuth clients.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"redirect_uri","description":"the uri where you should be redirected after oAuth","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"redirect_uri\":\"https://mailcow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"redirect_uri\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"add\",\n \"client\",\n {\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\"\n }\n ],\n \"msg\": \"Added client access\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Create oAuth Client"]},{"title":"Delete oAuth Client","path":"/api/v1/delete/oauth2-client","pathTemplate":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client","method":"post","description":"\nUsing this endpoint you can delete a oAuth client, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of oAuth clients you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"delete\",\n \"client\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"items_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Delete oAuth Client"]},{"title":"Get Sender-Dependent Transports","path":"/api/v1/get/relayhost/{id}","pathTemplate":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id","method":"get","description":"\nUsing this endpoint you can get all Sender-Dependent Transports.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\",\n \"active_int\": 1,\n \"password_short\": \"tes...\",\n \"active\": \"&#10003;\",\n \"used_by_domains\": \"\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Sender-Dependent Transports"]},{"title":"Create Sender-Dependent Transports","path":"/api/v1/add/relayhost","pathTemplate":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"the hostname of the smtp server with port","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"add\",\n {\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Sender-Dependent Transports"]},{"title":"Delete Sender-Dependent Transports","path":"/api/v1/delete/relayhost","pathTemplate":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost","method":"post","description":"\nUsing this endpoint you can delete a Sender-Dependent Transport, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of Sender-Dependent Transport you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Sender-Dependent Transports"]},{"title":"Get Transport Maps","path":"/api/v1/get/transport/{id}","pathTemplate":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id","method":"get","description":"\nUsing this endpoint you can get all Transport Maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active_int\": 1,\n \"lookup_mx_int\": 0,\n \"password_short\": \"sup...\",\n \"active\": \"&#10003;\",\n \"lookup_mx\": \"&#10005;\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Transport Maps"]},{"title":"Create Transport Maps","path":"/api/v1/add/transport/all","pathTemplate":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"destination","required":false,"members":[],"schema":{"type":"string"}},{"key":"nexthop","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\"\n },\n \"nexthop\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"add\",\n {\n \"destination\": \"example2.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Transport Maps"]},{"title":"Delete Transport Maps","path":"/api/v1/delete/transport","pathTemplate":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport","method":"post","description":"\nUsing this endpoint you can delete a Transport Maps, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of transport maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Transport Maps"]},{"title":"Get Resources","path":"/api/v1/get/resource/all","pathTemplate":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all","method":"get","description":"\nUsing this endpoint you can get all Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"name\": \"test@mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings\": 0,\n \"description\": \"test\",\n \"active\": \"&#10003;\",\n \"active_int\": 1,\n \"domain\": \"mailcow.tld\",\n \"local_part\": \"test\"\n }\n]\n","schema":""}}],"tags":["Resources","Get Resources"]},{"title":"Create Resources","path":"/api/v1/add/resource","pathTemplate":"/api/v1/add/resource","slug":"post~api~v1~add~resource","method":"post","description":"\nUsing this endpoint you can create Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"description","description":"a description of the resource","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"the domain for which the resource should be","required":false,"members":[],"schema":{"type":"string"}},{"key":"kind","description":"the kind of recouse","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_select","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_custom","description":"always empty","required":false,"members":[],"schema":{"type":"number"}},{"key":"multiple_bookings","required":false,"members":[],"schema":{"type":"enum"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"kind\": {\n \"enum\": [\n \"location\",\n \"group\",\n \"thing\"\n ]\n },\n \"multiple_bookings_select\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"multiple_bookings_custom\": {\n \"type\": \"number\"\n },\n \"multiple_bookings\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"resource\",\n {\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"resource_added\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Create Resources"]},{"title":"Delete Resources","path":"/api/v1/delete/resource","pathTemplate":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource","method":"post","description":"\nUsing this endpoint you can delete a Resources, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["description@domain"],"description":"contains list of Resources you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"test@mailcow.tld\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"delete\",\n \"resource\",\n {\n \"name\": [\n \"test@mailcow.tld\"\n ]\n },\n null\n ],\n \"msg\": [\n \"resource_removed\",\n \"test@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Delete Resources"]},{"title":"Get App Password","path":"/api/v1/get/app-passwd/all/{mailbox}","pathTemplate":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox","method":"get","description":"\nUsing this endpoint you can get all app passwords from a specific mailbox.","parameters":[{"location":"path","name":"mailbox","description":"mailbox of entry you want to get","required":true,"example":"hello@mailcow.email","schema":{"type":"string","enum":["hello@mailcow.email"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 2,\n \"name\": \"emclient\",\n \"mailbox\": \"hello@mailcow.email\",\n \"domain\": \"mailcow.email\",\n \"created\": \"2019-12-21 16:04:55\",\n \"modified\": null,\n \"active_int\": 1,\n \"active\": \"&#10003;\"\n }\n]\n","schema":""}}],"tags":["App Passwords","Get App Password"]},{"title":"Create App Password","path":"/api/v1/add/app-passwd","pathTemplate":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd","method":"post","description":"\nUsing this endpoint you can create a new app password for a specific mailbox.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username user@domain.tld","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_name","description":"name of the app password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd","description":"the password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd2","description":"the password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"hello@mailcow.email\"\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"app_name\": {\n \"type\": \"string\"\n },\n \"app_passwd\": {\n \"type\": \"string\"\n },\n \"app_passwd2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"add\",\n {\n \"username\": \"hello@mailcow.email\",\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n }\n ],\n \"msg\": \"app_passwd_added\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Create App Password"]},{"title":"Delete App Password","path":"/api/v1/delete/app-passwd","pathTemplate":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd","method":"post","description":"\nUsing this endpoint you can delete a single app password.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of app passwords you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"delete\",\n {\n \"id\": [\n \"2\"\n ]\n }\n ],\n \"msg\": [\n \"app_passwd_removed\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Delete App Password"]},{"title":"Get container status","path":"/api/v1/get/status/containers","pathTemplate":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ipv6nat-mailcow\": {\n \"type\": \"info\",\n \"container\": \"ipv6nat-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:06:37.273225445Z\",\n \"image\": \"robbertkl/ipv6nat\"\n },\n \"netfilter-mailcow\": {\n \"type\": \"info\",\n \"container\": \"netfilter-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:09.851559297Z\",\n \"image\": \"mailcow/netfilter:1.31\"\n },\n \"rspamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"rspamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.456075355Z\",\n \"image\": \"mailcow/rspamd:1.56\"\n },\n \"acme-mailcow\": {\n \"type\": \"info\",\n \"container\": \"acme-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.270660275Z\",\n \"image\": \"mailcow/acme:1.63\"\n },\n \"dovecot-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dovecot-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.988680259Z\",\n \"image\": \"mailcow/dovecot:1.104\"\n },\n \"postfix-mailcow\": {\n \"type\": \"info\",\n \"container\": \"postfix-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:07.186717617Z\",\n \"image\": \"mailcow/postfix:1.44\"\n },\n \"nginx-mailcow\": {\n \"type\": \"info\",\n \"container\": \"nginx-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.9843038Z\",\n \"image\": \"nginx:mainline-alpine\"\n },\n \"mysql-mailcow\": {\n \"type\": \"info\",\n \"container\": \"mysql-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:02.201937528Z\",\n \"image\": \"mariadb:10.3\"\n },\n \"php-fpm-mailcow\": {\n \"type\": \"info\",\n \"container\": \"php-fpm-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:00.955808957Z\",\n \"image\": \"mailcow/phpfpm:1.55\"\n },\n \"clamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"clamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:01.622856172Z\",\n \"image\": \"mailcow/clamd:1.35\"\n },\n \"memcached-mailcow\": {\n \"type\": \"info\",\n \"container\": \"memcached-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.0907785Z\",\n \"image\": \"memcached:alpine\"\n },\n \"solr-mailcow\": {\n \"type\": \"info\",\n \"container\": \"solr-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.635413798Z\",\n \"image\": \"mailcow/solr:1.7\"\n },\n \"olefy-mailcow\": {\n \"type\": \"info\",\n \"container\": \"olefy-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.676259274Z\",\n \"image\": \"mailcow/olefy:1.2\"\n },\n \"sogo-mailcow\": {\n \"type\": \"info\",\n \"container\": \"sogo-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.382274592Z\",\n \"image\": \"mailcow/sogo:1.65\"\n },\n \"unbound-mailcow\": {\n \"type\": \"info\",\n \"container\": \"unbound-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.760595825Z\",\n \"image\": \"mailcow/unbound:1.10\"\n },\n \"dockerapi-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dockerapi-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.984797808Z\",\n \"image\": \"mailcow/dockerapi:1.36\"\n },\n \"redis-mailcow\": {\n \"type\": \"info\",\n \"container\": \"redis-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.827166834Z\",\n \"image\": \"redis:5-alpine\"\n },\n \"watchdog-mailcow\": {\n \"type\": \"info\",\n \"container\": \"watchdog-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.028660382Z\",\n \"image\": \"mailcow/watchdog:1.65\"\n }\n}\n","schema":""}}],"tags":["status","Get container status"]},{"title":"Get vmail status","path":"/api/v1/get/status/vmail","pathTemplate":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail","method":"get","description":"\nUsing this endpoint you can get the status of the vmail and the amount of used storage.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"disk\": \"/dev/mapper/mail--vg-root\",\n \"used\": \"11G\",\n \"total\": \"41G\",\n \"used_percent\": \"28%\"\n}\n","schema":""}}],"tags":["status","Get vmail status"]},{"title":"Get solr status","path":"/api/v1/get/status/solr","pathTemplate":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"solr_enabled\": false,\n \"solr_size\": null,\n \"solr_documents\": null\n}\n","schema":""}}],"tags":["status","Get solr status"]},{"title":"Get Ratelimits","path":"/api/v1/get/rl-mbox/{mailbox}","pathTemplate":"/api/v1/get/rl-mbox/{mailbox}","slug":"get~api~v1~get~rl-mbox~mailbox","method":"get","description":"\nUsing this endpoint you can get the ratelimits for a certain mailbox. You can use all for all mailboxes.","parameters":[{"location":"path","name":"mailbox","description":"name of mailbox or all","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"value\": \"5\",\n \"frame\": \"s\",\n \"mailbox\": \"leon@mailcow.tld\"\n },\n {\n \"value\": \"3\",\n \"frame\": \"s\",\n \"mailbox\": \"lisa@mailcow.tld\"\n }\n]\n","schema":""}}],"tags":["Ratelimits","Get Ratelimits"]}],"tagActions":[{"title":"Domains","children":[{"title":"Get domains","actions":[{"title":"Get domains","method":"get","path":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id"}]},{"title":"Create domain","actions":[{"title":"Create domain","method":"post","path":"/api/v1/add/domain","slug":"post~api~v1~add~domain"}]},{"title":"Update domain","actions":[{"title":"Update domain","method":"post","path":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain"}]},{"title":"Delete domain","actions":[{"title":"Delete domain","method":"post","path":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain"}]}]},{"title":"Domain antispam policies","children":[{"title":"List whitelist domain policy","actions":[{"title":"List whitelist domain policy","method":"get","path":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain"}]},{"title":"List blacklist domain policy","actions":[{"title":"List blacklist domain policy","method":"get","path":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain"}]},{"title":"Create domain policy","actions":[{"title":"Create domain policy","method":"post","path":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy"}]},{"title":"Delete domain policy","actions":[{"title":"Delete domain policy","method":"post","path":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy"}]}]},{"title":"Mailboxes","children":[{"title":"Get mailboxes","actions":[{"title":"Get mailboxes","method":"get","path":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id"}]},{"title":"Create mailbox","actions":[{"title":"Create mailbox","method":"post","path":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox"}]},{"title":"Update mailbox","actions":[{"title":"Update mailbox","method":"post","path":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox"}]},{"title":"Update mailbox ACL","actions":[{"title":"Update mailbox ACL","method":"post","path":"/api/v1/edit/user-acl","slug":"post~api~v1~edit~user-acl"}]},{"title":"Update Pushover settings","actions":[{"title":"Update Pushover settings","method":"post","path":"/api/v1/edit/pushover","slug":"post~api~v1~edit~pushover"}]},{"title":"Delete mailbox","actions":[{"title":"Delete mailbox","method":"post","path":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox"}]},{"title":"Quarantine Notifications","actions":[{"title":"Quarantine Notifications","method":"post","path":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification"}]}]},{"title":"Aliases","children":[{"title":"Get aliases","actions":[{"title":"Get aliases","method":"get","path":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id"}]},{"title":"Create alias","actions":[{"title":"Create alias","method":"post","path":"/api/v1/add/alias","slug":"post~api~v1~add~alias"}]},{"title":"Update alias","actions":[{"title":"Update alias","method":"post","path":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias"}]},{"title":"Delete alias","actions":[{"title":"Delete alias","method":"post","path":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias"}]}]},{"title":"Sync jobs","children":[{"title":"Get sync jobs","actions":[{"title":"Get sync jobs","method":"get","path":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log"}]},{"title":"Create sync job","actions":[{"title":"Create sync job","method":"post","path":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob"}]},{"title":"Update sync job","actions":[{"title":"Update sync job","method":"post","path":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob"}]},{"title":"Delete sync job","actions":[{"title":"Delete sync job","method":"post","path":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob"}]}]},{"title":"Fordwarding Hosts","children":[{"title":"Get Forwarding Hosts","actions":[{"title":"Get Forwarding Hosts","method":"get","path":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all"}]},{"title":"Add Forward Host","actions":[{"title":"Add Forward Host","method":"post","path":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost"}]},{"title":"Delete Forward Host","actions":[{"title":"Delete Forward Host","method":"post","path":"/api/v1/delete/fwdhost","slug":"post~api~v1~delete~fwdhost"}]}]},{"title":"Logs","children":[{"title":"Get Postfix logs","actions":[{"title":"Get Postfix logs","method":"get","path":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count"}]},{"title":"Get Rspamd logs","actions":[{"title":"Get Rspamd logs","method":"get","path":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count"}]},{"title":"Get Dovecot logs","actions":[{"title":"Get Dovecot logs","method":"get","path":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count"}]},{"title":"Get ACME logs","actions":[{"title":"Get ACME logs","method":"get","path":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count"}]},{"title":"Get SOGo logs","actions":[{"title":"Get SOGo logs","method":"get","path":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count"}]},{"title":"Get Watchdog logs","actions":[{"title":"Get Watchdog logs","method":"get","path":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count"}]},{"title":"Get Api logs","actions":[{"title":"Get Api logs","method":"get","path":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count"}]},{"title":"Get Ratelimit logs","actions":[{"title":"Get Ratelimit logs","method":"get","path":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count"}]},{"title":"Get Netfilter logs","actions":[{"title":"Get Netfilter logs","method":"get","path":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count"}]},{"title":"Get Autodiscover logs","actions":[{"title":"Get Autodiscover logs","method":"get","path":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count"}]}]},{"title":"Queue Manager","children":[{"title":"Get Queue","actions":[{"title":"Get Queue","method":"get","path":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all"}]},{"title":"Flush Queue","actions":[{"title":"Flush Queue","method":"post","path":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq"}]},{"title":"Delete Queue","actions":[{"title":"Delete Queue","method":"post","path":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq"}]}]},{"title":"Quarantine","children":[{"title":"Get mails in Quarantine","actions":[{"title":"Get mails in Quarantine","method":"get","path":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all"}]},{"title":"Delete mails in Quarantine","actions":[{"title":"Delete mails in Quarantine","method":"post","path":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem"}]}]},{"title":"Fail2Ban","children":[{"title":"Get Fail2Ban Config","actions":[{"title":"Get Fail2Ban Config","method":"get","path":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban"}]},{"title":"Edit Fail2Ban","actions":[{"title":"Edit Fail2Ban","method":"post","path":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban"}]}]},{"title":"DKIM","children":[{"title":"Get DKIM Key","actions":[{"title":"Get DKIM Key","method":"get","path":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain"}]},{"title":"Generate DKIM Key","actions":[{"title":"Generate DKIM Key","method":"post","path":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim"}]},{"title":"Duplicate DKIM Key","actions":[{"title":"Duplicate DKIM Key","method":"post","path":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate"}]},{"title":"Delete DKIM Key","actions":[{"title":"Delete DKIM Key","method":"post","path":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim"}]}]},{"title":"Domain admin","children":[{"title":"Get Domain Admins","actions":[{"title":"Get Domain Admins","method":"get","path":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all"}]},{"title":"Create Domain Admin user","actions":[{"title":"Create Domain Admin user","method":"post","path":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin"}]},{"title":"Delete Domain Admin","actions":[{"title":"Delete Domain Admin","method":"post","path":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin"}]}]},{"title":"Address Rewriting","children":[{"title":"Get BCC Map","actions":[{"title":"Get BCC Map","method":"get","path":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id"}]},{"title":"Create BCC Map","actions":[{"title":"Create BCC Map","method":"post","path":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc"}]},{"title":"Delete BCC Map","actions":[{"title":"Delete BCC Map","method":"post","path":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc"}]},{"title":"Get Recipient Map","actions":[{"title":"Get Recipient Map","method":"get","path":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id"}]},{"title":"Create Recipient Map","actions":[{"title":"Create Recipient Map","method":"post","path":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map"}]},{"title":"Delete Recipient Map","actions":[{"title":"Delete Recipient Map","method":"post","path":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map"}]}]},{"title":"Outgoing TLS Policy Map Overrides","children":[{"title":"Get TLS Policy Map","actions":[{"title":"Get TLS Policy Map","method":"get","path":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id"}]},{"title":"Create TLS Policy Map","actions":[{"title":"Create TLS Policy Map","method":"post","path":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map"}]},{"title":"Delete TLS Policy Map","actions":[{"title":"Delete TLS Policy Map","method":"post","path":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map"}]}]},{"title":"oAuth Clients","children":[{"title":"Get oAuth Clients","actions":[{"title":"Get oAuth Clients","method":"get","path":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id"}]},{"title":"Create oAuth Client","actions":[{"title":"Create oAuth Client","method":"post","path":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client"}]},{"title":"Delete oAuth Client","actions":[{"title":"Delete oAuth Client","method":"post","path":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client"}]}]},{"title":"Routing","children":[{"title":"Get Sender-Dependent Transports","actions":[{"title":"Get Sender-Dependent Transports","method":"get","path":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id"}]},{"title":"Create Sender-Dependent Transports","actions":[{"title":"Create Sender-Dependent Transports","method":"post","path":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost"}]},{"title":"Delete Sender-Dependent Transports","actions":[{"title":"Delete Sender-Dependent Transports","method":"post","path":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost"}]},{"title":"Get Transport Maps","actions":[{"title":"Get Transport Maps","method":"get","path":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id"}]},{"title":"Create Transport Maps","actions":[{"title":"Create Transport Maps","method":"post","path":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all"}]},{"title":"Delete Transport Maps","actions":[{"title":"Delete Transport Maps","method":"post","path":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport"}]}]},{"title":"Resources","children":[{"title":"Get Resources","actions":[{"title":"Get Resources","method":"get","path":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all"}]},{"title":"Create Resources","actions":[{"title":"Create Resources","method":"post","path":"/api/v1/add/resource","slug":"post~api~v1~add~resource"}]},{"title":"Delete Resources","actions":[{"title":"Delete Resources","method":"post","path":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource"}]}]},{"title":"App Passwords","children":[{"title":"Get App Password","actions":[{"title":"Get App Password","method":"get","path":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox"}]},{"title":"Create App Password","actions":[{"title":"Create App Password","method":"post","path":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd"}]},{"title":"Delete App Password","actions":[{"title":"Delete App Password","method":"post","path":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd"}]}]},{"title":"status","children":[{"title":"Get container status","actions":[{"title":"Get container status","method":"get","path":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers"}]},{"title":"Get vmail status","actions":[{"title":"Get vmail status","method":"get","path":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail"}]},{"title":"Get solr status","actions":[{"title":"Get solr status","method":"get","path":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr"}]}]},{"title":"Ratelimits","children":[{"title":"Get Ratelimits","actions":[{"title":"Get Ratelimits","method":"get","path":"/api/v1/get/rl-mbox/{mailbox}","slug":"get~api~v1~get~rl-mbox~mailbox"}]}]}],"config":{"playground":{"enabled":true,"env":"easy","environments":{"easy":{"playground":false,"url":"/"},"advanced":{"url":"/"}}},"optimized":false,"stylesheets":[],"sidebar":{"groupOrder":"auto"},"basePath":"/"}}
  21169. });
  21170. return app;
  21171. }());
  21172. </script>
  21173. </body>
  21174. </html>