cos-wx-sdk-v5.js 267 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136
  1. module.exports = function () {
  2. var __MODS__ = {};
  3. var __DEFINE__ = function (modId, func, req) {
  4. var m = {
  5. exports: {},
  6. _tempexports: {}
  7. };
  8. __MODS__[modId] = {
  9. status: 0,
  10. func: func,
  11. req: req,
  12. m: m
  13. };
  14. };
  15. var __REQUIRE__ = function (modId, source) {
  16. if (!__MODS__[modId]) return require(source);
  17. if (!__MODS__[modId].status) {
  18. var m = __MODS__[modId].m;
  19. m._exports = m._tempexports;
  20. var desp = Object.getOwnPropertyDescriptor(m, "exports");
  21. if (desp && desp.configurable) Object.defineProperty(m, "exports", {
  22. set: function (val) {
  23. if (typeof val === "object" && val !== m._exports) {
  24. m._exports.__proto__ = val.__proto__;
  25. Object.keys(val).forEach(function (k) {
  26. m._exports[k] = val[k];
  27. });
  28. }
  29. m._tempexports = val;
  30. },
  31. get: function () {
  32. return m._tempexports;
  33. }
  34. });
  35. __MODS__[modId].status = 1;
  36. __MODS__[modId].func(__MODS__[modId].req, m, m.exports);
  37. }
  38. return __MODS__[modId].m.exports;
  39. };
  40. var __REQUIRE_WILDCARD__ = function (obj) {
  41. if (obj && obj.__esModule) {
  42. return obj;
  43. } else {
  44. var newObj = {};
  45. if (obj != null) {
  46. for (var k in obj) {
  47. if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k];
  48. }
  49. }
  50. newObj.default = obj;
  51. return newObj;
  52. }
  53. };
  54. var __REQUIRE_DEFAULT__ = function (obj) {
  55. return obj && obj.__esModule ? obj.default : obj;
  56. };
  57. __DEFINE__(1611536304717, function (require, module, exports) {
  58. !function (e, t) {
  59. "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.COS = t() : e.COS = t();
  60. }("undefined" != typeof self ? self : this, function () {
  61. return function (e) {
  62. function t(i) {
  63. if (n[i]) return n[i].exports;
  64. var a = n[i] = {
  65. i: i,
  66. l: !1,
  67. exports: {}
  68. };
  69. return e[i].call(a.exports, a, a.exports, t), a.l = !0, a.exports;
  70. }
  71. var n = {};
  72. return t.m = e, t.c = n, t.d = function (e, n, i) {
  73. t.o(e, n) || Object.defineProperty(e, n, {
  74. configurable: !1,
  75. enumerable: !0,
  76. get: i
  77. });
  78. }, t.n = function (e) {
  79. var n = e && e.__esModule ? function () {
  80. return e.default;
  81. } : function () {
  82. return e;
  83. };
  84. return t.d(n, "a", n), n;
  85. }, t.o = function (e, t) {
  86. return Object.prototype.hasOwnProperty.call(e, t);
  87. }, t.p = "D:\\code\\cos-wx-sdk-v5\\demo\\lib", t(t.s = 6);
  88. }([function (e, t, n) {
  89. (function (t) {
  90. function i(e) {
  91. return encodeURIComponent(e).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
  92. }
  93. function a(e) {
  94. return u(e, function (e) {
  95. return "object" == typeof e ? a(e) : e;
  96. });
  97. }
  98. function o(e, t, n) {
  99. return e && t in e ? e[t] : n;
  100. }
  101. function r(e, t) {
  102. return p(t, function (n, i) {
  103. e[i] = t[i];
  104. }), e;
  105. }
  106. function s(e) {
  107. return e instanceof Array;
  108. }
  109. function c(e, t) {
  110. for (var n = !1, i = 0; i < e.length; i++) if (t === e[i]) {
  111. n = !0;
  112. break;
  113. }
  114. return n;
  115. }
  116. function l(e) {
  117. return s(e) ? e : [e];
  118. }
  119. function p(e, t) {
  120. for (var n in e) e.hasOwnProperty(n) && t(e[n], n);
  121. }
  122. function u(e, t) {
  123. var n = s(e) ? [] : {};
  124. for (var i in e) e.hasOwnProperty(i) && (n[i] = t(e[i], i));
  125. return n;
  126. }
  127. function d(e, t) {
  128. var n = s(e),
  129. i = n ? [] : {};
  130. for (var a in e) e.hasOwnProperty(a) && t(e[a], a) && (n ? i.push(e[a]) : i[a] = e[a]);
  131. return i;
  132. }
  133. var m = n(8),
  134. f = n(11),
  135. h = n(12),
  136. g = n(15),
  137. v = n(3),
  138. x = v.btoa,
  139. y = uni.getFileSystemManager(),
  140. C = function (e) {
  141. e = e || {};
  142. var t,
  143. n = e.SecretId,
  144. o = e.SecretKey,
  145. r = e.KeyTime,
  146. s = (e.method || e.Method || "get").toLowerCase(),
  147. c = a(e.Query || e.params || {}),
  148. l = a(e.Headers || e.headers || {}),
  149. p = e.Key || "";
  150. if (e.UseRawKey ? t = e.Pathname || e.pathname || "/" + p : (t = e.Pathname || e.pathname || p, 0 !== t.indexOf("/") && (t = "/" + t)), !n) return console.error("missing param SecretId");
  151. if (!o) return console.error("missing param SecretKey");
  152. var u = function (e, t) {
  153. var n = [];
  154. for (var a in e) e.hasOwnProperty(a) && n.push(t ? i(a).toLowerCase() : a);
  155. return n.sort(function (e, t) {
  156. return e = e.toLowerCase(), t = t.toLowerCase(), e === t ? 0 : e > t ? 1 : -1;
  157. });
  158. },
  159. d = function (e) {
  160. var t,
  161. n,
  162. a,
  163. o = [],
  164. r = u(e);
  165. for (t = 0; t < r.length; t++) n = r[t], a = void 0 === e[n] || null === e[n] ? "" : "" + e[n], n = i(n).toLowerCase(), a = i(a) || "", o.push(n + "=" + a);
  166. return o.join("&");
  167. },
  168. m = Math.round(N(e.SystemClockOffset) / 1e3) - 1,
  169. h = m,
  170. g = e.Expires || e.expires;
  171. h += void 0 === g ? 900 : 1 * g || 0;
  172. var v = n,
  173. x = r || m + ";" + h,
  174. y = r || m + ";" + h,
  175. C = u(l, !0).join(";").toLowerCase(),
  176. k = u(c, !0).join(";").toLowerCase(),
  177. b = f.HmacSHA1(y, o).toString(),
  178. S = [s, t, d(c), d(l), ""].join("\n"),
  179. R = ["sha1", x, f.SHA1(S).toString(), ""].join("\n");
  180. return ["q-sign-algorithm=sha1", "q-ak=" + v, "q-sign-time=" + x, "q-key-time=" + y, "q-header-list=" + C, "q-url-param-list=" + k, "q-signature=" + f.HmacSHA1(R, b).toString()].join("&");
  181. },
  182. k = function () {},
  183. b = function (e) {
  184. var t = {};
  185. for (var n in e) e.hasOwnProperty(n) && void 0 !== e[n] && null !== e[n] && (t[n] = e[n]);
  186. return t;
  187. },
  188. S = function (e, t, n, i) {
  189. e ? y.readFile({
  190. filePath: e,
  191. position: t,
  192. length: n - t,
  193. success: function (e) {
  194. i(e.data);
  195. },
  196. fail: function () {
  197. i(null);
  198. }
  199. }) : i(null);
  200. },
  201. R = function (e, t, n) {
  202. n = n || k, e && t && t instanceof ArrayBuffer ? j.getFileMd5(t, function (e, t) {
  203. n(t);
  204. }) : n();
  205. },
  206. w = function (e, t) {
  207. var n = m(e);
  208. return t && t(n), n;
  209. },
  210. _ = function (e) {
  211. var t,
  212. n,
  213. i,
  214. a = "";
  215. for (t = 0, n = e.length / 2; t < n; t++) i = parseInt(e[2 * t] + e[2 * t + 1], 16), a += String.fromCharCode(i);
  216. return x(a);
  217. },
  218. A = function () {
  219. var e = function () {
  220. return (65536 * (1 + Math.random()) | 0).toString(16).substring(1);
  221. };
  222. return e() + e() + "-" + e() + "-" + e() + "-" + e() + "-" + e() + e() + e();
  223. },
  224. T = function (e, t) {
  225. var n = t.Bucket,
  226. i = t.Region,
  227. a = t.Key;
  228. if (e.indexOf("Bucket") > -1 || "deleteMultipleObject" === e || "multipartList" === e || "listObjectVersions" === e) {
  229. if (!n) return "Bucket";
  230. if (!i) return "Region";
  231. } else if (e.indexOf("Object") > -1 || e.indexOf("multipart") > -1 || "sliceUploadFile" === e || "abortUploadTask" === e) {
  232. if (!n) return "Bucket";
  233. if (!i) return "Region";
  234. if (!a) return "Key";
  235. }
  236. return !1;
  237. },
  238. E = function (e, t) {
  239. if (t = r({}, t), "getAuth" !== e && "getV4Auth" !== e && "getObjectUrl" !== e) {
  240. var n = t.Headers || {};
  241. if (t && "object" == typeof t) {
  242. !function () {
  243. for (var e in t) t.hasOwnProperty(e) && e.indexOf("x-cos-") > -1 && (n[e] = t[e]);
  244. }();
  245. var i = {
  246. "x-cos-mfa": "MFA",
  247. "Content-MD5": "ContentMD5",
  248. "Content-Length": "ContentLength",
  249. "Content-Type": "ContentType",
  250. Expect: "Expect",
  251. Expires: "Expires",
  252. "Cache-Control": "CacheControl",
  253. "Content-Disposition": "ContentDisposition",
  254. "Content-Encoding": "ContentEncoding",
  255. Range: "Range",
  256. "If-Modified-Since": "IfModifiedSince",
  257. "If-Unmodified-Since": "IfUnmodifiedSince",
  258. "If-Match": "IfMatch",
  259. "If-None-Match": "IfNoneMatch",
  260. "x-cos-copy-source": "CopySource",
  261. "x-cos-copy-source-Range": "CopySourceRange",
  262. "x-cos-metadata-directive": "MetadataDirective",
  263. "x-cos-copy-source-If-Modified-Since": "CopySourceIfModifiedSince",
  264. "x-cos-copy-source-If-Unmodified-Since": "CopySourceIfUnmodifiedSince",
  265. "x-cos-copy-source-If-Match": "CopySourceIfMatch",
  266. "x-cos-copy-source-If-None-Match": "CopySourceIfNoneMatch",
  267. "x-cos-acl": "ACL",
  268. "x-cos-grant-read": "GrantRead",
  269. "x-cos-grant-write": "GrantWrite",
  270. "x-cos-grant-full-control": "GrantFullControl",
  271. "x-cos-grant-read-acp": "GrantReadAcp",
  272. "x-cos-grant-write-acp": "GrantWriteAcp",
  273. "x-cos-storage-class": "StorageClass",
  274. "x-cos-server-side-encryption-customer-algorithm": "SSECustomerAlgorithm",
  275. "x-cos-server-side-encryption-customer-key": "SSECustomerKey",
  276. "x-cos-server-side-encryption-customer-key-MD5": "SSECustomerKeyMD5",
  277. "x-cos-server-side-encryption": "ServerSideEncryption",
  278. "x-cos-server-side-encryption-cos-kms-key-id": "SSEKMSKeyId",
  279. "x-cos-server-side-encryption-context": "SSEContext"
  280. };
  281. j.each(i, function (e, i) {
  282. void 0 !== t[e] && (n[i] = t[e]);
  283. }), t.Headers = b(n);
  284. }
  285. }
  286. return t;
  287. },
  288. B = function (e, n) {
  289. return function (i, a) {
  290. var o = this;
  291. "function" == typeof i && (a = i, i = {}), i = E(e, i);
  292. var r = function (e) {
  293. return e && e.headers && (e.headers["x-cos-version-id"] && (e.VersionId = e.headers["x-cos-version-id"]), e.headers["x-cos-delete-marker"] && (e.DeleteMarker = e.headers["x-cos-delete-marker"])), e;
  294. },
  295. s = function (e, t) {
  296. a && a(r(e), r(t));
  297. },
  298. c = function () {
  299. if ("getService" !== e && "abortUploadTask" !== e) {
  300. var t = T(e, i);
  301. if (t) return "missing param " + t;
  302. if (i.Region) {
  303. if (i.Region.indexOf("cos.") > -1) return 'param Region should not be start with "cos."';
  304. if (!/^([a-z\d-]+)$/.test(i.Region)) return "Region format error.";
  305. o.options.CompatibilityMode || -1 !== i.Region.indexOf("-") || "yfb" === i.Region || "default" === i.Region || console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224");
  306. }
  307. if (i.Bucket) {
  308. if (!/^([a-z\d-]+)-(\d+)$/.test(i.Bucket)) if (i.AppId) i.Bucket = i.Bucket + "-" + i.AppId;else {
  309. if (!o.options.AppId) return 'Bucket should format as "test-1250000000".';
  310. i.Bucket = i.Bucket + "-" + o.options.AppId;
  311. }
  312. i.AppId && (console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'), delete i.AppId);
  313. }
  314. i.Key && "/" === i.Key.substr(0, 1) && (i.Key = i.Key.substr(1));
  315. }
  316. }(),
  317. l = "getAuth" === e || "getObjectUrl" === e,
  318. p = t.Promise;
  319. if (!l && p && !a) return new p(function (e, t) {
  320. if (a = function (n, i) {
  321. n ? t(n) : e(i);
  322. }, c) return s({
  323. error: c
  324. });
  325. n.call(o, i, s);
  326. });
  327. if (c) return s({
  328. error: c
  329. });
  330. var u = n.call(o, i, s);
  331. return l ? u : void 0;
  332. };
  333. },
  334. O = function (e, t) {
  335. function n() {
  336. if (a = 0, t && "function" == typeof t) {
  337. i = Date.now();
  338. var n,
  339. o = Math.max(0, Math.round((s - r) / ((i - c) / 1e3) * 100) / 100) || 0;
  340. n = 0 === s && 0 === e ? 1 : Math.floor(s / e * 100) / 100 || 0, c = i, r = s;
  341. try {
  342. t({
  343. loaded: s,
  344. total: e,
  345. speed: o,
  346. percent: n
  347. });
  348. } catch (e) {}
  349. }
  350. }
  351. var i,
  352. a,
  353. o = this,
  354. r = 0,
  355. s = 0,
  356. c = Date.now();
  357. return function (t, i) {
  358. if (t && (s = t.loaded, e = t.total), i) clearTimeout(a), n();else {
  359. if (a) return;
  360. a = setTimeout(n, o.options.ProgressInterval);
  361. }
  362. };
  363. },
  364. D = function (e, t, n) {
  365. "postObject" === e ? n() : "putObject" === e ? void 0 !== t.Body ? (t.ContentLength = t.Body.byteLength, n(null, t.ContentLength)) : n({
  366. error: "missing param Body"
  367. }) : t.FilePath ? y.stat({
  368. path: t.FilePath,
  369. success: function (e) {
  370. var i = e.stats;
  371. t.FileStat = i, t.FileStat.FilePath = t.FilePath;
  372. var a = i.isDirectory() ? 0 : i.size;
  373. t.ContentLength = a = a || 0, n(null, a);
  374. },
  375. fail: function (e) {
  376. n(e);
  377. }
  378. }) : n({
  379. error: "missing param FilePath"
  380. });
  381. },
  382. N = function (e) {
  383. return Date.now() + (e || 0);
  384. },
  385. I = function (e, t) {
  386. e = e.split("."), t = t.split(".");
  387. for (var n = Math.max(e.length, t.length); e.length < n;) e.push("0");
  388. for (; t.length < n;) t.push("0");
  389. for (var i = 0; i < n; i++) {
  390. var a = parseInt(e[i]),
  391. o = parseInt(t[i]);
  392. if (a > o) return 1;
  393. if (a < o) return -1;
  394. }
  395. return 0;
  396. },
  397. P = function () {
  398. var e = uni.getSystemInfoSync(),
  399. t = I(e.SDKVersion, "2.10.0") >= 0,
  400. n = !t && "devtools" === e.platform;
  401. return function () {
  402. return n && console.warn("\u5f53\u524d\u5c0f\u7a0b\u5e8f\u7248\u672c\u5c0f\u4e8e 2.10.0\uff0c\u4e0d\u652f\u6301\u5206\u7247\u4e0a\u4f20\uff0c\u8bf7\u66f4\u65b0\u8f6f\u4ef6\u3002"), n = !1, t;
  403. };
  404. }(),
  405. j = {
  406. noop: k,
  407. formatParams: E,
  408. apiWrapper: B,
  409. xml2json: h,
  410. json2xml: g,
  411. md5: m,
  412. clearKey: b,
  413. fileSlice: S,
  414. getBodyMd5: R,
  415. getFileMd5: w,
  416. binaryBase64: _,
  417. extend: r,
  418. isArray: s,
  419. isInArray: c,
  420. makeArray: l,
  421. each: p,
  422. map: u,
  423. filter: d,
  424. clone: a,
  425. attr: o,
  426. uuid: A,
  427. camSafeUrlEncode: i,
  428. throttleOnProgress: O,
  429. getFileSize: D,
  430. getSkewTime: N,
  431. getAuth: C,
  432. compareVersion: I,
  433. canFileSlice: P
  434. };
  435. e.exports = j;
  436. }).call(t, n(1));
  437. }, function (e, t) {
  438. var n;
  439. n = function () {
  440. return this;
  441. }();
  442. try {
  443. n = n || Function("return this")() || (0, eval)("this");
  444. } catch (e) {
  445. "object" == typeof window && (n = window);
  446. }
  447. e.exports = n;
  448. }, function (e, t) {
  449. function n(e, t) {
  450. for (var n in e) t[n] = e[n];
  451. }
  452. function i(e, t) {
  453. function i() {}
  454. var a = e.prototype;
  455. if (Object.create) {
  456. var o = Object.create(t.prototype);
  457. a.__proto__ = o;
  458. }
  459. a instanceof t || (i.prototype = t.prototype, i = new i(), n(a, i), e.prototype = a = i), a.constructor != e && ("function" != typeof e && console.error("unknow Class:" + e), a.constructor = e);
  460. }
  461. function a(e, t) {
  462. if (t instanceof Error) var n = t;else n = this, Error.call(this, ae[e]), this.message = ae[e], Error.captureStackTrace && Error.captureStackTrace(this, a);
  463. return n.code = e, t && (this.message = this.message + ": " + t), n;
  464. }
  465. function o() {}
  466. function r(e, t) {
  467. this._node = e, this._refresh = t, s(this);
  468. }
  469. function s(e) {
  470. var t = e._node._inc || e._node.ownerDocument._inc;
  471. if (e._inc != t) {
  472. var i = e._refresh(e._node);
  473. L(e, "length", i.length), n(i, e), e._inc = t;
  474. }
  475. }
  476. function c() {}
  477. function l(e, t) {
  478. for (var n = e.length; n--;) if (e[n] === t) return n;
  479. }
  480. function p(e, t, n, i) {
  481. if (i ? t[l(t, i)] = n : t[t.length++] = n, e) {
  482. n.ownerElement = e;
  483. var a = e.ownerDocument;
  484. a && (i && x(a, e, i), v(a, e, n));
  485. }
  486. }
  487. function u(e, t, n) {
  488. var i = l(t, n);
  489. if (!(i >= 0)) throw a(re, new Error(e.tagName + "@" + n));
  490. for (var o = t.length - 1; i < o;) t[i] = t[++i];
  491. if (t.length = o, e) {
  492. var r = e.ownerDocument;
  493. r && (x(r, e, n), n.ownerElement = null);
  494. }
  495. }
  496. function d(e) {
  497. if (this._features = {}, e) for (var t in e) this._features = e[t];
  498. }
  499. function m() {}
  500. function f(e) {
  501. return "<" == e && "&lt;" || ">" == e && "&gt;" || "&" == e && "&amp;" || '"' == e && "&quot;" || "&#" + e.charCodeAt() + ";";
  502. }
  503. function h(e, t) {
  504. if (t(e)) return !0;
  505. if (e = e.firstChild) do {
  506. if (h(e, t)) return !0;
  507. } while (e = e.nextSibling);
  508. }
  509. function g() {}
  510. function v(e, t, n) {
  511. e && e._inc++, "http://www.w3.org/2000/xmlns/" == n.namespaceURI && (t._nsMap[n.prefix ? n.localName : ""] = n.value);
  512. }
  513. function x(e, t, n, i) {
  514. e && e._inc++, "http://www.w3.org/2000/xmlns/" == n.namespaceURI && delete t._nsMap[n.prefix ? n.localName : ""];
  515. }
  516. function y(e, t, n) {
  517. if (e && e._inc) {
  518. e._inc++;
  519. var i = t.childNodes;
  520. if (n) i[i.length++] = n;else {
  521. for (var a = t.firstChild, o = 0; a;) i[o++] = a, a = a.nextSibling;
  522. i.length = o;
  523. }
  524. }
  525. }
  526. function C(e, t) {
  527. var n = t.previousSibling,
  528. i = t.nextSibling;
  529. return n ? n.nextSibling = i : e.firstChild = i, i ? i.previousSibling = n : e.lastChild = n, y(e.ownerDocument, e), t;
  530. }
  531. function k(e, t, n) {
  532. var i = t.parentNode;
  533. if (i && i.removeChild(t), t.nodeType === te) {
  534. var a = t.firstChild;
  535. if (null == a) return t;
  536. var o = t.lastChild;
  537. } else a = o = t;
  538. var r = n ? n.previousSibling : e.lastChild;
  539. a.previousSibling = r, o.nextSibling = n, r ? r.nextSibling = a : e.firstChild = a, null == n ? e.lastChild = o : n.previousSibling = o;
  540. do {
  541. a.parentNode = e;
  542. } while (a !== o && (a = a.nextSibling));
  543. return y(e.ownerDocument || e, e), t.nodeType == te && (t.firstChild = t.lastChild = null), t;
  544. }
  545. function b(e, t) {
  546. var n = t.parentNode;
  547. if (n) {
  548. var i = e.lastChild;
  549. n.removeChild(t);
  550. var i = e.lastChild;
  551. }
  552. var i = e.lastChild;
  553. return t.parentNode = e, t.previousSibling = i, t.nextSibling = null, i ? i.nextSibling = t : e.firstChild = t, e.lastChild = t, y(e.ownerDocument, e, t), t;
  554. }
  555. function S() {
  556. this._nsMap = {};
  557. }
  558. function R() {}
  559. function w() {}
  560. function _() {}
  561. function A() {}
  562. function T() {}
  563. function E() {}
  564. function B() {}
  565. function O() {}
  566. function D() {}
  567. function N() {}
  568. function I() {}
  569. function P() {}
  570. function j(e, t) {
  571. var n = [],
  572. i = 9 == this.nodeType ? this.documentElement : this,
  573. a = i.prefix,
  574. o = i.namespaceURI;
  575. if (o && null == a) {
  576. var a = i.lookupPrefix(o);
  577. if (null == a) var r = [{
  578. namespace: o,
  579. prefix: null
  580. }];
  581. }
  582. return U(this, n, e, t, r), n.join("");
  583. }
  584. function M(e, t, n) {
  585. var i = e.prefix || "",
  586. a = e.namespaceURI;
  587. if (!i && !a) return !1;
  588. if ("xml" === i && "http://www.w3.org/XML/1998/namespace" === a || "http://www.w3.org/2000/xmlns/" == a) return !1;
  589. for (var o = n.length; o--;) {
  590. var r = n[o];
  591. if (r.prefix == i) return r.namespace != a;
  592. }
  593. return !0;
  594. }
  595. function U(e, t, n, i, a) {
  596. if (i) {
  597. if (!(e = i(e))) return;
  598. if ("string" == typeof e) return void t.push(e);
  599. }
  600. switch (e.nodeType) {
  601. case G:
  602. a || (a = []);
  603. var o = (a.length, e.attributes),
  604. r = o.length,
  605. s = e.firstChild,
  606. c = e.tagName;
  607. n = K === e.namespaceURI || n, t.push("<", c);
  608. for (var l = 0; l < r; l++) {
  609. var p = o.item(l);
  610. "xmlns" == p.prefix ? a.push({
  611. prefix: p.localName,
  612. namespace: p.value
  613. }) : "xmlns" == p.nodeName && a.push({
  614. prefix: "",
  615. namespace: p.value
  616. });
  617. }
  618. for (var l = 0; l < r; l++) {
  619. var p = o.item(l);
  620. if (M(p, n, a)) {
  621. var u = p.prefix || "",
  622. d = p.namespaceURI,
  623. m = u ? " xmlns:" + u : " xmlns";
  624. t.push(m, '="', d, '"'), a.push({
  625. prefix: u,
  626. namespace: d
  627. });
  628. }
  629. U(p, t, n, i, a);
  630. }
  631. if (M(e, n, a)) {
  632. var u = e.prefix || "",
  633. d = e.namespaceURI,
  634. m = u ? " xmlns:" + u : " xmlns";
  635. t.push(m, '="', d, '"'), a.push({
  636. prefix: u,
  637. namespace: d
  638. });
  639. }
  640. if (s || n && !/^(?:meta|link|img|br|hr|input)$/i.test(c)) {
  641. if (t.push(">"), n && /^script$/i.test(c)) for (; s;) s.data ? t.push(s.data) : U(s, t, n, i, a), s = s.nextSibling;else for (; s;) U(s, t, n, i, a), s = s.nextSibling;
  642. t.push("</", c, ">");
  643. } else t.push("/>");
  644. return;
  645. case Z:
  646. case te:
  647. for (var s = e.firstChild; s;) U(s, t, n, i, a), s = s.nextSibling;
  648. return;
  649. case V:
  650. return t.push(" ", e.name, '="', e.value.replace(/[<&"]/g, f), '"');
  651. case X:
  652. return t.push(e.data.replace(/[<&]/g, f));
  653. case W:
  654. return t.push("<![CDATA[", e.data, "]]>");
  655. case Y:
  656. return t.push("\x3c!--", e.data, "--\x3e");
  657. case ee:
  658. var h = e.publicId,
  659. g = e.systemId;
  660. if (t.push("<!DOCTYPE ", e.name), h) t.push(' PUBLIC "', h), g && "." != g && t.push('" "', g), t.push('">');else if (g && "." != g) t.push(' SYSTEM "', g, '">');else {
  661. var v = e.internalSubset;
  662. v && t.push(" [", v, "]"), t.push(">");
  663. }
  664. return;
  665. case J:
  666. return t.push("<?", e.target, " ", e.data, "?>");
  667. case $:
  668. return t.push("&", e.nodeName, ";");
  669. default:
  670. t.push("??", e.nodeName);
  671. }
  672. }
  673. function F(e, t, n) {
  674. var i;
  675. switch (t.nodeType) {
  676. case G:
  677. i = t.cloneNode(!1), i.ownerDocument = e;
  678. case te:
  679. break;
  680. case V:
  681. n = !0;
  682. }
  683. if (i || (i = t.cloneNode(!1)), i.ownerDocument = e, i.parentNode = null, n) for (var a = t.firstChild; a;) i.appendChild(F(e, a, n)), a = a.nextSibling;
  684. return i;
  685. }
  686. function H(e, t, n) {
  687. var i = new t.constructor();
  688. for (var a in t) {
  689. var r = t[a];
  690. "object" != typeof r && r != i[a] && (i[a] = r);
  691. }
  692. switch (t.childNodes && (i.childNodes = new o()), i.ownerDocument = e, i.nodeType) {
  693. case G:
  694. var s = t.attributes,
  695. l = i.attributes = new c(),
  696. p = s.length;
  697. l._ownerElement = i;
  698. for (var u = 0; u < p; u++) i.setAttributeNode(H(e, s.item(u), !0));
  699. break;
  700. case V:
  701. n = !0;
  702. }
  703. if (n) for (var d = t.firstChild; d;) i.appendChild(H(e, d, n)), d = d.nextSibling;
  704. return i;
  705. }
  706. function L(e, t, n) {
  707. e[t] = n;
  708. }
  709. function z(e) {
  710. switch (e.nodeType) {
  711. case G:
  712. case te:
  713. var t = [];
  714. for (e = e.firstChild; e;) 7 !== e.nodeType && 8 !== e.nodeType && t.push(z(e)), e = e.nextSibling;
  715. return t.join("");
  716. default:
  717. return e.nodeValue;
  718. }
  719. }
  720. var K = "http://www.w3.org/1999/xhtml",
  721. q = {},
  722. G = q.ELEMENT_NODE = 1,
  723. V = q.ATTRIBUTE_NODE = 2,
  724. X = q.TEXT_NODE = 3,
  725. W = q.CDATA_SECTION_NODE = 4,
  726. $ = q.ENTITY_REFERENCE_NODE = 5,
  727. Q = q.ENTITY_NODE = 6,
  728. J = q.PROCESSING_INSTRUCTION_NODE = 7,
  729. Y = q.COMMENT_NODE = 8,
  730. Z = q.DOCUMENT_NODE = 9,
  731. ee = q.DOCUMENT_TYPE_NODE = 10,
  732. te = q.DOCUMENT_FRAGMENT_NODE = 11,
  733. ne = q.NOTATION_NODE = 12,
  734. ie = {},
  735. ae = {},
  736. oe = (ie.INDEX_SIZE_ERR = (ae[1] = "Index size error", 1), ie.DOMSTRING_SIZE_ERR = (ae[2] = "DOMString size error", 2), ie.HIERARCHY_REQUEST_ERR = (ae[3] = "Hierarchy request error", 3)),
  737. re = (ie.WRONG_DOCUMENT_ERR = (ae[4] = "Wrong document", 4), ie.INVALID_CHARACTER_ERR = (ae[5] = "Invalid character", 5), ie.NO_DATA_ALLOWED_ERR = (ae[6] = "No data allowed", 6), ie.NO_MODIFICATION_ALLOWED_ERR = (ae[7] = "No modification allowed", 7), ie.NOT_FOUND_ERR = (ae[8] = "Not found", 8)),
  738. se = (ie.NOT_SUPPORTED_ERR = (ae[9] = "Not supported", 9), ie.INUSE_ATTRIBUTE_ERR = (ae[10] = "Attribute in use", 10));
  739. ie.INVALID_STATE_ERR = (ae[11] = "Invalid state", 11), ie.SYNTAX_ERR = (ae[12] = "Syntax error", 12), ie.INVALID_MODIFICATION_ERR = (ae[13] = "Invalid modification", 13), ie.NAMESPACE_ERR = (ae[14] = "Invalid namespace", 14), ie.INVALID_ACCESS_ERR = (ae[15] = "Invalid access", 15);
  740. a.prototype = Error.prototype, n(ie, a), o.prototype = {
  741. length: 0,
  742. item: function (e) {
  743. return this[e] || null;
  744. },
  745. toString: function (e, t) {
  746. for (var n = [], i = 0; i < this.length; i++) U(this[i], n, e, t);
  747. return n.join("");
  748. }
  749. }, r.prototype.item = function (e) {
  750. return s(this), this[e];
  751. }, i(r, o), c.prototype = {
  752. length: 0,
  753. item: o.prototype.item,
  754. getNamedItem: function (e) {
  755. for (var t = this.length; t--;) {
  756. var n = this[t];
  757. if (n.nodeName == e) return n;
  758. }
  759. },
  760. setNamedItem: function (e) {
  761. var t = e.ownerElement;
  762. if (t && t != this._ownerElement) throw new a(se);
  763. var n = this.getNamedItem(e.nodeName);
  764. return p(this._ownerElement, this, e, n), n;
  765. },
  766. setNamedItemNS: function (e) {
  767. var t,
  768. n = e.ownerElement;
  769. if (n && n != this._ownerElement) throw new a(se);
  770. return t = this.getNamedItemNS(e.namespaceURI, e.localName), p(this._ownerElement, this, e, t), t;
  771. },
  772. removeNamedItem: function (e) {
  773. var t = this.getNamedItem(e);
  774. return u(this._ownerElement, this, t), t;
  775. },
  776. removeNamedItemNS: function (e, t) {
  777. var n = this.getNamedItemNS(e, t);
  778. return u(this._ownerElement, this, n), n;
  779. },
  780. getNamedItemNS: function (e, t) {
  781. for (var n = this.length; n--;) {
  782. var i = this[n];
  783. if (i.localName == t && i.namespaceURI == e) return i;
  784. }
  785. return null;
  786. }
  787. }, d.prototype = {
  788. hasFeature: function (e, t) {
  789. var n = this._features[e.toLowerCase()];
  790. return !(!n || t && !(t in n));
  791. },
  792. createDocument: function (e, t, n) {
  793. var i = new g();
  794. if (i.implementation = this, i.childNodes = new o(), i.doctype = n, n && i.appendChild(n), t) {
  795. var a = i.createElementNS(e, t);
  796. i.appendChild(a);
  797. }
  798. return i;
  799. },
  800. createDocumentType: function (e, t, n) {
  801. var i = new E();
  802. return i.name = e, i.nodeName = e, i.publicId = t, i.systemId = n, i;
  803. }
  804. }, m.prototype = {
  805. firstChild: null,
  806. lastChild: null,
  807. previousSibling: null,
  808. nextSibling: null,
  809. attributes: null,
  810. parentNode: null,
  811. childNodes: null,
  812. ownerDocument: null,
  813. nodeValue: null,
  814. namespaceURI: null,
  815. prefix: null,
  816. localName: null,
  817. insertBefore: function (e, t) {
  818. return k(this, e, t);
  819. },
  820. replaceChild: function (e, t) {
  821. this.insertBefore(e, t), t && this.removeChild(t);
  822. },
  823. removeChild: function (e) {
  824. return C(this, e);
  825. },
  826. appendChild: function (e) {
  827. return this.insertBefore(e, null);
  828. },
  829. hasChildNodes: function () {
  830. return null != this.firstChild;
  831. },
  832. cloneNode: function (e) {
  833. return H(this.ownerDocument || this, this, e);
  834. },
  835. normalize: function () {
  836. for (var e = this.firstChild; e;) {
  837. var t = e.nextSibling;
  838. t && t.nodeType == X && e.nodeType == X ? (this.removeChild(t), e.appendData(t.data)) : (e.normalize(), e = t);
  839. }
  840. },
  841. isSupported: function (e, t) {
  842. return this.ownerDocument.implementation.hasFeature(e, t);
  843. },
  844. hasAttributes: function () {
  845. return this.attributes.length > 0;
  846. },
  847. lookupPrefix: function (e) {
  848. for (var t = this; t;) {
  849. var n = t._nsMap;
  850. if (n) for (var i in n) if (n[i] == e) return i;
  851. t = t.nodeType == V ? t.ownerDocument : t.parentNode;
  852. }
  853. return null;
  854. },
  855. lookupNamespaceURI: function (e) {
  856. for (var t = this; t;) {
  857. var n = t._nsMap;
  858. if (n && e in n) return n[e];
  859. t = t.nodeType == V ? t.ownerDocument : t.parentNode;
  860. }
  861. return null;
  862. },
  863. isDefaultNamespace: function (e) {
  864. return null == this.lookupPrefix(e);
  865. }
  866. }, n(q, m), n(q, m.prototype), g.prototype = {
  867. nodeName: "#document",
  868. nodeType: Z,
  869. doctype: null,
  870. documentElement: null,
  871. _inc: 1,
  872. insertBefore: function (e, t) {
  873. if (e.nodeType == te) {
  874. for (var n = e.firstChild; n;) {
  875. var i = n.nextSibling;
  876. this.insertBefore(n, t), n = i;
  877. }
  878. return e;
  879. }
  880. return null == this.documentElement && e.nodeType == G && (this.documentElement = e), k(this, e, t), e.ownerDocument = this, e;
  881. },
  882. removeChild: function (e) {
  883. return this.documentElement == e && (this.documentElement = null), C(this, e);
  884. },
  885. importNode: function (e, t) {
  886. return F(this, e, t);
  887. },
  888. getElementById: function (e) {
  889. var t = null;
  890. return h(this.documentElement, function (n) {
  891. if (n.nodeType == G && n.getAttribute("id") == e) return t = n, !0;
  892. }), t;
  893. },
  894. createElement: function (e) {
  895. var t = new S();
  896. return t.ownerDocument = this, t.nodeName = e, t.tagName = e, t.childNodes = new o(), (t.attributes = new c())._ownerElement = t, t;
  897. },
  898. createDocumentFragment: function () {
  899. var e = new N();
  900. return e.ownerDocument = this, e.childNodes = new o(), e;
  901. },
  902. createTextNode: function (e) {
  903. var t = new _();
  904. return t.ownerDocument = this, t.appendData(e), t;
  905. },
  906. createComment: function (e) {
  907. var t = new A();
  908. return t.ownerDocument = this, t.appendData(e), t;
  909. },
  910. createCDATASection: function (e) {
  911. var t = new T();
  912. return t.ownerDocument = this, t.appendData(e), t;
  913. },
  914. createProcessingInstruction: function (e, t) {
  915. var n = new I();
  916. return n.ownerDocument = this, n.tagName = n.target = e, n.nodeValue = n.data = t, n;
  917. },
  918. createAttribute: function (e) {
  919. var t = new R();
  920. return t.ownerDocument = this, t.name = e, t.nodeName = e, t.localName = e, t.specified = !0, t;
  921. },
  922. createEntityReference: function (e) {
  923. var t = new D();
  924. return t.ownerDocument = this, t.nodeName = e, t;
  925. },
  926. createElementNS: function (e, t) {
  927. var n = new S(),
  928. i = t.split(":"),
  929. a = n.attributes = new c();
  930. return n.childNodes = new o(), n.ownerDocument = this, n.nodeName = t, n.tagName = t, n.namespaceURI = e, 2 == i.length ? (n.prefix = i[0], n.localName = i[1]) : n.localName = t, a._ownerElement = n, n;
  931. },
  932. createAttributeNS: function (e, t) {
  933. var n = new R(),
  934. i = t.split(":");
  935. return n.ownerDocument = this, n.nodeName = t, n.name = t, n.namespaceURI = e, n.specified = !0, 2 == i.length ? (n.prefix = i[0], n.localName = i[1]) : n.localName = t, n;
  936. }
  937. }, i(g, m), S.prototype = {
  938. nodeType: G,
  939. hasAttribute: function (e) {
  940. return null != this.getAttributeNode(e);
  941. },
  942. getAttribute: function (e) {
  943. var t = this.getAttributeNode(e);
  944. return t && t.value || "";
  945. },
  946. getAttributeNode: function (e) {
  947. return this.attributes.getNamedItem(e);
  948. },
  949. setAttribute: function (e, t) {
  950. var n = this.ownerDocument.createAttribute(e);
  951. n.value = n.nodeValue = "" + t, this.setAttributeNode(n);
  952. },
  953. removeAttribute: function (e) {
  954. var t = this.getAttributeNode(e);
  955. t && this.removeAttributeNode(t);
  956. },
  957. appendChild: function (e) {
  958. return e.nodeType === te ? this.insertBefore(e, null) : b(this, e);
  959. },
  960. setAttributeNode: function (e) {
  961. return this.attributes.setNamedItem(e);
  962. },
  963. setAttributeNodeNS: function (e) {
  964. return this.attributes.setNamedItemNS(e);
  965. },
  966. removeAttributeNode: function (e) {
  967. return this.attributes.removeNamedItem(e.nodeName);
  968. },
  969. removeAttributeNS: function (e, t) {
  970. var n = this.getAttributeNodeNS(e, t);
  971. n && this.removeAttributeNode(n);
  972. },
  973. hasAttributeNS: function (e, t) {
  974. return null != this.getAttributeNodeNS(e, t);
  975. },
  976. getAttributeNS: function (e, t) {
  977. var n = this.getAttributeNodeNS(e, t);
  978. return n && n.value || "";
  979. },
  980. setAttributeNS: function (e, t, n) {
  981. var i = this.ownerDocument.createAttributeNS(e, t);
  982. i.value = i.nodeValue = "" + n, this.setAttributeNode(i);
  983. },
  984. getAttributeNodeNS: function (e, t) {
  985. return this.attributes.getNamedItemNS(e, t);
  986. },
  987. getElementsByTagName: function (e) {
  988. return new r(this, function (t) {
  989. var n = [];
  990. return h(t, function (i) {
  991. i === t || i.nodeType != G || "*" !== e && i.tagName != e || n.push(i);
  992. }), n;
  993. });
  994. },
  995. getElementsByTagNameNS: function (e, t) {
  996. return new r(this, function (n) {
  997. var i = [];
  998. return h(n, function (a) {
  999. a === n || a.nodeType !== G || "*" !== e && a.namespaceURI !== e || "*" !== t && a.localName != t || i.push(a);
  1000. }), i;
  1001. });
  1002. }
  1003. }, g.prototype.getElementsByTagName = S.prototype.getElementsByTagName, g.prototype.getElementsByTagNameNS = S.prototype.getElementsByTagNameNS, i(S, m), R.prototype.nodeType = V, i(R, m), w.prototype = {
  1004. data: "",
  1005. substringData: function (e, t) {
  1006. return this.data.substring(e, e + t);
  1007. },
  1008. appendData: function (e) {
  1009. e = this.data + e, this.nodeValue = this.data = e, this.length = e.length;
  1010. },
  1011. insertData: function (e, t) {
  1012. this.replaceData(e, 0, t);
  1013. },
  1014. appendChild: function (e) {
  1015. throw new Error(ae[oe]);
  1016. },
  1017. deleteData: function (e, t) {
  1018. this.replaceData(e, t, "");
  1019. },
  1020. replaceData: function (e, t, n) {
  1021. n = this.data.substring(0, e) + n + this.data.substring(e + t), this.nodeValue = this.data = n, this.length = n.length;
  1022. }
  1023. }, i(w, m), _.prototype = {
  1024. nodeName: "#text",
  1025. nodeType: X,
  1026. splitText: function (e) {
  1027. var t = this.data,
  1028. n = t.substring(e);
  1029. t = t.substring(0, e), this.data = this.nodeValue = t, this.length = t.length;
  1030. var i = this.ownerDocument.createTextNode(n);
  1031. return this.parentNode && this.parentNode.insertBefore(i, this.nextSibling), i;
  1032. }
  1033. }, i(_, w), A.prototype = {
  1034. nodeName: "#comment",
  1035. nodeType: Y
  1036. }, i(A, w), T.prototype = {
  1037. nodeName: "#cdata-section",
  1038. nodeType: W
  1039. }, i(T, w), E.prototype.nodeType = ee, i(E, m), B.prototype.nodeType = ne, i(B, m), O.prototype.nodeType = Q, i(O, m), D.prototype.nodeType = $, i(D, m), N.prototype.nodeName = "#document-fragment", N.prototype.nodeType = te, i(N, m), I.prototype.nodeType = J, i(I, m), P.prototype.serializeToString = function (e, t, n) {
  1040. return j.call(e, t, n);
  1041. }, m.prototype.toString = j;
  1042. try {
  1043. Object.defineProperty && (Object.defineProperty(r.prototype, "length", {
  1044. get: function () {
  1045. return s(this), this.$$length;
  1046. }
  1047. }), Object.defineProperty(m.prototype, "textContent", {
  1048. get: function () {
  1049. return z(this);
  1050. },
  1051. set: function (e) {
  1052. switch (this.nodeType) {
  1053. case G:
  1054. case te:
  1055. for (; this.firstChild;) this.removeChild(this.firstChild);
  1056. (e || String(e)) && this.appendChild(this.ownerDocument.createTextNode(e));
  1057. break;
  1058. default:
  1059. this.data = e, this.value = e, this.nodeValue = e;
  1060. }
  1061. }
  1062. }), L = function (e, t, n) {
  1063. e["$$" + t] = n;
  1064. });
  1065. } catch (e) {}
  1066. t.DOMImplementation = d, t.XMLSerializer = P;
  1067. }, function (e, t) {
  1068. var n = function (e) {
  1069. e = e || {};
  1070. var t,
  1071. n = e.Base64,
  1072. i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  1073. a = function (e) {
  1074. for (var t = {}, n = 0, i = e.length; n < i; n++) t[e.charAt(n)] = n;
  1075. return t;
  1076. }(i),
  1077. o = String.fromCharCode,
  1078. r = function (e) {
  1079. if (e.length < 2) {
  1080. var t = e.charCodeAt(0);
  1081. return t < 128 ? e : t < 2048 ? o(192 | t >>> 6) + o(128 | 63 & t) : o(224 | t >>> 12 & 15) + o(128 | t >>> 6 & 63) + o(128 | 63 & t);
  1082. }
  1083. var t = 65536 + 1024 * (e.charCodeAt(0) - 55296) + (e.charCodeAt(1) - 56320);
  1084. return o(240 | t >>> 18 & 7) + o(128 | t >>> 12 & 63) + o(128 | t >>> 6 & 63) + o(128 | 63 & t);
  1085. },
  1086. s = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,
  1087. c = function (e) {
  1088. return e.replace(s, r);
  1089. },
  1090. l = function (e) {
  1091. var t = [0, 2, 1][e.length % 3],
  1092. n = e.charCodeAt(0) << 16 | (e.length > 1 ? e.charCodeAt(1) : 0) << 8 | (e.length > 2 ? e.charCodeAt(2) : 0);
  1093. return [i.charAt(n >>> 18), i.charAt(n >>> 12 & 63), t >= 2 ? "=" : i.charAt(n >>> 6 & 63), t >= 1 ? "=" : i.charAt(63 & n)].join("");
  1094. },
  1095. p = e.btoa ? function (t) {
  1096. return e.btoa(t);
  1097. } : function (e) {
  1098. return e.replace(/[\s\S]{1,3}/g, l);
  1099. },
  1100. u = t ? function (e) {
  1101. return (e.constructor === t.constructor ? e : new t(e)).toString("base64");
  1102. } : function (e) {
  1103. return p(c(e));
  1104. },
  1105. d = function (e, t) {
  1106. return t ? u(String(e)).replace(/[+\/]/g, function (e) {
  1107. return "+" == e ? "-" : "_";
  1108. }).replace(/=/g, "") : u(String(e));
  1109. },
  1110. m = function (e) {
  1111. return d(e, !0);
  1112. },
  1113. f = new RegExp(["[\xc0-\xdf][\x80-\xbf]", "[\xe0-\xef][\x80-\xbf]{2}", "[\xf0-\xf7][\x80-\xbf]{3}"].join("|"), "g"),
  1114. h = function (e) {
  1115. switch (e.length) {
  1116. case 4:
  1117. var t = (7 & e.charCodeAt(0)) << 18 | (63 & e.charCodeAt(1)) << 12 | (63 & e.charCodeAt(2)) << 6 | 63 & e.charCodeAt(3),
  1118. n = t - 65536;
  1119. return o(55296 + (n >>> 10)) + o(56320 + (1023 & n));
  1120. case 3:
  1121. return o((15 & e.charCodeAt(0)) << 12 | (63 & e.charCodeAt(1)) << 6 | 63 & e.charCodeAt(2));
  1122. default:
  1123. return o((31 & e.charCodeAt(0)) << 6 | 63 & e.charCodeAt(1));
  1124. }
  1125. },
  1126. g = function (e) {
  1127. return e.replace(f, h);
  1128. },
  1129. v = function (e) {
  1130. var t = e.length,
  1131. n = t % 4,
  1132. i = (t > 0 ? a[e.charAt(0)] << 18 : 0) | (t > 1 ? a[e.charAt(1)] << 12 : 0) | (t > 2 ? a[e.charAt(2)] << 6 : 0) | (t > 3 ? a[e.charAt(3)] : 0),
  1133. r = [o(i >>> 16), o(i >>> 8 & 255), o(255 & i)];
  1134. return r.length -= [0, 0, 2, 1][n], r.join("");
  1135. },
  1136. x = e.atob ? function (t) {
  1137. return e.atob(t);
  1138. } : function (e) {
  1139. return e.replace(/[\s\S]{1,4}/g, v);
  1140. },
  1141. y = t ? function (e) {
  1142. return (e.constructor === t.constructor ? e : new t(e, "base64")).toString();
  1143. } : function (e) {
  1144. return g(x(e));
  1145. },
  1146. C = function (e) {
  1147. return y(String(e).replace(/[-_]/g, function (e) {
  1148. return "-" == e ? "+" : "/";
  1149. }).replace(/[^A-Za-z0-9\+\/]/g, ""));
  1150. };
  1151. return {
  1152. VERSION: "2.1.9",
  1153. atob: x,
  1154. btoa: p,
  1155. fromBase64: C,
  1156. toBase64: d,
  1157. utob: c,
  1158. encode: d,
  1159. encodeURI: m,
  1160. btou: g,
  1161. decode: C,
  1162. noConflict: function () {
  1163. var t = e.Base64;
  1164. return e.Base64 = n, t;
  1165. }
  1166. };
  1167. }();
  1168. e.exports = n;
  1169. }, function (e, t) {
  1170. var n = function (e) {
  1171. var t = {},
  1172. n = function (e) {
  1173. return !t[e] && (t[e] = []), t[e];
  1174. };
  1175. e.on = function (e, t) {
  1176. n(e).push(t);
  1177. }, e.off = function (e, t) {
  1178. for (var i = n(e), a = i.length - 1; a >= 0; a--) t === i[a] && i.splice(a, 1);
  1179. }, e.emit = function (e, t) {
  1180. for (var i = n(e).map(function (e) {
  1181. return e;
  1182. }), a = 0; a < i.length; a++) i[a](t);
  1183. };
  1184. },
  1185. i = function () {
  1186. n(this);
  1187. };
  1188. e.exports.init = n, e.exports.EventProxy = i;
  1189. }, function (e, t, n) {
  1190. var i,
  1191. a,
  1192. o = n(0),
  1193. r = function () {
  1194. try {
  1195. var e = JSON.parse(uni.getStorageSync("cos_sdk_upload_cache"));
  1196. } catch (e) {}
  1197. return e || (e = []), e;
  1198. },
  1199. s = function () {
  1200. try {
  1201. uni.setStorageSync("cos_sdk_upload_cache", JSON.stringify(i));
  1202. } catch (e) {}
  1203. },
  1204. c = function () {
  1205. if (!i) {
  1206. i = r();
  1207. for (var e = !1, t = Math.round(Date.now() / 1e3), n = i.length - 1; n >= 0; n--) {
  1208. var a = i[n][2];
  1209. (!a || a + 2592e3 < t) && (i.splice(n, 1), e = !0);
  1210. }
  1211. e && s();
  1212. }
  1213. },
  1214. l = function () {
  1215. a || (a = setTimeout(function () {
  1216. s(), a = null;
  1217. }, 400));
  1218. },
  1219. p = {
  1220. using: {},
  1221. setUsing: function (e) {
  1222. p.using[e] = !0;
  1223. },
  1224. removeUsing: function (e) {
  1225. delete p.using[e];
  1226. },
  1227. getFileId: function (e, t, n, i) {
  1228. return e.FilePath && e.size && e.lastModifiedTime && t ? o.md5([e.FilePath].join("::")) + "-" + o.md5([e.size, e.mode, e.lastAccessedTime, e.lastModifiedTime, t, n, i].join("::")) : null;
  1229. },
  1230. getUploadIdList: function (e) {
  1231. if (!e) return null;
  1232. c();
  1233. for (var t = [], n = 0; n < i.length; n++) i[n][0] === e && t.push(i[n][1]);
  1234. return t.length ? t : null;
  1235. },
  1236. saveUploadId: function (e, t, n) {
  1237. if (c(), e) {
  1238. for (var a = e.substr(0, e.indexOf("-") + 1), o = i.length - 1; o >= 0; o--) {
  1239. var r = i[o];
  1240. r[0] === e && r[1] === t ? i.splice(o, 1) : e !== r[0] && 0 === r[0].indexOf(a) && i.splice(o, 1);
  1241. }
  1242. i.unshift([e, t, Math.round(Date.now() / 1e3)]), i.length > n && i.splice(n), l();
  1243. }
  1244. },
  1245. removeUploadId: function (e) {
  1246. c(), delete p.using[e];
  1247. for (var t = i.length - 1; t >= 0; t--) i[t][1] === e && i.splice(t, 1);
  1248. l();
  1249. }
  1250. };
  1251. e.exports = p;
  1252. }, function (e, t, n) {
  1253. var i = n(7);
  1254. e.exports = i;
  1255. }, function (e, t, n) {
  1256. var i = n(0),
  1257. a = n(4),
  1258. o = n(16),
  1259. r = n(17),
  1260. s = n(23),
  1261. c = {
  1262. SecretId: "",
  1263. SecretKey: "",
  1264. XCosSecurityToken: "",
  1265. ChunkRetryTimes: 2,
  1266. FileParallelLimit: 3,
  1267. ChunkParallelLimit: 3,
  1268. ChunkSize: 1048576,
  1269. SliceSize: 1048576,
  1270. CopyChunkParallelLimit: 20,
  1271. CopyChunkSize: 10485760,
  1272. CopySliceSize: 10485760,
  1273. MaxPartNumber: 1e4,
  1274. ProgressInterval: 1e3,
  1275. UploadQueueSize: 1e4,
  1276. Domain: "",
  1277. ServiceDomain: "",
  1278. Protocol: "",
  1279. CompatibilityMode: !1,
  1280. ForcePathStyle: !1,
  1281. Timeout: 0,
  1282. CorrectClockSkew: !0,
  1283. SystemClockOffset: 0,
  1284. UploadCheckContentMd5: !1,
  1285. UploadIdCacheLimit: 50
  1286. },
  1287. l = function (e) {
  1288. this.options = i.extend(i.clone(c), e || {}), this.options.FileParallelLimit = Math.max(1, this.options.FileParallelLimit), this.options.ChunkParallelLimit = Math.max(1, this.options.ChunkParallelLimit), this.options.ChunkRetryTimes = Math.max(0, this.options.ChunkRetryTimes), this.options.ChunkSize = Math.max(1048576, this.options.ChunkSize), this.options.CopyChunkParallelLimit = Math.max(1, this.options.CopyChunkParallelLimit), this.options.CopyChunkSize = Math.max(1048576, this.options.CopyChunkSize), this.options.CopySliceSize = Math.max(0, this.options.CopySliceSize), this.options.MaxPartNumber = Math.max(1024, Math.min(1e4, this.options.MaxPartNumber)), this.options.Timeout = Math.max(0, this.options.Timeout), this.options.AppId && console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'), a.init(this), o.init(this);
  1289. };
  1290. r.init(l, o), s.init(l, o), l.getAuthorization = i.getAuth, l.version = "1.0.6", e.exports = l;
  1291. }, function (module, exports, __webpack_require__) {
  1292. (function (process, global) {
  1293. var __WEBPACK_AMD_DEFINE_RESULT__;
  1294. !function () {
  1295. function Md5(e) {
  1296. if (e) blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0, this.blocks = blocks, this.buffer8 = buffer8;else if (ARRAY_BUFFER) {
  1297. var t = new ArrayBuffer(68);
  1298. this.buffer8 = new Uint8Array(t), this.blocks = new Uint32Array(t);
  1299. } else this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  1300. this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0;
  1301. }
  1302. var ERROR = "input is invalid type",
  1303. WINDOW = "object" == typeof window,
  1304. root = WINDOW ? window : {};
  1305. root.JS_MD5_NO_WINDOW && (WINDOW = !1);
  1306. var WEB_WORKER = !WINDOW && "object" == typeof self,
  1307. NODE_JS = !root.JS_MD5_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node;
  1308. NODE_JS ? root = global : WEB_WORKER && (root = self);
  1309. var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && "object" == typeof module && module.exports,
  1310. AMD = __webpack_require__(10),
  1311. ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,
  1312. HEX_CHARS = "0123456789abcdef".split(""),
  1313. EXTRA = [128, 32768, 8388608, -2147483648],
  1314. SHIFT = [0, 8, 16, 24],
  1315. OUTPUT_TYPES = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"],
  1316. BASE64_ENCODE_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
  1317. blocks = [],
  1318. buffer8;
  1319. if (ARRAY_BUFFER) {
  1320. var buffer = new ArrayBuffer(68);
  1321. buffer8 = new Uint8Array(buffer), blocks = new Uint32Array(buffer);
  1322. }
  1323. !root.JS_MD5_NO_NODE_JS && Array.isArray || (Array.isArray = function (e) {
  1324. return "[object Array]" === Object.prototype.toString.call(e);
  1325. }), !ARRAY_BUFFER || !root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW && ArrayBuffer.isView || (ArrayBuffer.isView = function (e) {
  1326. return "object" == typeof e && e.buffer && e.buffer.constructor === ArrayBuffer;
  1327. });
  1328. var createOutputMethod = function (e) {
  1329. return function (t) {
  1330. return new Md5(!0).update(t)[e]();
  1331. };
  1332. },
  1333. createMethod = function () {
  1334. var e = createOutputMethod("hex");
  1335. NODE_JS && (e = nodeWrap(e)), e.getCtx = e.create = function () {
  1336. return new Md5();
  1337. }, e.update = function (t) {
  1338. return e.create().update(t);
  1339. };
  1340. for (var t = 0; t < OUTPUT_TYPES.length; ++t) {
  1341. var n = OUTPUT_TYPES[t];
  1342. e[n] = createOutputMethod(n);
  1343. }
  1344. return e;
  1345. },
  1346. nodeWrap = function (method) {
  1347. var crypto = eval("require('crypto')"),
  1348. Buffer = eval("require('buffer').Buffer"),
  1349. nodeMethod = function (e) {
  1350. if ("string" == typeof e) return crypto.createHash("md5").update(e, "utf8").digest("hex");
  1351. if (null === e || void 0 === e) throw ERROR;
  1352. return e.constructor === ArrayBuffer && (e = new Uint8Array(e)), Array.isArray(e) || ArrayBuffer.isView(e) || e.constructor === Buffer ? crypto.createHash("md5").update(new Buffer(e)).digest("hex") : method(e);
  1353. };
  1354. return nodeMethod;
  1355. };
  1356. Md5.prototype.update = function (e) {
  1357. if (!this.finalized) {
  1358. var t,
  1359. n = typeof e;
  1360. if ("string" !== n) {
  1361. if ("object" !== n) throw ERROR;
  1362. if (null === e) throw ERROR;
  1363. if (!ARRAY_BUFFER || e.constructor !== ArrayBuffer && "ArrayBuffer" !== e.constructor.name) {
  1364. if (!(Array.isArray(e) || ARRAY_BUFFER && ArrayBuffer.isView(e))) throw ERROR;
  1365. } else e = new Uint8Array(e);
  1366. t = !0;
  1367. }
  1368. for (var i, a, o = 0, r = e.length, s = this.blocks, c = this.buffer8; o < r;) {
  1369. if (this.hashed && (this.hashed = !1, s[0] = s[16], s[16] = s[1] = s[2] = s[3] = s[4] = s[5] = s[6] = s[7] = s[8] = s[9] = s[10] = s[11] = s[12] = s[13] = s[14] = s[15] = 0), t) {
  1370. if (ARRAY_BUFFER) for (a = this.start; o < r && a < 64; ++o) c[a++] = e[o];else for (a = this.start; o < r && a < 64; ++o) s[a >> 2] |= e[o] << SHIFT[3 & a++];
  1371. } else if (ARRAY_BUFFER) for (a = this.start; o < r && a < 64; ++o) i = e.charCodeAt(o), i < 128 ? c[a++] = i : i < 2048 ? (c[a++] = 192 | i >> 6, c[a++] = 128 | 63 & i) : i < 55296 || i >= 57344 ? (c[a++] = 224 | i >> 12, c[a++] = 128 | i >> 6 & 63, c[a++] = 128 | 63 & i) : (i = 65536 + ((1023 & i) << 10 | 1023 & e.charCodeAt(++o)), c[a++] = 240 | i >> 18, c[a++] = 128 | i >> 12 & 63, c[a++] = 128 | i >> 6 & 63, c[a++] = 128 | 63 & i);else for (a = this.start; o < r && a < 64; ++o) i = e.charCodeAt(o), i < 128 ? s[a >> 2] |= i << SHIFT[3 & a++] : i < 2048 ? (s[a >> 2] |= (192 | i >> 6) << SHIFT[3 & a++], s[a >> 2] |= (128 | 63 & i) << SHIFT[3 & a++]) : i < 55296 || i >= 57344 ? (s[a >> 2] |= (224 | i >> 12) << SHIFT[3 & a++], s[a >> 2] |= (128 | i >> 6 & 63) << SHIFT[3 & a++], s[a >> 2] |= (128 | 63 & i) << SHIFT[3 & a++]) : (i = 65536 + ((1023 & i) << 10 | 1023 & e.charCodeAt(++o)), s[a >> 2] |= (240 | i >> 18) << SHIFT[3 & a++], s[a >> 2] |= (128 | i >> 12 & 63) << SHIFT[3 & a++], s[a >> 2] |= (128 | i >> 6 & 63) << SHIFT[3 & a++], s[a >> 2] |= (128 | 63 & i) << SHIFT[3 & a++]);
  1372. this.lastByteIndex = a, this.bytes += a - this.start, a >= 64 ? (this.start = a - 64, this.hash(), this.hashed = !0) : this.start = a;
  1373. }
  1374. return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
  1375. }
  1376. }, Md5.prototype.finalize = function () {
  1377. if (!this.finalized) {
  1378. this.finalized = !0;
  1379. var e = this.blocks,
  1380. t = this.lastByteIndex;
  1381. e[t >> 2] |= EXTRA[3 & t], t >= 56 && (this.hashed || this.hash(), e[0] = e[16], e[16] = e[1] = e[2] = e[3] = e[4] = e[5] = e[6] = e[7] = e[8] = e[9] = e[10] = e[11] = e[12] = e[13] = e[14] = e[15] = 0), e[14] = this.bytes << 3, e[15] = this.hBytes << 3 | this.bytes >>> 29, this.hash();
  1382. }
  1383. }, Md5.prototype.hash = function () {
  1384. var e,
  1385. t,
  1386. n,
  1387. i,
  1388. a,
  1389. o,
  1390. r = this.blocks;
  1391. this.first ? (e = r[0] - 680876937, e = (e << 7 | e >>> 25) - 271733879 << 0, i = (-1732584194 ^ 2004318071 & e) + r[1] - 117830708, i = (i << 12 | i >>> 20) + e << 0, n = (-271733879 ^ i & (-271733879 ^ e)) + r[2] - 1126478375, n = (n << 17 | n >>> 15) + i << 0, t = (e ^ n & (i ^ e)) + r[3] - 1316259209, t = (t << 22 | t >>> 10) + n << 0) : (e = this.h0, t = this.h1, n = this.h2, i = this.h3, e += (i ^ t & (n ^ i)) + r[0] - 680876936, e = (e << 7 | e >>> 25) + t << 0, i += (n ^ e & (t ^ n)) + r[1] - 389564586, i = (i << 12 | i >>> 20) + e << 0, n += (t ^ i & (e ^ t)) + r[2] + 606105819, n = (n << 17 | n >>> 15) + i << 0, t += (e ^ n & (i ^ e)) + r[3] - 1044525330, t = (t << 22 | t >>> 10) + n << 0), e += (i ^ t & (n ^ i)) + r[4] - 176418897, e = (e << 7 | e >>> 25) + t << 0, i += (n ^ e & (t ^ n)) + r[5] + 1200080426, i = (i << 12 | i >>> 20) + e << 0, n += (t ^ i & (e ^ t)) + r[6] - 1473231341, n = (n << 17 | n >>> 15) + i << 0, t += (e ^ n & (i ^ e)) + r[7] - 45705983, t = (t << 22 | t >>> 10) + n << 0, e += (i ^ t & (n ^ i)) + r[8] + 1770035416, e = (e << 7 | e >>> 25) + t << 0, i += (n ^ e & (t ^ n)) + r[9] - 1958414417, i = (i << 12 | i >>> 20) + e << 0, n += (t ^ i & (e ^ t)) + r[10] - 42063, n = (n << 17 | n >>> 15) + i << 0, t += (e ^ n & (i ^ e)) + r[11] - 1990404162, t = (t << 22 | t >>> 10) + n << 0, e += (i ^ t & (n ^ i)) + r[12] + 1804603682, e = (e << 7 | e >>> 25) + t << 0, i += (n ^ e & (t ^ n)) + r[13] - 40341101, i = (i << 12 | i >>> 20) + e << 0, n += (t ^ i & (e ^ t)) + r[14] - 1502002290, n = (n << 17 | n >>> 15) + i << 0, t += (e ^ n & (i ^ e)) + r[15] + 1236535329, t = (t << 22 | t >>> 10) + n << 0, e += (n ^ i & (t ^ n)) + r[1] - 165796510, e = (e << 5 | e >>> 27) + t << 0, i += (t ^ n & (e ^ t)) + r[6] - 1069501632, i = (i << 9 | i >>> 23) + e << 0, n += (e ^ t & (i ^ e)) + r[11] + 643717713, n = (n << 14 | n >>> 18) + i << 0, t += (i ^ e & (n ^ i)) + r[0] - 373897302, t = (t << 20 | t >>> 12) + n << 0, e += (n ^ i & (t ^ n)) + r[5] - 701558691, e = (e << 5 | e >>> 27) + t << 0, i += (t ^ n & (e ^ t)) + r[10] + 38016083, i = (i << 9 | i >>> 23) + e << 0, n += (e ^ t & (i ^ e)) + r[15] - 660478335, n = (n << 14 | n >>> 18) + i << 0, t += (i ^ e & (n ^ i)) + r[4] - 405537848, t = (t << 20 | t >>> 12) + n << 0, e += (n ^ i & (t ^ n)) + r[9] + 568446438, e = (e << 5 | e >>> 27) + t << 0, i += (t ^ n & (e ^ t)) + r[14] - 1019803690, i = (i << 9 | i >>> 23) + e << 0, n += (e ^ t & (i ^ e)) + r[3] - 187363961, n = (n << 14 | n >>> 18) + i << 0, t += (i ^ e & (n ^ i)) + r[8] + 1163531501, t = (t << 20 | t >>> 12) + n << 0, e += (n ^ i & (t ^ n)) + r[13] - 1444681467, e = (e << 5 | e >>> 27) + t << 0, i += (t ^ n & (e ^ t)) + r[2] - 51403784, i = (i << 9 | i >>> 23) + e << 0, n += (e ^ t & (i ^ e)) + r[7] + 1735328473, n = (n << 14 | n >>> 18) + i << 0, t += (i ^ e & (n ^ i)) + r[12] - 1926607734, t = (t << 20 | t >>> 12) + n << 0, a = t ^ n, e += (a ^ i) + r[5] - 378558, e = (e << 4 | e >>> 28) + t << 0, i += (a ^ e) + r[8] - 2022574463, i = (i << 11 | i >>> 21) + e << 0, o = i ^ e, n += (o ^ t) + r[11] + 1839030562, n = (n << 16 | n >>> 16) + i << 0, t += (o ^ n) + r[14] - 35309556, t = (t << 23 | t >>> 9) + n << 0, a = t ^ n, e += (a ^ i) + r[1] - 1530992060, e = (e << 4 | e >>> 28) + t << 0, i += (a ^ e) + r[4] + 1272893353, i = (i << 11 | i >>> 21) + e << 0, o = i ^ e, n += (o ^ t) + r[7] - 155497632, n = (n << 16 | n >>> 16) + i << 0, t += (o ^ n) + r[10] - 1094730640, t = (t << 23 | t >>> 9) + n << 0, a = t ^ n, e += (a ^ i) + r[13] + 681279174, e = (e << 4 | e >>> 28) + t << 0, i += (a ^ e) + r[0] - 358537222, i = (i << 11 | i >>> 21) + e << 0, o = i ^ e, n += (o ^ t) + r[3] - 722521979, n = (n << 16 | n >>> 16) + i << 0, t += (o ^ n) + r[6] + 76029189, t = (t << 23 | t >>> 9) + n << 0, a = t ^ n, e += (a ^ i) + r[9] - 640364487, e = (e << 4 | e >>> 28) + t << 0, i += (a ^ e) + r[12] - 421815835, i = (i << 11 | i >>> 21) + e << 0, o = i ^ e, n += (o ^ t) + r[15] + 530742520, n = (n << 16 | n >>> 16) + i << 0, t += (o ^ n) + r[2] - 995338651, t = (t << 23 | t >>> 9) + n << 0, e += (n ^ (t | ~i)) + r[0] - 198630844, e = (e << 6 | e >>> 26) + t << 0, i += (t ^ (e | ~n)) + r[7] + 1126891415, i = (i << 10 | i >>> 22) + e << 0, n += (e ^ (i | ~t)) + r[14] - 1416354905, n = (n << 15 | n >>> 17) + i << 0, t += (i ^ (n | ~e)) + r[5] - 57434055, t = (t << 21 | t >>> 11) + n << 0, e += (n ^ (t | ~i)) + r[12] + 1700485571, e = (e << 6 | e >>> 26) + t << 0, i += (t ^ (e | ~n)) + r[3] - 1894986606, i = (i << 10 | i >>> 22) + e << 0, n += (e ^ (i | ~t)) + r[10] - 1051523, n = (n << 15 | n >>> 17) + i << 0, t += (i ^ (n | ~e)) + r[1] - 2054922799, t = (t << 21 | t >>> 11) + n << 0, e += (n ^ (t | ~i)) + r[8] + 1873313359, e = (e << 6 | e >>> 26) + t << 0, i += (t ^ (e | ~n)) + r[15] - 30611744, i = (i << 10 | i >>> 22) + e << 0, n += (e ^ (i | ~t)) + r[6] - 1560198380, n = (n << 15 | n >>> 17) + i << 0, t += (i ^ (n | ~e)) + r[13] + 1309151649, t = (t << 21 | t >>> 11) + n << 0, e += (n ^ (t | ~i)) + r[4] - 145523070, e = (e << 6 | e >>> 26) + t << 0, i += (t ^ (e | ~n)) + r[11] - 1120210379, i = (i << 10 | i >>> 22) + e << 0, n += (e ^ (i | ~t)) + r[2] + 718787259, n = (n << 15 | n >>> 17) + i << 0, t += (i ^ (n | ~e)) + r[9] - 343485551, t = (t << 21 | t >>> 11) + n << 0, this.first ? (this.h0 = e + 1732584193 << 0, this.h1 = t - 271733879 << 0, this.h2 = n - 1732584194 << 0, this.h3 = i + 271733878 << 0, this.first = !1) : (this.h0 = this.h0 + e << 0, this.h1 = this.h1 + t << 0, this.h2 = this.h2 + n << 0, this.h3 = this.h3 + i << 0);
  1392. }, Md5.prototype.hex = function () {
  1393. this.finalize();
  1394. var e = this.h0,
  1395. t = this.h1,
  1396. n = this.h2,
  1397. i = this.h3;
  1398. return HEX_CHARS[e >> 4 & 15] + HEX_CHARS[15 & e] + HEX_CHARS[e >> 12 & 15] + HEX_CHARS[e >> 8 & 15] + HEX_CHARS[e >> 20 & 15] + HEX_CHARS[e >> 16 & 15] + HEX_CHARS[e >> 28 & 15] + HEX_CHARS[e >> 24 & 15] + HEX_CHARS[t >> 4 & 15] + HEX_CHARS[15 & t] + HEX_CHARS[t >> 12 & 15] + HEX_CHARS[t >> 8 & 15] + HEX_CHARS[t >> 20 & 15] + HEX_CHARS[t >> 16 & 15] + HEX_CHARS[t >> 28 & 15] + HEX_CHARS[t >> 24 & 15] + HEX_CHARS[n >> 4 & 15] + HEX_CHARS[15 & n] + HEX_CHARS[n >> 12 & 15] + HEX_CHARS[n >> 8 & 15] + HEX_CHARS[n >> 20 & 15] + HEX_CHARS[n >> 16 & 15] + HEX_CHARS[n >> 28 & 15] + HEX_CHARS[n >> 24 & 15] + HEX_CHARS[i >> 4 & 15] + HEX_CHARS[15 & i] + HEX_CHARS[i >> 12 & 15] + HEX_CHARS[i >> 8 & 15] + HEX_CHARS[i >> 20 & 15] + HEX_CHARS[i >> 16 & 15] + HEX_CHARS[i >> 28 & 15] + HEX_CHARS[i >> 24 & 15];
  1399. }, Md5.prototype.toString = Md5.prototype.hex, Md5.prototype.digest = function () {
  1400. this.finalize();
  1401. var e = this.h0,
  1402. t = this.h1,
  1403. n = this.h2,
  1404. i = this.h3;
  1405. return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255, 255 & t, t >> 8 & 255, t >> 16 & 255, t >> 24 & 255, 255 & n, n >> 8 & 255, n >> 16 & 255, n >> 24 & 255, 255 & i, i >> 8 & 255, i >> 16 & 255, i >> 24 & 255];
  1406. }, Md5.prototype.array = Md5.prototype.digest, Md5.prototype.arrayBuffer = function () {
  1407. this.finalize();
  1408. var e = new ArrayBuffer(16),
  1409. t = new Uint32Array(e);
  1410. return t[0] = this.h0, t[1] = this.h1, t[2] = this.h2, t[3] = this.h3, e;
  1411. }, Md5.prototype.buffer = Md5.prototype.arrayBuffer, Md5.prototype.base64 = function () {
  1412. for (var e, t, n, i = "", a = this.array(), o = 0; o < 15;) e = a[o++], t = a[o++], n = a[o++], i += BASE64_ENCODE_CHAR[e >>> 2] + BASE64_ENCODE_CHAR[63 & (e << 4 | t >>> 4)] + BASE64_ENCODE_CHAR[63 & (t << 2 | n >>> 6)] + BASE64_ENCODE_CHAR[63 & n];
  1413. return e = a[o], i += BASE64_ENCODE_CHAR[e >>> 2] + BASE64_ENCODE_CHAR[e << 4 & 63] + "==";
  1414. };
  1415. var exports = createMethod();
  1416. COMMON_JS ? module.exports = exports : (root.md5 = exports, AMD && void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = function () {
  1417. return exports;
  1418. }.call(exports, __webpack_require__, exports, module)) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1419. }();
  1420. }).call(exports, __webpack_require__(9), __webpack_require__(1));
  1421. }, function (e, t) {
  1422. function n() {
  1423. throw new Error("setTimeout has not been defined");
  1424. }
  1425. function i() {
  1426. throw new Error("clearTimeout has not been defined");
  1427. }
  1428. function a(e) {
  1429. if (p === setTimeout) return setTimeout(e, 0);
  1430. if ((p === n || !p) && setTimeout) return p = setTimeout, setTimeout(e, 0);
  1431. try {
  1432. return p(e, 0);
  1433. } catch (t) {
  1434. try {
  1435. return p.call(null, e, 0);
  1436. } catch (t) {
  1437. return p.call(this, e, 0);
  1438. }
  1439. }
  1440. }
  1441. function o(e) {
  1442. if (u === clearTimeout) return clearTimeout(e);
  1443. if ((u === i || !u) && clearTimeout) return u = clearTimeout, clearTimeout(e);
  1444. try {
  1445. return u(e);
  1446. } catch (t) {
  1447. try {
  1448. return u.call(null, e);
  1449. } catch (t) {
  1450. return u.call(this, e);
  1451. }
  1452. }
  1453. }
  1454. function r() {
  1455. h && m && (h = !1, m.length ? f = m.concat(f) : g = -1, f.length && s());
  1456. }
  1457. function s() {
  1458. if (!h) {
  1459. var e = a(r);
  1460. h = !0;
  1461. for (var t = f.length; t;) {
  1462. for (m = f, f = []; ++g < t;) m && m[g].run();
  1463. g = -1, t = f.length;
  1464. }
  1465. m = null, h = !1, o(e);
  1466. }
  1467. }
  1468. function c(e, t) {
  1469. this.fun = e, this.array = t;
  1470. }
  1471. function l() {}
  1472. var p,
  1473. u,
  1474. d = e.exports = {};
  1475. !function () {
  1476. try {
  1477. p = "function" == typeof setTimeout ? setTimeout : n;
  1478. } catch (e) {
  1479. p = n;
  1480. }
  1481. try {
  1482. u = "function" == typeof clearTimeout ? clearTimeout : i;
  1483. } catch (e) {
  1484. u = i;
  1485. }
  1486. }();
  1487. var m,
  1488. f = [],
  1489. h = !1,
  1490. g = -1;
  1491. d.nextTick = function (e) {
  1492. var t = new Array(arguments.length - 1);
  1493. if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
  1494. f.push(new c(e, t)), 1 !== f.length || h || a(s);
  1495. }, c.prototype.run = function () {
  1496. this.fun.apply(null, this.array);
  1497. }, d.title = "browser", d.browser = !0, d.env = {}, d.argv = [], d.version = "", d.versions = {}, d.on = l, d.addListener = l, d.once = l, d.off = l, d.removeListener = l, d.removeAllListeners = l, d.emit = l, d.prependListener = l, d.prependOnceListener = l, d.listeners = function (e) {
  1498. return [];
  1499. }, d.binding = function (e) {
  1500. throw new Error("process.binding is not supported");
  1501. }, d.cwd = function () {
  1502. return "/";
  1503. }, d.chdir = function (e) {
  1504. throw new Error("process.chdir is not supported");
  1505. }, d.umask = function () {
  1506. return 0;
  1507. };
  1508. }, function (e, t) {
  1509. (function (t) {
  1510. e.exports = t;
  1511. }).call(t, {});
  1512. }, function (e, t) {
  1513. var n = n || function (e, t) {
  1514. var n = {},
  1515. i = n.lib = {},
  1516. a = function () {},
  1517. o = i.Base = {
  1518. extend: function (e) {
  1519. a.prototype = this;
  1520. var t = new a();
  1521. return e && t.mixIn(e), t.hasOwnProperty("init") || (t.init = function () {
  1522. t.$super.init.apply(this, arguments);
  1523. }), t.init.prototype = t, t.$super = this, t;
  1524. },
  1525. create: function () {
  1526. var e = this.extend();
  1527. return e.init.apply(e, arguments), e;
  1528. },
  1529. init: function () {},
  1530. mixIn: function (e) {
  1531. for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
  1532. e.hasOwnProperty("toString") && (this.toString = e.toString);
  1533. },
  1534. clone: function () {
  1535. return this.init.prototype.extend(this);
  1536. }
  1537. },
  1538. r = i.WordArray = o.extend({
  1539. init: function (e, t) {
  1540. e = this.words = e || [], this.sigBytes = void 0 != t ? t : 4 * e.length;
  1541. },
  1542. toString: function (e) {
  1543. return (e || c).stringify(this);
  1544. },
  1545. concat: function (e) {
  1546. var t = this.words,
  1547. n = e.words,
  1548. i = this.sigBytes;
  1549. if (e = e.sigBytes, this.clamp(), i % 4) for (var a = 0; a < e; a++) t[i + a >>> 2] |= (n[a >>> 2] >>> 24 - a % 4 * 8 & 255) << 24 - (i + a) % 4 * 8;else if (65535 < n.length) for (a = 0; a < e; a += 4) t[i + a >>> 2] = n[a >>> 2];else t.push.apply(t, n);
  1550. return this.sigBytes += e, this;
  1551. },
  1552. clamp: function () {
  1553. var t = this.words,
  1554. n = this.sigBytes;
  1555. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  1556. },
  1557. clone: function () {
  1558. var e = o.clone.call(this);
  1559. return e.words = this.words.slice(0), e;
  1560. },
  1561. random: function (t) {
  1562. for (var n = [], i = 0; i < t; i += 4) n.push(4294967296 * e.random() | 0);
  1563. return new r.init(n, t);
  1564. }
  1565. }),
  1566. s = n.enc = {},
  1567. c = s.Hex = {
  1568. stringify: function (e) {
  1569. var t = e.words;
  1570. e = e.sigBytes;
  1571. for (var n = [], i = 0; i < e; i++) {
  1572. var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  1573. n.push((a >>> 4).toString(16)), n.push((15 & a).toString(16));
  1574. }
  1575. return n.join("");
  1576. },
  1577. parse: function (e) {
  1578. for (var t = e.length, n = [], i = 0; i < t; i += 2) n[i >>> 3] |= parseInt(e.substr(i, 2), 16) << 24 - i % 8 * 4;
  1579. return new r.init(n, t / 2);
  1580. }
  1581. },
  1582. l = s.Latin1 = {
  1583. stringify: function (e) {
  1584. var t = e.words;
  1585. e = e.sigBytes;
  1586. for (var n = [], i = 0; i < e; i++) n.push(String.fromCharCode(t[i >>> 2] >>> 24 - i % 4 * 8 & 255));
  1587. return n.join("");
  1588. },
  1589. parse: function (e) {
  1590. for (var t = e.length, n = [], i = 0; i < t; i++) n[i >>> 2] |= (255 & e.charCodeAt(i)) << 24 - i % 4 * 8;
  1591. return new r.init(n, t);
  1592. }
  1593. },
  1594. p = s.Utf8 = {
  1595. stringify: function (e) {
  1596. try {
  1597. return decodeURIComponent(escape(l.stringify(e)));
  1598. } catch (e) {
  1599. throw Error("Malformed UTF-8 data");
  1600. }
  1601. },
  1602. parse: function (e) {
  1603. return l.parse(unescape(encodeURIComponent(e)));
  1604. }
  1605. },
  1606. u = i.BufferedBlockAlgorithm = o.extend({
  1607. reset: function () {
  1608. this._data = new r.init(), this._nDataBytes = 0;
  1609. },
  1610. _append: function (e) {
  1611. "string" == typeof e && (e = p.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  1612. },
  1613. _process: function (t) {
  1614. var n = this._data,
  1615. i = n.words,
  1616. a = n.sigBytes,
  1617. o = this.blockSize,
  1618. s = a / (4 * o),
  1619. s = t ? e.ceil(s) : e.max((0 | s) - this._minBufferSize, 0);
  1620. if (t = s * o, a = e.min(4 * t, a), t) {
  1621. for (var c = 0; c < t; c += o) this._doProcessBlock(i, c);
  1622. c = i.splice(0, t), n.sigBytes -= a;
  1623. }
  1624. return new r.init(c, a);
  1625. },
  1626. clone: function () {
  1627. var e = o.clone.call(this);
  1628. return e._data = this._data.clone(), e;
  1629. },
  1630. _minBufferSize: 0
  1631. });
  1632. i.Hasher = u.extend({
  1633. cfg: o.extend(),
  1634. init: function (e) {
  1635. this.cfg = this.cfg.extend(e), this.reset();
  1636. },
  1637. reset: function () {
  1638. u.reset.call(this), this._doReset();
  1639. },
  1640. update: function (e) {
  1641. return this._append(e), this._process(), this;
  1642. },
  1643. finalize: function (e) {
  1644. return e && this._append(e), this._doFinalize();
  1645. },
  1646. blockSize: 16,
  1647. _createHelper: function (e) {
  1648. return function (t, n) {
  1649. return new e.init(n).finalize(t);
  1650. };
  1651. },
  1652. _createHmacHelper: function (e) {
  1653. return function (t, n) {
  1654. return new d.HMAC.init(e, n).finalize(t);
  1655. };
  1656. }
  1657. });
  1658. var d = n.algo = {};
  1659. return n;
  1660. }(Math);
  1661. !function () {
  1662. var e = n,
  1663. t = e.lib,
  1664. i = t.WordArray,
  1665. a = t.Hasher,
  1666. o = [],
  1667. t = e.algo.SHA1 = a.extend({
  1668. _doReset: function () {
  1669. this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
  1670. },
  1671. _doProcessBlock: function (e, t) {
  1672. for (var n = this._hash.words, i = n[0], a = n[1], r = n[2], s = n[3], c = n[4], l = 0; 80 > l; l++) {
  1673. if (16 > l) o[l] = 0 | e[t + l];else {
  1674. var p = o[l - 3] ^ o[l - 8] ^ o[l - 14] ^ o[l - 16];
  1675. o[l] = p << 1 | p >>> 31;
  1676. }
  1677. p = (i << 5 | i >>> 27) + c + o[l], p = 20 > l ? p + (1518500249 + (a & r | ~a & s)) : 40 > l ? p + (1859775393 + (a ^ r ^ s)) : 60 > l ? p + ((a & r | a & s | r & s) - 1894007588) : p + ((a ^ r ^ s) - 899497514), c = s, s = r, r = a << 30 | a >>> 2, a = i, i = p;
  1678. }
  1679. n[0] = n[0] + i | 0, n[1] = n[1] + a | 0, n[2] = n[2] + r | 0, n[3] = n[3] + s | 0, n[4] = n[4] + c | 0;
  1680. },
  1681. _doFinalize: function () {
  1682. var e = this._data,
  1683. t = e.words,
  1684. n = 8 * this._nDataBytes,
  1685. i = 8 * e.sigBytes;
  1686. return t[i >>> 5] |= 128 << 24 - i % 32, t[14 + (i + 64 >>> 9 << 4)] = Math.floor(n / 4294967296), t[15 + (i + 64 >>> 9 << 4)] = n, e.sigBytes = 4 * t.length, this._process(), this._hash;
  1687. },
  1688. clone: function () {
  1689. var e = a.clone.call(this);
  1690. return e._hash = this._hash.clone(), e;
  1691. }
  1692. });
  1693. e.SHA1 = a._createHelper(t), e.HmacSHA1 = a._createHmacHelper(t);
  1694. }(), function () {
  1695. var e = n,
  1696. t = e.enc.Utf8;
  1697. e.algo.HMAC = e.lib.Base.extend({
  1698. init: function (e, n) {
  1699. e = this._hasher = new e.init(), "string" == typeof n && (n = t.parse(n));
  1700. var i = e.blockSize,
  1701. a = 4 * i;
  1702. n.sigBytes > a && (n = e.finalize(n)), n.clamp();
  1703. for (var o = this._oKey = n.clone(), r = this._iKey = n.clone(), s = o.words, c = r.words, l = 0; l < i; l++) s[l] ^= 1549556828, c[l] ^= 909522486;
  1704. o.sigBytes = r.sigBytes = a, this.reset();
  1705. },
  1706. reset: function () {
  1707. var e = this._hasher;
  1708. e.reset(), e.update(this._iKey);
  1709. },
  1710. update: function (e) {
  1711. return this._hasher.update(e), this;
  1712. },
  1713. finalize: function (e) {
  1714. var t = this._hasher;
  1715. return e = t.finalize(e), t.reset(), t.finalize(this._oKey.clone().concat(e));
  1716. }
  1717. });
  1718. }(), function () {
  1719. var e = n,
  1720. t = e.lib,
  1721. i = t.WordArray,
  1722. a = e.enc;
  1723. a.Base64 = {
  1724. stringify: function (e) {
  1725. var t = e.words,
  1726. n = e.sigBytes,
  1727. i = this._map;
  1728. e.clamp();
  1729. for (var a = [], o = 0; o < n; o += 3) for (var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255, s = t[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255, c = t[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, l = r << 16 | s << 8 | c, p = 0; p < 4 && o + .75 * p < n; p++) a.push(i.charAt(l >>> 6 * (3 - p) & 63));
  1730. var u = i.charAt(64);
  1731. if (u) for (; a.length % 4;) a.push(u);
  1732. return a.join("");
  1733. },
  1734. parse: function (e) {
  1735. var t = e.length,
  1736. n = this._map,
  1737. a = n.charAt(64);
  1738. if (a) {
  1739. var o = e.indexOf(a);
  1740. -1 != o && (t = o);
  1741. }
  1742. for (var r = [], s = 0, c = 0; c < t; c++) if (c % 4) {
  1743. var l = n.indexOf(e.charAt(c - 1)) << c % 4 * 2,
  1744. p = n.indexOf(e.charAt(c)) >>> 6 - c % 4 * 2;
  1745. r[s >>> 2] |= (l | p) << 24 - s % 4 * 8, s++;
  1746. }
  1747. return i.create(r, s);
  1748. },
  1749. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  1750. };
  1751. }(), e.exports = n;
  1752. }, function (e, t, n) {
  1753. var i = n(13).DOMParser,
  1754. a = function (e) {
  1755. function t(e) {
  1756. var t = e.localName;
  1757. return null == t && (t = e.baseName), null != t && "" != t || (t = e.nodeName), t;
  1758. }
  1759. function n(e) {
  1760. return e.prefix;
  1761. }
  1762. function a(e) {
  1763. return "string" == typeof e ? e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;") : e;
  1764. }
  1765. function o(e, t, n, i) {
  1766. for (var a = 0; a < e.length; a++) {
  1767. var o = e[a];
  1768. if ("string" == typeof o) {
  1769. if (o == i) break;
  1770. } else if (o instanceof RegExp) {
  1771. if (o.test(i)) break;
  1772. } else if ("function" == typeof o && o(t, n, i)) break;
  1773. }
  1774. return a != e.length;
  1775. }
  1776. function r(t, n, i) {
  1777. switch (e.arrayAccessForm) {
  1778. case "property":
  1779. t[n] instanceof Array ? t[n + "_asArray"] = t[n] : t[n + "_asArray"] = [t[n]];
  1780. }
  1781. !(t[n] instanceof Array) && e.arrayAccessFormPaths.length > 0 && o(e.arrayAccessFormPaths, t, n, i) && (t[n] = [t[n]]);
  1782. }
  1783. function s(e) {
  1784. var t = e.split(/[-T:+Z]/g),
  1785. n = new Date(t[0], t[1] - 1, t[2]),
  1786. i = t[5].split(".");
  1787. if (n.setHours(t[3], t[4], i[0]), i.length > 1 && n.setMilliseconds(i[1]), t[6] && t[7]) {
  1788. var a = 60 * t[6] + Number(t[7]);
  1789. a = 0 + ("-" == (/\d\d-\d\d:\d\d$/.test(e) ? "-" : "+") ? -1 * a : a), n.setMinutes(n.getMinutes() - a - n.getTimezoneOffset());
  1790. } else -1 !== e.indexOf("Z", e.length - 1) && (n = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds())));
  1791. return n;
  1792. }
  1793. function c(t, n, i) {
  1794. if (e.datetimeAccessFormPaths.length > 0) {
  1795. var a = i.split(".#")[0];
  1796. return o(e.datetimeAccessFormPaths, t, n, a) ? s(t) : t;
  1797. }
  1798. return t;
  1799. }
  1800. function l(t, n, i, a) {
  1801. return !(n == S.ELEMENT_NODE && e.xmlElementsFilter.length > 0) || o(e.xmlElementsFilter, t, i, a);
  1802. }
  1803. function p(i, a) {
  1804. if (i.nodeType == S.DOCUMENT_NODE) {
  1805. for (var o = new Object(), s = i.childNodes, u = 0; u < s.length; u++) {
  1806. var d = s.item(u);
  1807. if (d.nodeType == S.ELEMENT_NODE) {
  1808. var m = t(d);
  1809. o[m] = p(d, m);
  1810. }
  1811. }
  1812. return o;
  1813. }
  1814. if (i.nodeType == S.ELEMENT_NODE) {
  1815. var o = new Object();
  1816. o.__cnt = 0;
  1817. for (var s = i.childNodes, u = 0; u < s.length; u++) {
  1818. var d = s.item(u),
  1819. m = t(d);
  1820. if (d.nodeType != S.COMMENT_NODE) {
  1821. var f = a + "." + m;
  1822. l(o, d.nodeType, m, f) && (o.__cnt++, null == o[m] ? (o[m] = p(d, f), r(o, m, f)) : (null != o[m] && (o[m] instanceof Array || (o[m] = [o[m]], r(o, m, f))), o[m][o[m].length] = p(d, f)));
  1823. }
  1824. }
  1825. for (var h = 0; h < i.attributes.length; h++) {
  1826. var g = i.attributes.item(h);
  1827. o.__cnt++, o[e.attributePrefix + g.name] = g.value;
  1828. }
  1829. var v = n(i);
  1830. return null != v && "" != v && (o.__cnt++, o.__prefix = v), null != o["#text"] && (o.__text = o["#text"], o.__text instanceof Array && (o.__text = o.__text.join("\n")), e.stripWhitespaces && (o.__text = o.__text.trim()), delete o["#text"], "property" == e.arrayAccessForm && delete o["#text_asArray"], o.__text = c(o.__text, m, a + "." + m)), null != o["#cdata-section"] && (o.__cdata = o["#cdata-section"], delete o["#cdata-section"], "property" == e.arrayAccessForm && delete o["#cdata-section_asArray"]), 0 == o.__cnt && "text" == e.emptyNodeForm ? o = "" : 1 == o.__cnt && null != o.__text ? o = o.__text : 1 != o.__cnt || null == o.__cdata || e.keepCData ? o.__cnt > 1 && null != o.__text && e.skipEmptyTextNodesForObj && (e.stripWhitespaces && "" == o.__text || "" == o.__text.trim()) && delete o.__text : o = o.__cdata, delete o.__cnt, !e.enableToStringFunc || null == o.__text && null == o.__cdata || (o.toString = function () {
  1831. return (null != this.__text ? this.__text : "") + (null != this.__cdata ? this.__cdata : "");
  1832. }), o;
  1833. }
  1834. if (i.nodeType == S.TEXT_NODE || i.nodeType == S.CDATA_SECTION_NODE) return i.nodeValue;
  1835. }
  1836. function u(t, n, i, o) {
  1837. var r = "<" + (null != t && null != t.__prefix ? t.__prefix + ":" : "") + n;
  1838. if (null != i) for (var s = 0; s < i.length; s++) {
  1839. var c = i[s],
  1840. l = t[c];
  1841. e.escapeMode && (l = a(l)), r += " " + c.substr(e.attributePrefix.length) + "=", e.useDoubleQuotes ? r += '"' + l + '"' : r += "'" + l + "'";
  1842. }
  1843. return r += o ? "/>" : ">";
  1844. }
  1845. function d(e, t) {
  1846. return "</" + (null != e.__prefix ? e.__prefix + ":" : "") + t + ">";
  1847. }
  1848. function m(e, t) {
  1849. return -1 !== e.indexOf(t, e.length - t.length);
  1850. }
  1851. function f(t, n) {
  1852. return !!("property" == e.arrayAccessForm && m(n.toString(), "_asArray") || 0 == n.toString().indexOf(e.attributePrefix) || 0 == n.toString().indexOf("__") || t[n] instanceof Function);
  1853. }
  1854. function h(e) {
  1855. var t = 0;
  1856. if (e instanceof Object) for (var n in e) f(e, n) || t++;
  1857. return t;
  1858. }
  1859. function g(t, n, i) {
  1860. return 0 == e.jsonPropertiesFilter.length || "" == i || o(e.jsonPropertiesFilter, t, n, i);
  1861. }
  1862. function v(t) {
  1863. var n = [];
  1864. if (t instanceof Object) for (var i in t) -1 == i.toString().indexOf("__") && 0 == i.toString().indexOf(e.attributePrefix) && n.push(i);
  1865. return n;
  1866. }
  1867. function x(t) {
  1868. var n = "";
  1869. return null != t.__cdata && (n += "<![CDATA[" + t.__cdata + "]]>"), null != t.__text && (e.escapeMode ? n += a(t.__text) : n += t.__text), n;
  1870. }
  1871. function y(t) {
  1872. var n = "";
  1873. return t instanceof Object ? n += x(t) : null != t && (e.escapeMode ? n += a(t) : n += t), n;
  1874. }
  1875. function C(e, t) {
  1876. return "" === e ? t : e + "." + t;
  1877. }
  1878. function k(e, t, n, i) {
  1879. var a = "";
  1880. if (0 == e.length) a += u(e, t, n, !0);else for (var o = 0; o < e.length; o++) a += u(e[o], t, v(e[o]), !1), a += b(e[o], C(i, t)), a += d(e[o], t);
  1881. return a;
  1882. }
  1883. function b(e, t) {
  1884. var n = "";
  1885. if (h(e) > 0) for (var i in e) if (!f(e, i) && ("" == t || g(e, i, C(t, i)))) {
  1886. var a = e[i],
  1887. o = v(a);
  1888. if (null == a || void 0 == a) n += u(a, i, o, !0);else if (a instanceof Object) {
  1889. if (a instanceof Array) n += k(a, i, o, t);else if (a instanceof Date) n += u(a, i, o, !1), n += a.toISOString(), n += d(a, i);else {
  1890. var r = h(a);
  1891. r > 0 || null != a.__text || null != a.__cdata ? (n += u(a, i, o, !1), n += b(a, C(t, i)), n += d(a, i)) : n += u(a, i, o, !0);
  1892. }
  1893. } else n += u(a, i, o, !1), n += y(a), n += d(a, i);
  1894. }
  1895. return n += y(e);
  1896. }
  1897. e = e || {}, function () {
  1898. void 0 === e.escapeMode && (e.escapeMode = !0), e.attributePrefix = e.attributePrefix || "_", e.arrayAccessForm = e.arrayAccessForm || "none", e.emptyNodeForm = e.emptyNodeForm || "text", void 0 === e.enableToStringFunc && (e.enableToStringFunc = !0), e.arrayAccessFormPaths = e.arrayAccessFormPaths || [], void 0 === e.skipEmptyTextNodesForObj && (e.skipEmptyTextNodesForObj = !0), void 0 === e.stripWhitespaces && (e.stripWhitespaces = !0), e.datetimeAccessFormPaths = e.datetimeAccessFormPaths || [], void 0 === e.useDoubleQuotes && (e.useDoubleQuotes = !1), e.xmlElementsFilter = e.xmlElementsFilter || [], e.jsonPropertiesFilter = e.jsonPropertiesFilter || [], void 0 === e.keepCData && (e.keepCData = !1);
  1899. }();
  1900. var S = {
  1901. ELEMENT_NODE: 1,
  1902. TEXT_NODE: 3,
  1903. CDATA_SECTION_NODE: 4,
  1904. COMMENT_NODE: 8,
  1905. DOCUMENT_NODE: 9
  1906. };
  1907. this.parseXmlString = function (e) {
  1908. if (void 0 === e) return null;
  1909. var t;
  1910. if (i) {
  1911. var n = new i(),
  1912. a = null;
  1913. try {
  1914. a = n.parseFromString("INVALID", "text/xml").getElementsByTagName("parsererror")[0].namespaceURI;
  1915. } catch (e) {
  1916. a = null;
  1917. }
  1918. try {
  1919. t = n.parseFromString(e, "text/xml"), null != a && t.getElementsByTagNameNS(a, "parsererror").length > 0 && (t = null);
  1920. } catch (e) {
  1921. t = null;
  1922. }
  1923. } else 0 == e.indexOf("<?") && (e = e.substr(e.indexOf("?>") + 2)), t = new ActiveXObject("Microsoft.XMLDOM"), t.async = "false", t.loadXML(e);
  1924. return t;
  1925. }, this.asArray = function (e) {
  1926. return void 0 === e || null == e ? [] : e instanceof Array ? e : [e];
  1927. }, this.toXmlDateTime = function (e) {
  1928. return e instanceof Date ? e.toISOString() : "number" == typeof e ? new Date(e).toISOString() : null;
  1929. }, this.asDateTime = function (e) {
  1930. return "string" == typeof e ? s(e) : e;
  1931. }, this.xml2json = function (e) {
  1932. return p(e);
  1933. }, this.xml_str2json = function (e) {
  1934. var t = this.parseXmlString(e);
  1935. return null != t ? this.xml2json(t) : null;
  1936. }, this.json2xml_str = function (e) {
  1937. return b(e, "");
  1938. }, this.json2xml = function (e) {
  1939. var t = this.json2xml_str(e);
  1940. return this.parseXmlString(t);
  1941. }, this.getVersion = function () {
  1942. return "1.2.0";
  1943. };
  1944. },
  1945. o = function (e) {
  1946. if (!e) return null;
  1947. var t = new i(),
  1948. n = t.parseFromString(e, "text/xml"),
  1949. o = new a(),
  1950. r = o.xml2json(n);
  1951. return r.html && r.getElementsByTagName("parsererror").length ? null : r;
  1952. };
  1953. e.exports = o;
  1954. }, function (e, t, n) {
  1955. function i(e) {
  1956. this.options = e || {
  1957. locator: {}
  1958. };
  1959. }
  1960. function a(e, t, n) {
  1961. function i(t) {
  1962. var i = e[t];
  1963. !i && r && (i = 2 == e.length ? function (n) {
  1964. e(t, n);
  1965. } : e), a[t] = i && function (e) {
  1966. i("[xmldom " + t + "]\t" + e + s(n));
  1967. } || function () {};
  1968. }
  1969. if (!e) {
  1970. if (t instanceof o) return t;
  1971. e = t;
  1972. }
  1973. var a = {},
  1974. r = e instanceof Function;
  1975. return n = n || {}, i("warning"), i("error"), i("fatalError"), a;
  1976. }
  1977. function o() {
  1978. this.cdata = !1;
  1979. }
  1980. function r(e, t) {
  1981. t.lineNumber = e.lineNumber, t.columnNumber = e.columnNumber;
  1982. }
  1983. function s(e) {
  1984. if (e) return "\n@" + (e.systemId || "") + "#[line:" + e.lineNumber + ",col:" + e.columnNumber + "]";
  1985. }
  1986. function c(e, t, n) {
  1987. return "string" == typeof e ? e.substr(t, n) : e.length >= t + n || t ? new java.lang.String(e, t, n) + "" : e;
  1988. }
  1989. function l(e, t) {
  1990. e.currentElement ? e.currentElement.appendChild(t) : e.doc.appendChild(t);
  1991. }
  1992. i.prototype.parseFromString = function (e, t) {
  1993. var n = this.options,
  1994. i = new p(),
  1995. r = n.domBuilder || new o(),
  1996. s = n.errorHandler,
  1997. c = n.locator,
  1998. l = n.xmlns || {},
  1999. u = {
  2000. lt: "<",
  2001. gt: ">",
  2002. amp: "&",
  2003. quot: '"',
  2004. apos: "'"
  2005. };
  2006. return c && r.setDocumentLocator(c), i.errorHandler = a(s, r, c), i.domBuilder = n.domBuilder || r, /\/x?html?$/.test(t) && (u.nbsp = "\xa0", u.copy = "\xa9", l[""] = "http://www.w3.org/1999/xhtml"), l.xml = l.xml || "http://www.w3.org/XML/1998/namespace", e ? i.parse(e, l, u) : i.errorHandler.error("invalid doc source"), r.doc;
  2007. }, o.prototype = {
  2008. startDocument: function () {
  2009. this.doc = new u().createDocument(null, null, null), this.locator && (this.doc.documentURI = this.locator.systemId);
  2010. },
  2011. startElement: function (e, t, n, i) {
  2012. var a = this.doc,
  2013. o = a.createElementNS(e, n || t),
  2014. s = i.length;
  2015. l(this, o), this.currentElement = o, this.locator && r(this.locator, o);
  2016. for (var c = 0; c < s; c++) {
  2017. var e = i.getURI(c),
  2018. p = i.getValue(c),
  2019. n = i.getQName(c),
  2020. u = a.createAttributeNS(e, n);
  2021. this.locator && r(i.getLocator(c), u), u.value = u.nodeValue = p, o.setAttributeNode(u);
  2022. }
  2023. },
  2024. endElement: function (e, t, n) {
  2025. var i = this.currentElement;
  2026. i.tagName;
  2027. this.currentElement = i.parentNode;
  2028. },
  2029. startPrefixMapping: function (e, t) {},
  2030. endPrefixMapping: function (e) {},
  2031. processingInstruction: function (e, t) {
  2032. var n = this.doc.createProcessingInstruction(e, t);
  2033. this.locator && r(this.locator, n), l(this, n);
  2034. },
  2035. ignorableWhitespace: function (e, t, n) {},
  2036. characters: function (e, t, n) {
  2037. if (e = c.apply(this, arguments)) {
  2038. if (this.cdata) var i = this.doc.createCDATASection(e);else var i = this.doc.createTextNode(e);
  2039. this.currentElement ? this.currentElement.appendChild(i) : /^\s*$/.test(e) && this.doc.appendChild(i), this.locator && r(this.locator, i);
  2040. }
  2041. },
  2042. skippedEntity: function (e) {},
  2043. endDocument: function () {
  2044. this.doc.normalize();
  2045. },
  2046. setDocumentLocator: function (e) {
  2047. (this.locator = e) && (e.lineNumber = 0);
  2048. },
  2049. comment: function (e, t, n) {
  2050. e = c.apply(this, arguments);
  2051. var i = this.doc.createComment(e);
  2052. this.locator && r(this.locator, i), l(this, i);
  2053. },
  2054. startCDATA: function () {
  2055. this.cdata = !0;
  2056. },
  2057. endCDATA: function () {
  2058. this.cdata = !1;
  2059. },
  2060. startDTD: function (e, t, n) {
  2061. var i = this.doc.implementation;
  2062. if (i && i.createDocumentType) {
  2063. var a = i.createDocumentType(e, t, n);
  2064. this.locator && r(this.locator, a), l(this, a);
  2065. }
  2066. },
  2067. warning: function (e) {
  2068. console.warn("[xmldom warning]\t" + e, s(this.locator));
  2069. },
  2070. error: function (e) {
  2071. console.error("[xmldom error]\t" + e, s(this.locator));
  2072. },
  2073. fatalError: function (e) {
  2074. throw console.error("[xmldom fatalError]\t" + e, s(this.locator)), e;
  2075. }
  2076. }, "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function (e) {
  2077. o.prototype[e] = function () {
  2078. return null;
  2079. };
  2080. });
  2081. var p = n(14).XMLReader,
  2082. u = t.DOMImplementation = n(2).DOMImplementation;
  2083. t.XMLSerializer = n(2).XMLSerializer, t.DOMParser = i;
  2084. }, function (e, t) {
  2085. function n() {}
  2086. function i(e, t, n, i, l) {
  2087. function m(e) {
  2088. if (e > 65535) {
  2089. e -= 65536;
  2090. var t = 55296 + (e >> 10),
  2091. n = 56320 + (1023 & e);
  2092. return String.fromCharCode(t, n);
  2093. }
  2094. return String.fromCharCode(e);
  2095. }
  2096. function f(e) {
  2097. var t = e.slice(1, -1);
  2098. return t in n ? n[t] : "#" === t.charAt(0) ? m(parseInt(t.substr(1).replace("x", "0x"))) : (l.error("entity not found:" + e), e);
  2099. }
  2100. function h(t) {
  2101. if (t > S) {
  2102. var n = e.substring(S, t).replace(/&#?\w+;/g, f);
  2103. C && g(S), i.characters(n, 0, t - S), S = t;
  2104. }
  2105. }
  2106. function g(t, n) {
  2107. for (; t >= x && (n = y.exec(e));) v = n.index, x = v + n[0].length, C.lineNumber++;
  2108. C.columnNumber = t - v + 1;
  2109. }
  2110. for (var v = 0, x = 0, y = /.*(?:\r\n?|\n)|.*$/g, C = i.locator, k = [{
  2111. currentNSMap: t
  2112. }], b = {}, S = 0;;) {
  2113. try {
  2114. var R = e.indexOf("<", S);
  2115. if (R < 0) {
  2116. if (!e.substr(S).match(/^\s*$/)) {
  2117. var w = i.doc,
  2118. _ = w.createTextNode(e.substr(S));
  2119. w.appendChild(_), i.currentElement = _;
  2120. }
  2121. return;
  2122. }
  2123. switch (R > S && h(R), e.charAt(R + 1)) {
  2124. case "/":
  2125. var A = e.indexOf(">", R + 3),
  2126. T = e.substring(R + 2, A),
  2127. E = k.pop();
  2128. A < 0 ? (T = e.substring(R + 2).replace(/[\s<].*/, ""), l.error("end tag name: " + T + " is not complete:" + E.tagName), A = R + 1 + T.length) : T.match(/\s</) && (T = T.replace(/[\s<].*/, ""), l.error("end tag name: " + T + " maybe not complete"), A = R + 1 + T.length);
  2129. var B = E.localNSMap,
  2130. O = E.tagName == T;
  2131. if (O || E.tagName && E.tagName.toLowerCase() == T.toLowerCase()) {
  2132. if (i.endElement(E.uri, E.localName, T), B) for (var D in B) i.endPrefixMapping(D);
  2133. O || l.fatalError("end tag name: " + T + " is not match the current start tagName:" + E.tagName);
  2134. } else k.push(E);
  2135. A++;
  2136. break;
  2137. case "?":
  2138. C && g(R), A = u(e, R, i);
  2139. break;
  2140. case "!":
  2141. C && g(R), A = p(e, R, i, l);
  2142. break;
  2143. default:
  2144. C && g(R);
  2145. var N = new d(),
  2146. I = k[k.length - 1].currentNSMap,
  2147. A = o(e, R, N, I, f, l),
  2148. P = N.length;
  2149. if (!N.closed && c(e, A, N.tagName, b) && (N.closed = !0, n.nbsp || l.warning("unclosed xml attribute")), C && P) {
  2150. for (var j = a(C, {}), M = 0; M < P; M++) {
  2151. var U = N[M];
  2152. g(U.offset), U.locator = a(C, {});
  2153. }
  2154. i.locator = j, r(N, i, I) && k.push(N), i.locator = C;
  2155. } else r(N, i, I) && k.push(N);
  2156. "http://www.w3.org/1999/xhtml" !== N.uri || N.closed ? A++ : A = s(e, A, N.tagName, f, i);
  2157. }
  2158. } catch (e) {
  2159. l.error("element parse error: " + e), A = -1;
  2160. }
  2161. A > S ? S = A : h(Math.max(R, S) + 1);
  2162. }
  2163. }
  2164. function a(e, t) {
  2165. return t.lineNumber = e.lineNumber, t.columnNumber = e.columnNumber, t;
  2166. }
  2167. function o(e, t, n, i, a, o) {
  2168. for (var r, s, c = ++t, l = x;;) {
  2169. var p = e.charAt(c);
  2170. switch (p) {
  2171. case "=":
  2172. if (l === y) r = e.slice(t, c), l = k;else {
  2173. if (l !== C) throw new Error("attribute equal must after attrName");
  2174. l = k;
  2175. }
  2176. break;
  2177. case "'":
  2178. case '"':
  2179. if (l === k || l === y) {
  2180. if (l === y && (o.warning('attribute value must after "="'), r = e.slice(t, c)), t = c + 1, !((c = e.indexOf(p, t)) > 0)) throw new Error("attribute value no end '" + p + "' match");
  2181. s = e.slice(t, c).replace(/&#?\w+;/g, a), n.add(r, s, t - 1), l = S;
  2182. } else {
  2183. if (l != b) throw new Error('attribute value must after "="');
  2184. s = e.slice(t, c).replace(/&#?\w+;/g, a), n.add(r, s, t), o.warning('attribute "' + r + '" missed start quot(' + p + ")!!"), t = c + 1, l = S;
  2185. }
  2186. break;
  2187. case "/":
  2188. switch (l) {
  2189. case x:
  2190. n.setTagName(e.slice(t, c));
  2191. case S:
  2192. case R:
  2193. case w:
  2194. l = w, n.closed = !0;
  2195. case b:
  2196. case y:
  2197. case C:
  2198. break;
  2199. default:
  2200. throw new Error("attribute invalid close char('/')");
  2201. }
  2202. break;
  2203. case "":
  2204. return o.error("unexpected end of input"), l == x && n.setTagName(e.slice(t, c)), c;
  2205. case ">":
  2206. switch (l) {
  2207. case x:
  2208. n.setTagName(e.slice(t, c));
  2209. case S:
  2210. case R:
  2211. case w:
  2212. break;
  2213. case b:
  2214. case y:
  2215. s = e.slice(t, c), "/" === s.slice(-1) && (n.closed = !0, s = s.slice(0, -1));
  2216. case C:
  2217. l === C && (s = r), l == b ? (o.warning('attribute "' + s + '" missed quot(")!!'), n.add(r, s.replace(/&#?\w+;/g, a), t)) : ("http://www.w3.org/1999/xhtml" === i[""] && s.match(/^(?:disabled|checked|selected)$/i) || o.warning('attribute "' + s + '" missed value!! "' + s + '" instead!!'), n.add(s, s, t));
  2218. break;
  2219. case k:
  2220. throw new Error("attribute value missed!!");
  2221. }
  2222. return c;
  2223. case "\x80":
  2224. p = " ";
  2225. default:
  2226. if (p <= " ") switch (l) {
  2227. case x:
  2228. n.setTagName(e.slice(t, c)), l = R;
  2229. break;
  2230. case y:
  2231. r = e.slice(t, c), l = C;
  2232. break;
  2233. case b:
  2234. var s = e.slice(t, c).replace(/&#?\w+;/g, a);
  2235. o.warning('attribute "' + s + '" missed quot(")!!'), n.add(r, s, t);
  2236. case S:
  2237. l = R;
  2238. } else switch (l) {
  2239. case C:
  2240. n.tagName;
  2241. "http://www.w3.org/1999/xhtml" === i[""] && r.match(/^(?:disabled|checked|selected)$/i) || o.warning('attribute "' + r + '" missed value!! "' + r + '" instead2!!'), n.add(r, r, t), t = c, l = y;
  2242. break;
  2243. case S:
  2244. o.warning('attribute space is required"' + r + '"!!');
  2245. case R:
  2246. l = y, t = c;
  2247. break;
  2248. case k:
  2249. l = b, t = c;
  2250. break;
  2251. case w:
  2252. throw new Error("elements closed character '/' and '>' must be connected to");
  2253. }
  2254. }
  2255. c++;
  2256. }
  2257. }
  2258. function r(e, t, n) {
  2259. for (var i = e.tagName, a = null, o = e.length; o--;) {
  2260. var r = e[o],
  2261. s = r.qName,
  2262. c = r.value,
  2263. p = s.indexOf(":");
  2264. if (p > 0) var u = r.prefix = s.slice(0, p),
  2265. d = s.slice(p + 1),
  2266. m = "xmlns" === u && d;else d = s, u = null, m = "xmlns" === s && "";
  2267. r.localName = d, !1 !== m && (null == a && (a = {}, l(n, n = {})), n[m] = a[m] = c, r.uri = "http://www.w3.org/2000/xmlns/", t.startPrefixMapping(m, c));
  2268. }
  2269. for (var o = e.length; o--;) {
  2270. r = e[o];
  2271. var u = r.prefix;
  2272. u && ("xml" === u && (r.uri = "http://www.w3.org/XML/1998/namespace"), "xmlns" !== u && (r.uri = n[u || ""]));
  2273. }
  2274. var p = i.indexOf(":");
  2275. p > 0 ? (u = e.prefix = i.slice(0, p), d = e.localName = i.slice(p + 1)) : (u = null, d = e.localName = i);
  2276. var f = e.uri = n[u || ""];
  2277. if (t.startElement(f, d, i, e), !e.closed) return e.currentNSMap = n, e.localNSMap = a, !0;
  2278. if (t.endElement(f, d, i), a) for (u in a) t.endPrefixMapping(u);
  2279. }
  2280. function s(e, t, n, i, a) {
  2281. if (/^(?:script|textarea)$/i.test(n)) {
  2282. var o = e.indexOf("</" + n + ">", t),
  2283. r = e.substring(t + 1, o);
  2284. if (/[&<]/.test(r)) return /^script$/i.test(n) ? (a.characters(r, 0, r.length), o) : (r = r.replace(/&#?\w+;/g, i), a.characters(r, 0, r.length), o);
  2285. }
  2286. return t + 1;
  2287. }
  2288. function c(e, t, n, i) {
  2289. var a = i[n];
  2290. return null == a && (a = e.lastIndexOf("</" + n + ">"), a < t && (a = e.lastIndexOf("</" + n)), i[n] = a), a < t;
  2291. }
  2292. function l(e, t) {
  2293. for (var n in e) t[n] = e[n];
  2294. }
  2295. function p(e, t, n, i) {
  2296. switch (e.charAt(t + 2)) {
  2297. case "-":
  2298. if ("-" === e.charAt(t + 3)) {
  2299. var a = e.indexOf("--\x3e", t + 4);
  2300. return a > t ? (n.comment(e, t + 4, a - t - 4), a + 3) : (i.error("Unclosed comment"), -1);
  2301. }
  2302. return -1;
  2303. default:
  2304. if ("CDATA[" == e.substr(t + 3, 6)) {
  2305. var a = e.indexOf("]]>", t + 9);
  2306. return n.startCDATA(), n.characters(e, t + 9, a - t - 9), n.endCDATA(), a + 3;
  2307. }
  2308. var o = f(e, t),
  2309. r = o.length;
  2310. if (r > 1 && /!doctype/i.test(o[0][0])) {
  2311. var s = o[1][0],
  2312. c = r > 3 && /^public$/i.test(o[2][0]) && o[3][0],
  2313. l = r > 4 && o[4][0],
  2314. p = o[r - 1];
  2315. return n.startDTD(s, c && c.replace(/^(['"])(.*?)\1$/, "$2"), l && l.replace(/^(['"])(.*?)\1$/, "$2")), n.endDTD(), p.index + p[0].length;
  2316. }
  2317. }
  2318. return -1;
  2319. }
  2320. function u(e, t, n) {
  2321. var i = e.indexOf("?>", t);
  2322. if (i) {
  2323. var a = e.substring(t, i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
  2324. if (a) {
  2325. a[0].length;
  2326. return n.processingInstruction(a[1], a[2]), i + 2;
  2327. }
  2328. return -1;
  2329. }
  2330. return -1;
  2331. }
  2332. function d(e) {}
  2333. function m(e, t) {
  2334. return e.__proto__ = t, e;
  2335. }
  2336. function f(e, t) {
  2337. var n,
  2338. i = [],
  2339. a = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
  2340. for (a.lastIndex = t, a.exec(e); n = a.exec(e);) if (i.push(n), n[1]) return i;
  2341. }
  2342. var h = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
  2343. g = new RegExp("[\\-\\.0-9" + h.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),
  2344. v = new RegExp("^" + h.source + g.source + "*(?::" + h.source + g.source + "*)?$"),
  2345. x = 0,
  2346. y = 1,
  2347. C = 2,
  2348. k = 3,
  2349. b = 4,
  2350. S = 5,
  2351. R = 6,
  2352. w = 7;
  2353. n.prototype = {
  2354. parse: function (e, t, n) {
  2355. var a = this.domBuilder;
  2356. a.startDocument(), l(t, t = {}), i(e, t, n, a, this.errorHandler), a.endDocument();
  2357. }
  2358. }, d.prototype = {
  2359. setTagName: function (e) {
  2360. if (!v.test(e)) throw new Error("invalid tagName:" + e);
  2361. this.tagName = e;
  2362. },
  2363. add: function (e, t, n) {
  2364. if (!v.test(e)) throw new Error("invalid attribute:" + e);
  2365. this[this.length++] = {
  2366. qName: e,
  2367. value: t,
  2368. offset: n
  2369. };
  2370. },
  2371. length: 0,
  2372. getLocalName: function (e) {
  2373. return this[e].localName;
  2374. },
  2375. getLocator: function (e) {
  2376. return this[e].locator;
  2377. },
  2378. getQName: function (e) {
  2379. return this[e].qName;
  2380. },
  2381. getURI: function (e) {
  2382. return this[e].uri;
  2383. },
  2384. getValue: function (e) {
  2385. return this[e].value;
  2386. }
  2387. }, m({}, m.prototype) instanceof m || (m = function (e, t) {
  2388. function n() {}
  2389. n.prototype = t, n = new n();
  2390. for (t in e) n[t] = e[t];
  2391. return n;
  2392. }), t.XMLReader = n;
  2393. }, function (e, t) {
  2394. function n(e) {
  2395. return ("" + e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&apos;").replace(/"/g, "&quot;").replace(a, "");
  2396. }
  2397. var i = new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])", "g"),
  2398. a = /[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,
  2399. o = function (e) {
  2400. var t = [];
  2401. if (e instanceof Object) for (var n in e) e.hasOwnProperty(n) && t.push(n);
  2402. return t;
  2403. },
  2404. r = function (e, t) {
  2405. var a = function (e, n, a, o, r) {
  2406. var s = void 0 !== t.indent ? t.indent : "\t",
  2407. c = t.prettyPrint ? "\n" + new Array(o).join(s) : "";
  2408. t.removeIllegalNameCharacters && (e = e.replace(i, "_"));
  2409. var l = [c, "<", e, a || ""];
  2410. return n && n.length > 0 ? (l.push(">"), l.push(n), r && l.push(c), l.push("</"), l.push(e), l.push(">")) : l.push("/>"), l.join("");
  2411. };
  2412. return function e(i, r, s) {
  2413. var c = typeof i;
  2414. switch ((Array.isArray ? Array.isArray(i) : i instanceof Array) ? c = "array" : i instanceof Date && (c = "date"), c) {
  2415. case "array":
  2416. var l = [];
  2417. return i.map(function (t) {
  2418. l.push(e(t, 1, s + 1));
  2419. }), t.prettyPrint && l.push("\n"), l.join("");
  2420. case "date":
  2421. return i.toJSON ? i.toJSON() : i + "";
  2422. case "object":
  2423. var p = [];
  2424. for (var u in i) if (i.hasOwnProperty(u)) if (i[u] instanceof Array) for (var d in i[u]) i[u].hasOwnProperty(d) && p.push(a(u, e(i[u][d], 0, s + 1), null, s + 1, o(i[u][d]).length));else p.push(a(u, e(i[u], 0, s + 1), null, s + 1));
  2425. return t.prettyPrint && p.length > 0 && p.push("\n"), p.join("");
  2426. case "function":
  2427. return i();
  2428. default:
  2429. return t.escape ? n(i) : "" + i;
  2430. }
  2431. }(e, 0, 0);
  2432. },
  2433. s = function (e) {
  2434. var t = ['<?xml version="1.0" encoding="UTF-8"'];
  2435. return e && t.push(' standalone="yes"'), t.push("?>"), t.join("");
  2436. },
  2437. c = function (e, t) {
  2438. if (t || (t = {
  2439. xmlHeader: {
  2440. standalone: !0
  2441. },
  2442. prettyPrint: !0,
  2443. indent: " "
  2444. }), "string" == typeof e) try {
  2445. e = JSON.parse(e.toString());
  2446. } catch (e) {
  2447. return !1;
  2448. }
  2449. var n = "",
  2450. i = "";
  2451. return t && ("object" == typeof t ? (t.xmlHeader && (n = s(!!t.xmlHeader.standalone)), void 0 !== t.docType && (i = "<!DOCTYPE " + t.docType + ">")) : n = s()), t = t || {}, [n, t.prettyPrint && i ? "\n" : "", i, r(e, t)].join("").replace(/\n{2,}/g, "\n").replace(/\s+$/g, "");
  2452. };
  2453. e.exports = c;
  2454. }, function (e, t, n) {
  2455. var i = n(5),
  2456. a = n(0),
  2457. o = {},
  2458. r = function (e, t) {
  2459. o[t] = e[t], e[t] = function (e, n) {
  2460. e.SkipTask ? o[t].call(this, e, n) : this._addTask(t, e, n);
  2461. };
  2462. },
  2463. s = function (e) {
  2464. var t = [],
  2465. n = {},
  2466. r = 0,
  2467. s = 0,
  2468. c = function (e) {
  2469. var t = {
  2470. id: e.id,
  2471. Bucket: e.Bucket,
  2472. Region: e.Region,
  2473. Key: e.Key,
  2474. FilePath: e.FilePath,
  2475. state: e.state,
  2476. loaded: e.loaded,
  2477. size: e.size,
  2478. speed: e.speed,
  2479. percent: e.percent,
  2480. hashPercent: e.hashPercent,
  2481. error: e.error
  2482. };
  2483. return e.FilePath && (t.FilePath = e.FilePath), t;
  2484. },
  2485. l = function () {
  2486. var n,
  2487. i = function () {
  2488. n = 0, e.emit("task-list-update", {
  2489. list: a.map(t, c)
  2490. }), e.emit("list-update", {
  2491. list: a.map(t, c)
  2492. });
  2493. };
  2494. return function () {
  2495. n || (n = setTimeout(i));
  2496. };
  2497. }(),
  2498. p = function () {
  2499. if (!(t.length <= e.options.UploadQueueSize)) {
  2500. for (var i = 0; i < s && i < t.length && t.length > e.options.UploadQueueSize;) {
  2501. var a = "waiting" === t[i].state || "checking" === t[i].state || "uploading" === t[i].state;
  2502. t[i] && a ? i++ : (n[t[i].id] && delete n[t[i].id], t.splice(i, 1), s--);
  2503. }
  2504. l();
  2505. }
  2506. },
  2507. u = function () {
  2508. if (!(r >= e.options.FileParallelLimit)) {
  2509. for (; t[s] && "waiting" !== t[s].state;) s++;
  2510. if (!(s >= t.length)) {
  2511. var n = t[s];
  2512. s++, r++, n.state = "checking", n.params.onTaskStart && n.params.onTaskStart(c(n)), !n.params.UploadData && (n.params.UploadData = {});
  2513. var i = a.formatParams(n.api, n.params);
  2514. o[n.api].call(e, i, function (t, i) {
  2515. e._isRunningTask(n.id) && ("checking" !== n.state && "uploading" !== n.state || (n.state = t ? "error" : "success", t && (n.error = t), r--, l(), u(), n.callback && n.callback(t, i), "success" === n.state && (n.params && (delete n.params.UploadData, delete n.params.Body, delete n.params), delete n.callback)), p());
  2516. }), l(), setTimeout(u);
  2517. }
  2518. }
  2519. },
  2520. d = function (t, a) {
  2521. var o = n[t];
  2522. if (o) {
  2523. var s = o && "waiting" === o.state,
  2524. c = o && ("checking" === o.state || "uploading" === o.state);
  2525. if ("canceled" === a && "canceled" !== o.state || "paused" === a && s || "paused" === a && c) {
  2526. if ("paused" === a && o.params.Body && "function" == typeof o.params.Body.pipe) return void console.error("stream not support pause");
  2527. o.state = a, e.emit("inner-kill-task", {
  2528. TaskId: t,
  2529. toState: a
  2530. });
  2531. try {
  2532. var d = o && o.params && o.params.UploadData.UploadId;
  2533. } catch (e) {}
  2534. "canceled" === a && d && i.removeUsing(d), l(), c && (r--, u()), "canceled" === a && (o.params && (delete o.params.UploadData, delete o.params.Body, delete o.params), delete o.callback);
  2535. }
  2536. p();
  2537. }
  2538. };
  2539. e._addTasks = function (t) {
  2540. a.each(t, function (t) {
  2541. e._addTask(t.api, t.params, t.callback, !0);
  2542. }), l();
  2543. }, e._addTask = function (i, o, r, s) {
  2544. "sliceUploadFile" !== i || a.canFileSlice() || (i = "postObject"), o = a.formatParams(i, o);
  2545. var c = a.uuid();
  2546. o.TaskId = c, o.onTaskReady && o.onTaskReady(c);
  2547. var d = {
  2548. params: o,
  2549. callback: r,
  2550. api: i,
  2551. index: t.length,
  2552. id: c,
  2553. Bucket: o.Bucket,
  2554. Region: o.Region,
  2555. Key: o.Key,
  2556. FilePath: o.FilePath || "",
  2557. state: "waiting",
  2558. loaded: 0,
  2559. size: 0,
  2560. speed: 0,
  2561. percent: 0,
  2562. hashPercent: 0,
  2563. error: null
  2564. },
  2565. m = o.onHashProgress;
  2566. o.onHashProgress = function (t) {
  2567. e._isRunningTask(d.id) && (d.hashPercent = t.percent, m && m(t), l());
  2568. };
  2569. var f = o.onProgress;
  2570. return o.onProgress = function (t) {
  2571. e._isRunningTask(d.id) && ("checking" === d.state && (d.state = "uploading"), d.loaded = t.loaded, d.size = t.total, d.speed = t.speed, d.percent = t.percent, f && f(t), l());
  2572. }, a.getFileSize(i, o, function (e, i) {
  2573. if (e) return void r(e);
  2574. n[c] = d, t.push(d), d.size = i, !s && l(), u(), p();
  2575. }), c;
  2576. }, e._isRunningTask = function (e) {
  2577. var t = n[e];
  2578. return !(!t || "checking" !== t.state && "uploading" !== t.state);
  2579. }, e.getTaskList = function () {
  2580. return a.map(t, c);
  2581. }, e.cancelTask = function (e) {
  2582. d(e, "canceled");
  2583. }, e.pauseTask = function (e) {
  2584. d(e, "paused");
  2585. }, e.restartTask = function (e) {
  2586. var t = n[e];
  2587. !t || "paused" !== t.state && "error" !== t.state || (t.state = "waiting", l(), s = Math.min(s, t.index), u());
  2588. }, e.isUploadRunning = function () {
  2589. return r || s < t.length;
  2590. };
  2591. };
  2592. e.exports.transferToTaskMethod = r, e.exports.init = s;
  2593. }, function (e, t, n) {
  2594. function i(e, t) {
  2595. "function" == typeof e && (t = e, e = {});
  2596. var n = this.options.ServiceDomain,
  2597. i = e.Region;
  2598. n ? (n = n.replace(/\{\{Region\}\}/gi, i || "").replace(/\{\{.*?\}\}/gi, ""), /^[a-zA-Z]+:\/\//.test(n) || (n = "https://" + n), "/" === n.slice(-1) && (n = n.slice(0, -1))) : n = i ? "https://cos." + i + ".myqcloud.com" : "https://service.cos.myqcloud.com", be.call(this, {
  2599. Action: "name/cos:GetService",
  2600. url: n,
  2601. method: "GET",
  2602. headers: e.Headers
  2603. }, function (e, n) {
  2604. if (e) return t(e);
  2605. var i = n && n.ListAllMyBucketsResult && n.ListAllMyBucketsResult.Buckets && n.ListAllMyBucketsResult.Buckets.Bucket || [];
  2606. i = _e.isArray(i) ? i : [i];
  2607. var a = n && n.ListAllMyBucketsResult && n.ListAllMyBucketsResult.Owner || {};
  2608. t(null, {
  2609. Buckets: i,
  2610. Owner: a,
  2611. statusCode: n.statusCode,
  2612. headers: n.headers
  2613. });
  2614. });
  2615. }
  2616. function a(e, t) {
  2617. var n = this,
  2618. i = "";
  2619. if (e.BucketAZConfig) {
  2620. var a = {
  2621. BucketAZConfig: e.BucketAZConfig
  2622. };
  2623. i = _e.json2xml({
  2624. CreateBucketConfiguration: a
  2625. });
  2626. }
  2627. be.call(this, {
  2628. Action: "name/cos:PutBucket",
  2629. method: "PUT",
  2630. Bucket: e.Bucket,
  2631. Region: e.Region,
  2632. headers: e.Headers,
  2633. body: i
  2634. }, function (i, a) {
  2635. if (i) return t(i);
  2636. var o = ye({
  2637. protocol: n.options.Protocol,
  2638. domain: n.options.Domain,
  2639. bucket: e.Bucket,
  2640. region: e.Region,
  2641. isLocation: !0
  2642. });
  2643. t(null, {
  2644. Location: o,
  2645. statusCode: a.statusCode,
  2646. headers: a.headers
  2647. });
  2648. });
  2649. }
  2650. function o(e, t) {
  2651. be.call(this, {
  2652. Action: "name/cos:HeadBucket",
  2653. Bucket: e.Bucket,
  2654. Region: e.Region,
  2655. headers: e.Headers,
  2656. method: "HEAD"
  2657. }, function (e, n) {
  2658. t(e, n);
  2659. });
  2660. }
  2661. function r(e, t) {
  2662. var n = {};
  2663. n.prefix = e.Prefix || "", n.delimiter = e.Delimiter, n.marker = e.Marker, n["max-keys"] = e.MaxKeys, n["encoding-type"] = e.EncodingType, be.call(this, {
  2664. Action: "name/cos:GetBucket",
  2665. ResourceKey: n.prefix,
  2666. method: "GET",
  2667. Bucket: e.Bucket,
  2668. Region: e.Region,
  2669. headers: e.Headers,
  2670. qs: n
  2671. }, function (e, n) {
  2672. if (e) return t(e);
  2673. var i = n.ListBucketResult || {},
  2674. a = i.Contents || [],
  2675. o = i.CommonPrefixes || [];
  2676. a = _e.isArray(a) ? a : [a], o = _e.isArray(o) ? o : [o];
  2677. var r = _e.clone(i);
  2678. _e.extend(r, {
  2679. Contents: a,
  2680. CommonPrefixes: o,
  2681. statusCode: n.statusCode,
  2682. headers: n.headers
  2683. }), t(null, r);
  2684. });
  2685. }
  2686. function s(e, t) {
  2687. be.call(this, {
  2688. Action: "name/cos:DeleteBucket",
  2689. Bucket: e.Bucket,
  2690. Region: e.Region,
  2691. headers: e.Headers,
  2692. method: "DELETE"
  2693. }, function (e, n) {
  2694. return e && 204 === e.statusCode ? t(null, {
  2695. statusCode: e.statusCode
  2696. }) : e ? t(e) : void t(null, {
  2697. statusCode: n.statusCode,
  2698. headers: n.headers
  2699. });
  2700. });
  2701. }
  2702. function c(e, t) {
  2703. var n = e.Headers,
  2704. i = "";
  2705. if (e.AccessControlPolicy) {
  2706. var a = _e.clone(e.AccessControlPolicy || {}),
  2707. o = a.Grants || a.Grant;
  2708. o = _e.isArray(o) ? o : [o], delete a.Grant, delete a.Grants, a.AccessControlList = {
  2709. Grant: o
  2710. }, i = _e.json2xml({
  2711. AccessControlPolicy: a
  2712. }), n["Content-Type"] = "application/xml", n["Content-MD5"] = _e.binaryBase64(_e.md5(i));
  2713. }
  2714. _e.each(n, function (e, t) {
  2715. 0 === t.indexOf("x-cos-grant-") && (n[t] = xe(n[t]));
  2716. }), be.call(this, {
  2717. Action: "name/cos:PutBucketACL",
  2718. method: "PUT",
  2719. Bucket: e.Bucket,
  2720. Region: e.Region,
  2721. headers: n,
  2722. action: "acl",
  2723. body: i
  2724. }, function (e, n) {
  2725. if (e) return t(e);
  2726. t(null, {
  2727. statusCode: n.statusCode,
  2728. headers: n.headers
  2729. });
  2730. });
  2731. }
  2732. function l(e, t) {
  2733. be.call(this, {
  2734. Action: "name/cos:GetBucketACL",
  2735. method: "GET",
  2736. Bucket: e.Bucket,
  2737. Region: e.Region,
  2738. headers: e.Headers,
  2739. action: "acl"
  2740. }, function (e, n) {
  2741. if (e) return t(e);
  2742. var i = n.AccessControlPolicy || {},
  2743. a = i.Owner || {},
  2744. o = i.AccessControlList.Grant || [];
  2745. o = _e.isArray(o) ? o : [o];
  2746. var r = ve(i);
  2747. n.headers && n.headers["x-cos-acl"] && (r.ACL = n.headers["x-cos-acl"]), r = _e.extend(r, {
  2748. Owner: a,
  2749. Grants: o,
  2750. statusCode: n.statusCode,
  2751. headers: n.headers
  2752. }), t(null, r);
  2753. });
  2754. }
  2755. function p(e, t) {
  2756. var n = e.CORSConfiguration || {},
  2757. i = n.CORSRules || e.CORSRules || [];
  2758. i = _e.clone(_e.isArray(i) ? i : [i]), _e.each(i, function (e) {
  2759. _e.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function (t) {
  2760. var n = t + "s",
  2761. i = e[n] || e[t] || [];
  2762. delete e[n], e[t] = _e.isArray(i) ? i : [i];
  2763. });
  2764. });
  2765. var a = _e.json2xml({
  2766. CORSConfiguration: {
  2767. CORSRule: i
  2768. }
  2769. }),
  2770. o = e.Headers;
  2771. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  2772. Action: "name/cos:PutBucketCORS",
  2773. method: "PUT",
  2774. Bucket: e.Bucket,
  2775. Region: e.Region,
  2776. body: a,
  2777. action: "cors",
  2778. headers: o
  2779. }, function (e, n) {
  2780. if (e) return t(e);
  2781. t(null, {
  2782. statusCode: n.statusCode,
  2783. headers: n.headers
  2784. });
  2785. });
  2786. }
  2787. function u(e, t) {
  2788. be.call(this, {
  2789. Action: "name/cos:GetBucketCORS",
  2790. method: "GET",
  2791. Bucket: e.Bucket,
  2792. Region: e.Region,
  2793. headers: e.Headers,
  2794. action: "cors"
  2795. }, function (e, n) {
  2796. if (e) {
  2797. if (404 === e.statusCode && e.error && "NoSuchCORSConfiguration" === e.error.Code) {
  2798. var i = {
  2799. CORSRules: [],
  2800. statusCode: e.statusCode
  2801. };
  2802. e.headers && (i.headers = e.headers), t(null, i);
  2803. } else t(e);
  2804. } else {
  2805. var a = n.CORSConfiguration || {},
  2806. o = a.CORSRules || a.CORSRule || [];
  2807. o = _e.clone(_e.isArray(o) ? o : [o]), _e.each(o, function (e) {
  2808. _e.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function (t) {
  2809. var n = t + "s",
  2810. i = e[n] || e[t] || [];
  2811. delete e[t], e[n] = _e.isArray(i) ? i : [i];
  2812. });
  2813. }), t(null, {
  2814. CORSRules: o,
  2815. statusCode: n.statusCode,
  2816. headers: n.headers
  2817. });
  2818. }
  2819. });
  2820. }
  2821. function d(e, t) {
  2822. be.call(this, {
  2823. Action: "name/cos:DeleteBucketCORS",
  2824. method: "DELETE",
  2825. Bucket: e.Bucket,
  2826. Region: e.Region,
  2827. headers: e.Headers,
  2828. action: "cors"
  2829. }, function (e, n) {
  2830. return e && 204 === e.statusCode ? t(null, {
  2831. statusCode: e.statusCode
  2832. }) : e ? t(e) : void t(null, {
  2833. statusCode: n.statusCode || e.statusCode,
  2834. headers: n.headers
  2835. });
  2836. });
  2837. }
  2838. function m(e, t) {
  2839. be.call(this, {
  2840. Action: "name/cos:GetBucketLocation",
  2841. method: "GET",
  2842. Bucket: e.Bucket,
  2843. Region: e.Region,
  2844. headers: e.Headers,
  2845. action: "location"
  2846. }, function (e, n) {
  2847. if (e) return t(e);
  2848. t(null, n);
  2849. });
  2850. }
  2851. function f(e, t) {
  2852. var n = e.Policy,
  2853. i = n;
  2854. try {
  2855. "string" == typeof n ? n = JSON.parse(i) : i = JSON.stringify(n);
  2856. } catch (e) {
  2857. t({
  2858. error: "Policy format error"
  2859. });
  2860. }
  2861. var a = e.Headers;
  2862. a["Content-Type"] = "application/json", a["Content-MD5"] = _e.binaryBase64(_e.md5(i)), be.call(this, {
  2863. Action: "name/cos:PutBucketPolicy",
  2864. method: "PUT",
  2865. Bucket: e.Bucket,
  2866. Region: e.Region,
  2867. action: "policy",
  2868. body: i,
  2869. headers: a,
  2870. json: !0
  2871. }, function (e, n) {
  2872. return e && 204 === e.statusCode ? t(null, {
  2873. statusCode: e.statusCode
  2874. }) : e ? t(e) : void t(null, {
  2875. statusCode: n.statusCode,
  2876. headers: n.headers
  2877. });
  2878. });
  2879. }
  2880. function h(e, t) {
  2881. be.call(this, {
  2882. Action: "name/cos:GetBucketPolicy",
  2883. method: "GET",
  2884. Bucket: e.Bucket,
  2885. Region: e.Region,
  2886. headers: e.Headers,
  2887. action: "policy",
  2888. rawBody: !0
  2889. }, function (e, n) {
  2890. if (e) return t(e.statusCode && 403 === e.statusCode ? {
  2891. ErrorStatus: "Access Denied"
  2892. } : e.statusCode && 405 === e.statusCode ? {
  2893. ErrorStatus: "Method Not Allowed"
  2894. } : e.statusCode && 404 === e.statusCode ? {
  2895. ErrorStatus: "Policy Not Found"
  2896. } : e);
  2897. var i = {};
  2898. try {
  2899. i = JSON.parse(n.body);
  2900. } catch (e) {}
  2901. t(null, {
  2902. Policy: i,
  2903. statusCode: n.statusCode,
  2904. headers: n.headers
  2905. });
  2906. });
  2907. }
  2908. function g(e, t) {
  2909. be.call(this, {
  2910. Action: "name/cos:DeleteBucketPolicy",
  2911. method: "DELETE",
  2912. Bucket: e.Bucket,
  2913. Region: e.Region,
  2914. headers: e.Headers,
  2915. action: "policy"
  2916. }, function (e, n) {
  2917. return e && 204 === e.statusCode ? t(null, {
  2918. statusCode: e.statusCode
  2919. }) : e ? t(e) : void t(null, {
  2920. statusCode: n.statusCode || e.statusCode,
  2921. headers: n.headers
  2922. });
  2923. });
  2924. }
  2925. function v(e, t) {
  2926. var n = e.Tagging || {},
  2927. i = n.TagSet || n.Tags || e.Tags || [];
  2928. i = _e.clone(_e.isArray(i) ? i : [i]);
  2929. var a = _e.json2xml({
  2930. Tagging: {
  2931. TagSet: {
  2932. Tag: i
  2933. }
  2934. }
  2935. }),
  2936. o = e.Headers;
  2937. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  2938. Action: "name/cos:PutBucketTagging",
  2939. method: "PUT",
  2940. Bucket: e.Bucket,
  2941. Region: e.Region,
  2942. body: a,
  2943. action: "tagging",
  2944. headers: o
  2945. }, function (e, n) {
  2946. return e && 204 === e.statusCode ? t(null, {
  2947. statusCode: e.statusCode
  2948. }) : e ? t(e) : void t(null, {
  2949. statusCode: n.statusCode,
  2950. headers: n.headers
  2951. });
  2952. });
  2953. }
  2954. function x(e, t) {
  2955. be.call(this, {
  2956. Action: "name/cos:GetBucketTagging",
  2957. method: "GET",
  2958. Bucket: e.Bucket,
  2959. Region: e.Region,
  2960. headers: e.Headers,
  2961. action: "tagging"
  2962. }, function (e, n) {
  2963. if (e) {
  2964. if (404 !== e.statusCode || !e.error || "Not Found" !== e.error && "NoSuchTagSet" !== e.error.Code) t(e);else {
  2965. var i = {
  2966. Tags: [],
  2967. statusCode: e.statusCode
  2968. };
  2969. e.headers && (i.headers = e.headers), t(null, i);
  2970. }
  2971. } else {
  2972. var a = [];
  2973. try {
  2974. a = n.Tagging.TagSet.Tag || [];
  2975. } catch (e) {}
  2976. a = _e.clone(_e.isArray(a) ? a : [a]), t(null, {
  2977. Tags: a,
  2978. statusCode: n.statusCode,
  2979. headers: n.headers
  2980. });
  2981. }
  2982. });
  2983. }
  2984. function y(e, t) {
  2985. be.call(this, {
  2986. Action: "name/cos:DeleteBucketTagging",
  2987. method: "DELETE",
  2988. Bucket: e.Bucket,
  2989. Region: e.Region,
  2990. headers: e.Headers,
  2991. action: "tagging"
  2992. }, function (e, n) {
  2993. return e && 204 === e.statusCode ? t(null, {
  2994. statusCode: e.statusCode
  2995. }) : e ? t(e) : void t(null, {
  2996. statusCode: n.statusCode,
  2997. headers: n.headers
  2998. });
  2999. });
  3000. }
  3001. function C(e, t) {
  3002. var n = e.LifecycleConfiguration || {},
  3003. i = n.Rules || e.Rules || [];
  3004. i = _e.clone(i);
  3005. var a = _e.json2xml({
  3006. LifecycleConfiguration: {
  3007. Rule: i
  3008. }
  3009. }),
  3010. o = e.Headers;
  3011. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  3012. Action: "name/cos:PutBucketLifecycle",
  3013. method: "PUT",
  3014. Bucket: e.Bucket,
  3015. Region: e.Region,
  3016. body: a,
  3017. action: "lifecycle",
  3018. headers: o
  3019. }, function (e, n) {
  3020. return e && 204 === e.statusCode ? t(null, {
  3021. statusCode: e.statusCode
  3022. }) : e ? t(e) : void t(null, {
  3023. statusCode: n.statusCode,
  3024. headers: n.headers
  3025. });
  3026. });
  3027. }
  3028. function k(e, t) {
  3029. be.call(this, {
  3030. Action: "name/cos:GetBucketLifecycle",
  3031. method: "GET",
  3032. Bucket: e.Bucket,
  3033. Region: e.Region,
  3034. headers: e.Headers,
  3035. action: "lifecycle"
  3036. }, function (e, n) {
  3037. if (e) {
  3038. if (404 === e.statusCode && e.error && "NoSuchLifecycleConfiguration" === e.error.Code) {
  3039. var i = {
  3040. Rules: [],
  3041. statusCode: e.statusCode
  3042. };
  3043. e.headers && (i.headers = e.headers), t(null, i);
  3044. } else t(e);
  3045. } else {
  3046. var a = [];
  3047. try {
  3048. a = n.LifecycleConfiguration.Rule || [];
  3049. } catch (e) {}
  3050. a = _e.clone(_e.isArray(a) ? a : [a]), t(null, {
  3051. Rules: a,
  3052. statusCode: n.statusCode,
  3053. headers: n.headers
  3054. });
  3055. }
  3056. });
  3057. }
  3058. function b(e, t) {
  3059. be.call(this, {
  3060. Action: "name/cos:DeleteBucketLifecycle",
  3061. method: "DELETE",
  3062. Bucket: e.Bucket,
  3063. Region: e.Region,
  3064. headers: e.Headers,
  3065. action: "lifecycle"
  3066. }, function (e, n) {
  3067. return e && 204 === e.statusCode ? t(null, {
  3068. statusCode: e.statusCode
  3069. }) : e ? t(e) : void t(null, {
  3070. statusCode: n.statusCode,
  3071. headers: n.headers
  3072. });
  3073. });
  3074. }
  3075. function S(e, t) {
  3076. if (!e.VersioningConfiguration) return void t({
  3077. error: "missing param VersioningConfiguration"
  3078. });
  3079. var n = e.VersioningConfiguration || {},
  3080. i = _e.json2xml({
  3081. VersioningConfiguration: n
  3082. }),
  3083. a = e.Headers;
  3084. a["Content-Type"] = "application/xml", a["Content-MD5"] = _e.binaryBase64(_e.md5(i)), be.call(this, {
  3085. Action: "name/cos:PutBucketVersioning",
  3086. method: "PUT",
  3087. Bucket: e.Bucket,
  3088. Region: e.Region,
  3089. body: i,
  3090. action: "versioning",
  3091. headers: a
  3092. }, function (e, n) {
  3093. return e && 204 === e.statusCode ? t(null, {
  3094. statusCode: e.statusCode
  3095. }) : e ? t(e) : void t(null, {
  3096. statusCode: n.statusCode,
  3097. headers: n.headers
  3098. });
  3099. });
  3100. }
  3101. function R(e, t) {
  3102. be.call(this, {
  3103. Action: "name/cos:GetBucketVersioning",
  3104. method: "GET",
  3105. Bucket: e.Bucket,
  3106. Region: e.Region,
  3107. headers: e.Headers,
  3108. action: "versioning"
  3109. }, function (e, n) {
  3110. e || !n.VersioningConfiguration && (n.VersioningConfiguration = {}), t(e, n);
  3111. });
  3112. }
  3113. function w(e, t) {
  3114. var n = _e.clone(e.ReplicationConfiguration),
  3115. i = _e.json2xml({
  3116. ReplicationConfiguration: n
  3117. });
  3118. i = i.replace(/<(\/?)Rules>/gi, "<$1Rule>"), i = i.replace(/<(\/?)Tags>/gi, "<$1Tag>");
  3119. var a = e.Headers;
  3120. a["Content-Type"] = "application/xml", a["Content-MD5"] = _e.binaryBase64(_e.md5(i)), be.call(this, {
  3121. Action: "name/cos:PutBucketReplication",
  3122. method: "PUT",
  3123. Bucket: e.Bucket,
  3124. Region: e.Region,
  3125. body: i,
  3126. action: "replication",
  3127. headers: a
  3128. }, function (e, n) {
  3129. return e && 204 === e.statusCode ? t(null, {
  3130. statusCode: e.statusCode
  3131. }) : e ? t(e) : void t(null, {
  3132. statusCode: n.statusCode,
  3133. headers: n.headers
  3134. });
  3135. });
  3136. }
  3137. function _(e, t) {
  3138. be.call(this, {
  3139. Action: "name/cos:GetBucketReplication",
  3140. method: "GET",
  3141. Bucket: e.Bucket,
  3142. Region: e.Region,
  3143. headers: e.Headers,
  3144. action: "replication"
  3145. }, function (e, n) {
  3146. if (e) {
  3147. if (404 !== e.statusCode || !e.error || "Not Found" !== e.error && "ReplicationConfigurationnotFoundError" !== e.error.Code) t(e);else {
  3148. var i = {
  3149. ReplicationConfiguration: {
  3150. Rules: []
  3151. },
  3152. statusCode: e.statusCode
  3153. };
  3154. e.headers && (i.headers = e.headers), t(null, i);
  3155. }
  3156. } else e || !n.ReplicationConfiguration && (n.ReplicationConfiguration = {}), n.ReplicationConfiguration.Rule && (n.ReplicationConfiguration.Rules = n.ReplicationConfiguration.Rule, delete n.ReplicationConfiguration.Rule), t(e, n);
  3157. });
  3158. }
  3159. function A(e, t) {
  3160. be.call(this, {
  3161. Action: "name/cos:DeleteBucketReplication",
  3162. method: "DELETE",
  3163. Bucket: e.Bucket,
  3164. Region: e.Region,
  3165. headers: e.Headers,
  3166. action: "replication"
  3167. }, function (e, n) {
  3168. return e && 204 === e.statusCode ? t(null, {
  3169. statusCode: e.statusCode
  3170. }) : e ? t(e) : void t(null, {
  3171. statusCode: n.statusCode,
  3172. headers: n.headers
  3173. });
  3174. });
  3175. }
  3176. function T(e, t) {
  3177. if (!e.WebsiteConfiguration) return void t({
  3178. error: "missing param WebsiteConfiguration"
  3179. });
  3180. var n = _e.clone(e.WebsiteConfiguration || {}),
  3181. i = n.RoutingRules || n.RoutingRule || [];
  3182. i = _e.isArray(i) ? i : [i], delete n.RoutingRule, delete n.RoutingRules, i.length && (n.RoutingRules = {
  3183. RoutingRule: i
  3184. });
  3185. var a = _e.json2xml({
  3186. WebsiteConfiguration: n
  3187. }),
  3188. o = e.Headers;
  3189. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  3190. Action: "name/cos:PutBucketWebsite",
  3191. method: "PUT",
  3192. Bucket: e.Bucket,
  3193. Region: e.Region,
  3194. body: a,
  3195. action: "website",
  3196. headers: o
  3197. }, function (e, n) {
  3198. return e && 204 === e.statusCode ? t(null, {
  3199. statusCode: e.statusCode
  3200. }) : e ? t(e) : void t(null, {
  3201. statusCode: n.statusCode,
  3202. headers: n.headers
  3203. });
  3204. });
  3205. }
  3206. function E(e, t) {
  3207. be.call(this, {
  3208. Action: "name/cos:GetBucketWebsite",
  3209. method: "GET",
  3210. Bucket: e.Bucket,
  3211. Region: e.Region,
  3212. Key: e.Key,
  3213. headers: e.Headers,
  3214. action: "website"
  3215. }, function (e, n) {
  3216. if (e) {
  3217. if (404 === e.statusCode && "NoSuchWebsiteConfiguration" === e.error.Code) {
  3218. var i = {
  3219. WebsiteConfiguration: {},
  3220. statusCode: e.statusCode
  3221. };
  3222. e.headers && (i.headers = e.headers), t(null, i);
  3223. } else t(e);
  3224. } else {
  3225. var a = n.WebsiteConfiguration || {};
  3226. if (a.RoutingRules) {
  3227. var o = _e.clone(a.RoutingRules.RoutingRule || []);
  3228. o = _e.makeArray(o), a.RoutingRules = o;
  3229. }
  3230. t(null, {
  3231. WebsiteConfiguration: a,
  3232. statusCode: n.statusCode,
  3233. headers: n.headers
  3234. });
  3235. }
  3236. });
  3237. }
  3238. function B(e, t) {
  3239. be.call(this, {
  3240. Action: "name/cos:DeleteBucketWebsite",
  3241. method: "DELETE",
  3242. Bucket: e.Bucket,
  3243. Region: e.Region,
  3244. headers: e.Headers,
  3245. action: "website"
  3246. }, function (e, n) {
  3247. return e && 204 === e.statusCode ? t(null, {
  3248. statusCode: e.statusCode
  3249. }) : e ? t(e) : void t(null, {
  3250. statusCode: n.statusCode,
  3251. headers: n.headers
  3252. });
  3253. });
  3254. }
  3255. function O(e, t) {
  3256. if (!e.RefererConfiguration) return void t({
  3257. error: "missing param RefererConfiguration"
  3258. });
  3259. var n = _e.clone(e.RefererConfiguration || {}),
  3260. i = n.DomainList || {},
  3261. a = i.Domains || i.Domain || [];
  3262. a = _e.isArray(a) ? a : [a], a.length && (n.DomainList = {
  3263. Domain: a
  3264. });
  3265. var o = _e.json2xml({
  3266. RefererConfiguration: n
  3267. }),
  3268. r = e.Headers;
  3269. r["Content-Type"] = "application/xml", r["Content-MD5"] = _e.binaryBase64(_e.md5(o)), be.call(this, {
  3270. Action: "name/cos:PutBucketReferer",
  3271. method: "PUT",
  3272. Bucket: e.Bucket,
  3273. Region: e.Region,
  3274. body: o,
  3275. action: "referer",
  3276. headers: r
  3277. }, function (e, n) {
  3278. return e && 204 === e.statusCode ? t(null, {
  3279. statusCode: e.statusCode
  3280. }) : e ? t(e) : void t(null, {
  3281. statusCode: n.statusCode,
  3282. headers: n.headers
  3283. });
  3284. });
  3285. }
  3286. function D(e, t) {
  3287. be.call(this, {
  3288. Action: "name/cos:GetBucketReferer",
  3289. method: "GET",
  3290. Bucket: e.Bucket,
  3291. Region: e.Region,
  3292. Key: e.Key,
  3293. headers: e.Headers,
  3294. action: "referer"
  3295. }, function (e, n) {
  3296. if (e) {
  3297. if (404 === e.statusCode && "NoSuchRefererConfiguration" === e.error.Code) {
  3298. var i = {
  3299. WebsiteConfiguration: {},
  3300. statusCode: e.statusCode
  3301. };
  3302. e.headers && (i.headers = e.headers), t(null, i);
  3303. } else t(e);
  3304. } else {
  3305. var a = n.RefererConfiguration || {};
  3306. if (a.DomainList) {
  3307. var o = _e.clone(a.DomainList.Domain || []);
  3308. o = _e.makeArray(o), a.DomainList = {
  3309. Domains: o
  3310. };
  3311. }
  3312. t(null, {
  3313. RefererConfiguration: a,
  3314. statusCode: n.statusCode,
  3315. headers: n.headers
  3316. });
  3317. }
  3318. });
  3319. }
  3320. function N(e, t) {
  3321. var n = e.DomainConfiguration || {},
  3322. i = n.DomainRule || e.DomainRule || [];
  3323. i = _e.clone(i);
  3324. var a = _e.json2xml({
  3325. DomainConfiguration: {
  3326. DomainRule: i
  3327. }
  3328. }),
  3329. o = e.Headers;
  3330. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  3331. Action: "name/cos:PutBucketDomain",
  3332. method: "PUT",
  3333. Bucket: e.Bucket,
  3334. Region: e.Region,
  3335. body: a,
  3336. action: "domain",
  3337. headers: o
  3338. }, function (e, n) {
  3339. return e && 204 === e.statusCode ? t(null, {
  3340. statusCode: e.statusCode
  3341. }) : e ? t(e) : void t(null, {
  3342. statusCode: n.statusCode,
  3343. headers: n.headers
  3344. });
  3345. });
  3346. }
  3347. function I(e, t) {
  3348. be.call(this, {
  3349. Action: "name/cos:GetBucketDomain",
  3350. method: "GET",
  3351. Bucket: e.Bucket,
  3352. Region: e.Region,
  3353. headers: e.Headers,
  3354. action: "domain"
  3355. }, function (e, n) {
  3356. if (e) return t(e);
  3357. var i = [];
  3358. try {
  3359. i = n.DomainConfiguration.DomainRule || [];
  3360. } catch (e) {}
  3361. i = _e.clone(_e.isArray(i) ? i : [i]), t(null, {
  3362. DomainRule: i,
  3363. statusCode: n.statusCode,
  3364. headers: n.headers
  3365. });
  3366. });
  3367. }
  3368. function P(e, t) {
  3369. be.call(this, {
  3370. Action: "name/cos:DeleteBucketDomain",
  3371. method: "DELETE",
  3372. Bucket: e.Bucket,
  3373. Region: e.Region,
  3374. headers: e.Headers,
  3375. action: "domain"
  3376. }, function (e, n) {
  3377. return e && 204 === e.statusCode ? t(null, {
  3378. statusCode: e.statusCode
  3379. }) : e ? t(e) : void t(null, {
  3380. statusCode: n.statusCode,
  3381. headers: n.headers
  3382. });
  3383. });
  3384. }
  3385. function j(e, t) {
  3386. var n = e.OriginConfiguration || {},
  3387. i = n.OriginRule || e.OriginRule || [];
  3388. i = _e.clone(i);
  3389. var a = _e.json2xml({
  3390. OriginConfiguration: {
  3391. OriginRule: i
  3392. }
  3393. }),
  3394. o = e.Headers;
  3395. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  3396. Action: "name/cos:PutBucketOrigin",
  3397. method: "PUT",
  3398. Bucket: e.Bucket,
  3399. Region: e.Region,
  3400. body: a,
  3401. action: "origin",
  3402. headers: o
  3403. }, function (e, n) {
  3404. return e && 204 === e.statusCode ? t(null, {
  3405. statusCode: e.statusCode
  3406. }) : e ? t(e) : void t(null, {
  3407. statusCode: n.statusCode,
  3408. headers: n.headers
  3409. });
  3410. });
  3411. }
  3412. function M(e, t) {
  3413. be.call(this, {
  3414. Action: "name/cos:GetBucketOrigin",
  3415. method: "GET",
  3416. Bucket: e.Bucket,
  3417. Region: e.Region,
  3418. headers: e.Headers,
  3419. action: "origin"
  3420. }, function (e, n) {
  3421. if (e) return t(e);
  3422. var i = [];
  3423. try {
  3424. i = n.OriginConfiguration.OriginRule || [];
  3425. } catch (e) {}
  3426. i = _e.clone(_e.isArray(i) ? i : [i]), t(null, {
  3427. OriginRule: i,
  3428. statusCode: n.statusCode,
  3429. headers: n.headers
  3430. });
  3431. });
  3432. }
  3433. function U(e, t) {
  3434. be.call(this, {
  3435. Action: "name/cos:DeleteBucketOrigin",
  3436. method: "DELETE",
  3437. Bucket: e.Bucket,
  3438. Region: e.Region,
  3439. headers: e.Headers,
  3440. action: "origin"
  3441. }, function (e, n) {
  3442. return e && 204 === e.statusCode ? t(null, {
  3443. statusCode: e.statusCode
  3444. }) : e ? t(e) : void t(null, {
  3445. statusCode: n.statusCode,
  3446. headers: n.headers
  3447. });
  3448. });
  3449. }
  3450. function F(e, t) {
  3451. var n = _e.json2xml({
  3452. BucketLoggingStatus: e.BucketLoggingStatus || ""
  3453. }),
  3454. i = e.Headers;
  3455. i["Content-Type"] = "application/xml", i["Content-MD5"] = _e.binaryBase64(_e.md5(n)), be.call(this, {
  3456. Action: "name/cos:PutBucketLogging",
  3457. method: "PUT",
  3458. Bucket: e.Bucket,
  3459. Region: e.Region,
  3460. body: n,
  3461. action: "logging",
  3462. headers: i
  3463. }, function (e, n) {
  3464. return e && 204 === e.statusCode ? t(null, {
  3465. statusCode: e.statusCode
  3466. }) : e ? t(e) : void t(null, {
  3467. statusCode: n.statusCode,
  3468. headers: n.headers
  3469. });
  3470. });
  3471. }
  3472. function H(e, t) {
  3473. be.call(this, {
  3474. Action: "name/cos:GetBucketLogging",
  3475. method: "GET",
  3476. Bucket: e.Bucket,
  3477. Region: e.Region,
  3478. headers: e.Headers,
  3479. action: "logging"
  3480. }, function (e, n) {
  3481. if (e) return t(e);
  3482. delete n.BucketLoggingStatus._xmlns, t(null, {
  3483. BucketLoggingStatus: n.BucketLoggingStatus,
  3484. statusCode: n.statusCode,
  3485. headers: n.headers
  3486. });
  3487. });
  3488. }
  3489. function L(e, t) {
  3490. var n = _e.clone(e.InventoryConfiguration);
  3491. if (n.OptionalFields) {
  3492. var i = n.OptionalFields || [];
  3493. n.OptionalFields = {
  3494. Field: i
  3495. };
  3496. }
  3497. if (n.Destination && n.Destination.COSBucketDestination && n.Destination.COSBucketDestination.Encryption) {
  3498. var a = n.Destination.COSBucketDestination.Encryption;
  3499. Object.keys(a).indexOf("SSECOS") > -1 && (a["SSE-COS"] = a.SSECOS, delete a.SSECOS);
  3500. }
  3501. var o = _e.json2xml({
  3502. InventoryConfiguration: n
  3503. }),
  3504. r = e.Headers;
  3505. r["Content-Type"] = "application/xml", r["Content-MD5"] = _e.binaryBase64(_e.md5(o)), be.call(this, {
  3506. Action: "name/cos:PutBucketInventory",
  3507. method: "PUT",
  3508. Bucket: e.Bucket,
  3509. Region: e.Region,
  3510. body: o,
  3511. action: "inventory",
  3512. qs: {
  3513. id: e.Id
  3514. },
  3515. headers: r
  3516. }, function (e, n) {
  3517. return e && 204 === e.statusCode ? t(null, {
  3518. statusCode: e.statusCode
  3519. }) : e ? t(e) : void t(null, {
  3520. statusCode: n.statusCode,
  3521. headers: n.headers
  3522. });
  3523. });
  3524. }
  3525. function z(e, t) {
  3526. be.call(this, {
  3527. Action: "name/cos:GetBucketInventory",
  3528. method: "GET",
  3529. Bucket: e.Bucket,
  3530. Region: e.Region,
  3531. headers: e.Headers,
  3532. action: "inventory",
  3533. qs: {
  3534. id: e.Id
  3535. }
  3536. }, function (e, n) {
  3537. if (e) return t(e);
  3538. var i = n.InventoryConfiguration;
  3539. if (i && i.OptionalFields && i.OptionalFields.Field) {
  3540. var a = i.OptionalFields.Field;
  3541. _e.isArray(a) || (a = [a]), i.OptionalFields = a;
  3542. }
  3543. if (i.Destination && i.Destination.COSBucketDestination && i.Destination.COSBucketDestination.Encryption) {
  3544. var o = i.Destination.COSBucketDestination.Encryption;
  3545. Object.keys(o).indexOf("SSE-COS") > -1 && (o.SSECOS = o["SSE-COS"], delete o["SSE-COS"]);
  3546. }
  3547. t(null, {
  3548. InventoryConfiguration: i,
  3549. statusCode: n.statusCode,
  3550. headers: n.headers
  3551. });
  3552. });
  3553. }
  3554. function K(e, t) {
  3555. be.call(this, {
  3556. Action: "name/cos:ListBucketInventory",
  3557. method: "GET",
  3558. Bucket: e.Bucket,
  3559. Region: e.Region,
  3560. headers: e.Headers,
  3561. action: "inventory",
  3562. qs: {
  3563. "continuation-token": e.ContinuationToken
  3564. }
  3565. }, function (e, n) {
  3566. if (e) return t(e);
  3567. var i = n.ListInventoryConfigurationResult,
  3568. a = i.InventoryConfiguration || [];
  3569. a = _e.isArray(a) ? a : [a], delete i.InventoryConfiguration, _e.each(a, function (e) {
  3570. if (e && e.OptionalFields && e.OptionalFields.Field) {
  3571. var t = e.OptionalFields.Field;
  3572. _e.isArray(t) || (t = [t]), e.OptionalFields = t;
  3573. }
  3574. if (e.Destination && e.Destination.COSBucketDestination && e.Destination.COSBucketDestination.Encryption) {
  3575. var n = e.Destination.COSBucketDestination.Encryption;
  3576. Object.keys(n).indexOf("SSE-COS") > -1 && (n.SSECOS = n["SSE-COS"], delete n["SSE-COS"]);
  3577. }
  3578. }), i.InventoryConfigurations = a, _e.extend(i, {
  3579. statusCode: n.statusCode,
  3580. headers: n.headers
  3581. }), t(null, i);
  3582. });
  3583. }
  3584. function q(e, t) {
  3585. be.call(this, {
  3586. Action: "name/cos:DeleteBucketInventory",
  3587. method: "DELETE",
  3588. Bucket: e.Bucket,
  3589. Region: e.Region,
  3590. headers: e.Headers,
  3591. action: "inventory",
  3592. qs: {
  3593. id: e.Id
  3594. }
  3595. }, function (e, n) {
  3596. return e && 204 === e.statusCode ? t(null, {
  3597. statusCode: e.statusCode
  3598. }) : e ? t(e) : void t(null, {
  3599. statusCode: n.statusCode,
  3600. headers: n.headers
  3601. });
  3602. });
  3603. }
  3604. function G(e, t) {
  3605. if (!e.AccelerateConfiguration) return void t({
  3606. error: "missing param AccelerateConfiguration"
  3607. });
  3608. var n = {
  3609. AccelerateConfiguration: e.AccelerateConfiguration || {}
  3610. },
  3611. i = _e.json2xml(n),
  3612. a = {};
  3613. a["Content-Type"] = "application/xml", a["Content-MD5"] = _e.binaryBase64(_e.md5(i)), be.call(this, {
  3614. Interface: "putBucketAccelerate",
  3615. Action: "name/cos:PutBucketAccelerate",
  3616. method: "PUT",
  3617. Bucket: e.Bucket,
  3618. Region: e.Region,
  3619. body: i,
  3620. action: "accelerate",
  3621. headers: a
  3622. }, function (e, n) {
  3623. if (e) return t(e);
  3624. t(null, {
  3625. statusCode: n.statusCode,
  3626. headers: n.headers
  3627. });
  3628. });
  3629. }
  3630. function V(e, t) {
  3631. be.call(this, {
  3632. Interface: "getBucketAccelerate",
  3633. Action: "name/cos:GetBucketAccelerate",
  3634. method: "GET",
  3635. Bucket: e.Bucket,
  3636. Region: e.Region,
  3637. action: "accelerate"
  3638. }, function (e, n) {
  3639. e || !n.AccelerateConfiguration && (n.AccelerateConfiguration = {}), t(e, n);
  3640. });
  3641. }
  3642. function X(e, t) {
  3643. be.call(this, {
  3644. Action: "name/cos:HeadObject",
  3645. method: "HEAD",
  3646. Bucket: e.Bucket,
  3647. Region: e.Region,
  3648. Key: e.Key,
  3649. VersionId: e.VersionId,
  3650. headers: e.Headers
  3651. }, function (n, i) {
  3652. if (n) {
  3653. var a = n.statusCode;
  3654. return e.Headers["If-Modified-Since"] && a && 304 === a ? t(null, {
  3655. NotModified: !0,
  3656. statusCode: a
  3657. }) : t(n);
  3658. }
  3659. i.ETag = _e.attr(i.headers, "etag", ""), t(null, i);
  3660. });
  3661. }
  3662. function W(e, t) {
  3663. var n = {};
  3664. n.prefix = e.Prefix || "", n.delimiter = e.Delimiter, n["key-marker"] = e.KeyMarker, n["version-id-marker"] = e.VersionIdMarker, n["max-keys"] = e.MaxKeys, n["encoding-type"] = e.EncodingType, be.call(this, {
  3665. Action: "name/cos:GetBucketObjectVersions",
  3666. ResourceKey: n.prefix,
  3667. method: "GET",
  3668. Bucket: e.Bucket,
  3669. Region: e.Region,
  3670. headers: e.Headers,
  3671. qs: n,
  3672. action: "versions"
  3673. }, function (e, n) {
  3674. if (e) return t(e);
  3675. var i = n.ListVersionsResult || {},
  3676. a = i.DeleteMarker || [];
  3677. a = _e.isArray(a) ? a : [a];
  3678. var o = i.Version || [];
  3679. o = _e.isArray(o) ? o : [o];
  3680. var r = _e.clone(i);
  3681. delete r.DeleteMarker, delete r.Version, _e.extend(r, {
  3682. DeleteMarkers: a,
  3683. Versions: o,
  3684. statusCode: n.statusCode,
  3685. headers: n.headers
  3686. }), t(null, r);
  3687. });
  3688. }
  3689. function $(e, t) {
  3690. var n = e.Query || {};
  3691. n["response-content-type"] = e.ResponseContentType, n["response-content-language"] = e.ResponseContentLanguage, n["response-expires"] = e.ResponseExpires, n["response-cache-control"] = e.ResponseCacheControl, n["response-content-disposition"] = e.ResponseContentDisposition, n["response-content-encoding"] = e.ResponseContentEncoding, be.call(this, {
  3692. Action: "name/cos:GetObject",
  3693. method: "GET",
  3694. Bucket: e.Bucket,
  3695. Region: e.Region,
  3696. Key: e.Key,
  3697. VersionId: e.VersionId,
  3698. headers: e.Headers,
  3699. qs: n,
  3700. rawBody: !0
  3701. }, function (n, i) {
  3702. if (n) {
  3703. var a = n.statusCode;
  3704. return e.Headers["If-Modified-Since"] && a && 304 === a ? t(null, {
  3705. NotModified: !0
  3706. }) : t(n);
  3707. }
  3708. t(null, {
  3709. Body: i.body,
  3710. ETag: _e.attr(i.headers, "etag", ""),
  3711. statusCode: i.statusCode,
  3712. headers: i.headers
  3713. });
  3714. });
  3715. }
  3716. function Q(e, t) {
  3717. var n = this,
  3718. i = e.ContentLength,
  3719. a = _e.throttleOnProgress.call(n, i, e.onProgress),
  3720. o = e.Headers;
  3721. o["Cache-Control"] || o["cache-control"] || (o["Cache-Control"] = ""), o["Content-Type"] || o["content-type"] || (o["Content-Type"] = Ae.getType(e.Key) || "application/octet-stream"), _e.getBodyMd5(n.options.UploadCheckContentMd5, e.Body, function (r) {
  3722. r && (o["Content-MD5"] = _e.binaryBase64(r)), void 0 !== e.ContentLength && (o["Content-Length"] = e.ContentLength), a(null, !0), be.call(n, {
  3723. Action: "name/cos:PutObject",
  3724. TaskId: e.TaskId,
  3725. method: "PUT",
  3726. Bucket: e.Bucket,
  3727. Region: e.Region,
  3728. Key: e.Key,
  3729. headers: e.Headers,
  3730. qs: e.Query,
  3731. body: e.Body,
  3732. onProgress: a
  3733. }, function (o, r) {
  3734. if (o) return a(null, !0), t(o);
  3735. a({
  3736. loaded: i,
  3737. total: i
  3738. }, !0);
  3739. var s = ye({
  3740. ForcePathStyle: n.options.ForcePathStyle,
  3741. protocol: n.options.Protocol,
  3742. domain: n.options.Domain,
  3743. bucket: e.Bucket,
  3744. region: e.Region,
  3745. object: e.Key
  3746. });
  3747. s = s.substr(s.indexOf("://") + 3), r.Location = s, r.ETag = _e.attr(r.headers, "etag", ""), t(null, r);
  3748. });
  3749. });
  3750. }
  3751. function J(e, t) {
  3752. var n = this,
  3753. i = {},
  3754. a = e.FilePath;
  3755. if (!a) return void t({
  3756. error: "missing param FilePath"
  3757. });
  3758. i["Cache-Control"] = e.CacheControl, i["Content-Disposition"] = e.ContentDisposition, i["Content-Encoding"] = e.ContentEncoding, i["Content-MD5"] = e.ContentMD5, i["Content-Length"] = e.ContentLength, i["Content-Type"] = e.ContentType, i.Expect = e.Expect, i.Expires = e.Expires, i["x-cos-acl"] = e.ACL, i["x-cos-grant-read"] = e.GrantRead, i["x-cos-grant-write"] = e.GrantWrite, i["x-cos-grant-full-control"] = e.GrantFullControl, i["x-cos-storage-class"] = e.StorageClass, delete i["Content-Length"], delete i["content-length"];
  3759. for (var o in e) o.indexOf("x-cos-meta-") > -1 && (i[o] = e[o]);
  3760. var r = _e.throttleOnProgress.call(n, i["Content-Length"], e.onProgress);
  3761. be.call(this, {
  3762. Action: "name/cos:PostObject",
  3763. method: "POST",
  3764. Bucket: e.Bucket,
  3765. Region: e.Region,
  3766. Key: e.Key,
  3767. headers: i,
  3768. qs: e.Query,
  3769. filePath: a,
  3770. onProgress: r
  3771. }, function (i, o) {
  3772. if (r(null, !0), i) return t(i);
  3773. if (o && o.headers) {
  3774. var s = o.headers,
  3775. c = s.etag || s.Etag || s.ETag || "",
  3776. l = a.substr(a.lastIndexOf("/") + 1),
  3777. p = ye({
  3778. ForcePathStyle: n.options.ForcePathStyle,
  3779. protocol: n.options.Protocol,
  3780. domain: n.options.Domain,
  3781. bucket: e.Bucket,
  3782. region: e.Region,
  3783. object: e.Key.replace(/\$\{filename\}/g, l),
  3784. isLocation: !0
  3785. });
  3786. return t(null, {
  3787. Location: p,
  3788. statusCode: o.statusCode,
  3789. headers: s,
  3790. ETag: c
  3791. });
  3792. }
  3793. t(null, o);
  3794. });
  3795. }
  3796. function Y(e, t) {
  3797. be.call(this, {
  3798. Action: "name/cos:DeleteObject",
  3799. method: "DELETE",
  3800. Bucket: e.Bucket,
  3801. Region: e.Region,
  3802. Key: e.Key,
  3803. headers: e.Headers,
  3804. VersionId: e.VersionId
  3805. }, function (e, n) {
  3806. if (e) {
  3807. var i = e.statusCode;
  3808. return i && 204 === i ? t(null, {
  3809. statusCode: i
  3810. }) : i && 404 === i ? t(null, {
  3811. BucketNotFound: !0,
  3812. statusCode: i
  3813. }) : t(e);
  3814. }
  3815. t(null, {
  3816. statusCode: n.statusCode,
  3817. headers: n.headers
  3818. });
  3819. });
  3820. }
  3821. function Z(e, t) {
  3822. be.call(this, {
  3823. Action: "name/cos:GetObjectACL",
  3824. method: "GET",
  3825. Bucket: e.Bucket,
  3826. Region: e.Region,
  3827. Key: e.Key,
  3828. headers: e.Headers,
  3829. action: "acl"
  3830. }, function (e, n) {
  3831. if (e) return t(e);
  3832. var i = n.AccessControlPolicy || {},
  3833. a = i.Owner || {},
  3834. o = i.AccessControlList && i.AccessControlList.Grant || [];
  3835. o = _e.isArray(o) ? o : [o];
  3836. var r = ve(i);
  3837. n.headers && n.headers["x-cos-acl"] && (r.ACL = n.headers["x-cos-acl"]), r = _e.extend(r, {
  3838. Owner: a,
  3839. Grants: o,
  3840. statusCode: n.statusCode,
  3841. headers: n.headers
  3842. }), t(null, r);
  3843. });
  3844. }
  3845. function ee(e, t) {
  3846. var n = e.Headers,
  3847. i = "";
  3848. if (e.AccessControlPolicy) {
  3849. var a = _e.clone(e.AccessControlPolicy || {}),
  3850. o = a.Grants || a.Grant;
  3851. o = _e.isArray(o) ? o : [o], delete a.Grant, delete a.Grants, a.AccessControlList = {
  3852. Grant: o
  3853. }, i = _e.json2xml({
  3854. AccessControlPolicy: a
  3855. }), n["Content-Type"] = "application/xml", n["Content-MD5"] = _e.binaryBase64(_e.md5(i));
  3856. }
  3857. _e.each(n, function (e, t) {
  3858. 0 === t.indexOf("x-cos-grant-") && (n[t] = xe(n[t]));
  3859. }), be.call(this, {
  3860. Action: "name/cos:PutObjectACL",
  3861. method: "PUT",
  3862. Bucket: e.Bucket,
  3863. Region: e.Region,
  3864. Key: e.Key,
  3865. action: "acl",
  3866. headers: n,
  3867. body: i
  3868. }, function (e, n) {
  3869. if (e) return t(e);
  3870. t(null, {
  3871. statusCode: n.statusCode,
  3872. headers: n.headers
  3873. });
  3874. });
  3875. }
  3876. function te(e, t) {
  3877. var n = e.Headers;
  3878. n.Origin = e.Origin, n["Access-Control-Request-Method"] = e.AccessControlRequestMethod, n["Access-Control-Request-Headers"] = e.AccessControlRequestHeaders, be.call(this, {
  3879. Action: "name/cos:OptionsObject",
  3880. method: "OPTIONS",
  3881. Bucket: e.Bucket,
  3882. Region: e.Region,
  3883. Key: e.Key,
  3884. headers: n
  3885. }, function (e, n) {
  3886. if (e) return e.statusCode && 403 === e.statusCode ? t(null, {
  3887. OptionsForbidden: !0,
  3888. statusCode: e.statusCode
  3889. }) : t(e);
  3890. var i = n.headers || {};
  3891. t(null, {
  3892. AccessControlAllowOrigin: i["access-control-allow-origin"],
  3893. AccessControlAllowMethods: i["access-control-allow-methods"],
  3894. AccessControlAllowHeaders: i["access-control-allow-headers"],
  3895. AccessControlExposeHeaders: i["access-control-expose-headers"],
  3896. AccessControlMaxAge: i["access-control-max-age"],
  3897. statusCode: n.statusCode,
  3898. headers: n.headers
  3899. });
  3900. });
  3901. }
  3902. function ne(e, t) {
  3903. var n = e.Headers;
  3904. !n["Cache-Control"] && n["cache-control"] && (n["Cache-Control"] = "");
  3905. var i = e.CopySource || "",
  3906. a = i.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);
  3907. if (!a) return void t({
  3908. error: "CopySource format error"
  3909. });
  3910. var o = a[1],
  3911. r = a[3],
  3912. s = decodeURIComponent(a[4]);
  3913. be.call(this, {
  3914. Scope: [{
  3915. action: "name/cos:GetObject",
  3916. bucket: o,
  3917. region: r,
  3918. prefix: s
  3919. }, {
  3920. action: "name/cos:PutObject",
  3921. bucket: e.Bucket,
  3922. region: e.Region,
  3923. prefix: e.Key
  3924. }],
  3925. method: "PUT",
  3926. Bucket: e.Bucket,
  3927. Region: e.Region,
  3928. Key: e.Key,
  3929. VersionId: e.VersionId,
  3930. headers: e.Headers
  3931. }, function (e, n) {
  3932. if (e) return t(e);
  3933. var i = _e.clone(n.CopyObjectResult || {});
  3934. _e.extend(i, {
  3935. statusCode: n.statusCode,
  3936. headers: n.headers
  3937. }), t(null, i);
  3938. });
  3939. }
  3940. function ie(e, t) {
  3941. var n = e.CopySource || "",
  3942. i = n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);
  3943. if (!i) return void t({
  3944. error: "CopySource format error"
  3945. });
  3946. var a = i[1],
  3947. o = i[3],
  3948. r = decodeURIComponent(i[4]);
  3949. be.call(this, {
  3950. Scope: [{
  3951. action: "name/cos:GetObject",
  3952. bucket: a,
  3953. region: o,
  3954. prefix: r
  3955. }, {
  3956. action: "name/cos:PutObject",
  3957. bucket: e.Bucket,
  3958. region: e.Region,
  3959. prefix: e.Key
  3960. }],
  3961. method: "PUT",
  3962. Bucket: e.Bucket,
  3963. Region: e.Region,
  3964. Key: e.Key,
  3965. VersionId: e.VersionId,
  3966. qs: {
  3967. partNumber: e.PartNumber,
  3968. uploadId: e.UploadId
  3969. },
  3970. headers: e.Headers
  3971. }, function (e, n) {
  3972. if (e) return t(e);
  3973. var i = _e.clone(n.CopyPartResult || {});
  3974. _e.extend(i, {
  3975. statusCode: n.statusCode,
  3976. headers: n.headers
  3977. }), t(null, i);
  3978. });
  3979. }
  3980. function ae(e, t) {
  3981. var n = e.Objects || [],
  3982. i = e.Quiet;
  3983. n = _e.isArray(n) ? n : [n];
  3984. var a = _e.json2xml({
  3985. Delete: {
  3986. Object: n,
  3987. Quiet: i || !1
  3988. }
  3989. }),
  3990. o = e.Headers;
  3991. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a));
  3992. var r = _e.map(n, function (t) {
  3993. return {
  3994. action: "name/cos:DeleteObject",
  3995. bucket: e.Bucket,
  3996. region: e.Region,
  3997. prefix: t.Key
  3998. };
  3999. });
  4000. be.call(this, {
  4001. Scope: r,
  4002. method: "POST",
  4003. Bucket: e.Bucket,
  4004. Region: e.Region,
  4005. body: a,
  4006. action: "delete",
  4007. headers: o
  4008. }, function (e, n) {
  4009. if (e) return t(e);
  4010. var i = n.DeleteResult || {},
  4011. a = i.Deleted || [],
  4012. o = i.Error || [];
  4013. a = _e.isArray(a) ? a : [a], o = _e.isArray(o) ? o : [o];
  4014. var r = _e.clone(i);
  4015. _e.extend(r, {
  4016. Error: o,
  4017. Deleted: a,
  4018. statusCode: n.statusCode,
  4019. headers: n.headers
  4020. }), t(null, r);
  4021. });
  4022. }
  4023. function oe(e, t) {
  4024. var n = e.Headers;
  4025. if (!e.RestoreRequest) return void t({
  4026. error: "missing param RestoreRequest"
  4027. });
  4028. var i = e.RestoreRequest || {},
  4029. a = _e.json2xml({
  4030. RestoreRequest: i
  4031. });
  4032. n["Content-Type"] = "application/xml", n["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  4033. Action: "name/cos:RestoreObject",
  4034. method: "POST",
  4035. Bucket: e.Bucket,
  4036. Region: e.Region,
  4037. Key: e.Key,
  4038. VersionId: e.VersionId,
  4039. body: a,
  4040. action: "restore",
  4041. headers: n
  4042. }, function (e, n) {
  4043. t(e, n);
  4044. });
  4045. }
  4046. function re(e, t) {
  4047. var n = e.Tagging || {},
  4048. i = n.TagSet || n.Tags || e.Tags || [];
  4049. i = _e.clone(_e.isArray(i) ? i : [i]);
  4050. var a = _e.json2xml({
  4051. Tagging: {
  4052. TagSet: {
  4053. Tag: i
  4054. }
  4055. }
  4056. }),
  4057. o = e.Headers;
  4058. o["Content-Type"] = "application/xml", o["Content-MD5"] = _e.binaryBase64(_e.md5(a)), be.call(this, {
  4059. Interface: "putObjectTagging",
  4060. Action: "name/cos:PutObjectTagging",
  4061. method: "PUT",
  4062. Bucket: e.Bucket,
  4063. Key: e.Key,
  4064. Region: e.Region,
  4065. body: a,
  4066. action: "tagging",
  4067. headers: o,
  4068. VersionId: e.VersionId
  4069. }, function (e, n) {
  4070. return e && 204 === e.statusCode ? t(null, {
  4071. statusCode: e.statusCode
  4072. }) : e ? t(e) : void t(null, {
  4073. statusCode: n.statusCode,
  4074. headers: n.headers
  4075. });
  4076. });
  4077. }
  4078. function se(e, t) {
  4079. be.call(this, {
  4080. Interface: "getObjectTagging",
  4081. Action: "name/cos:GetObjectTagging",
  4082. method: "GET",
  4083. Key: e.Key,
  4084. Bucket: e.Bucket,
  4085. Region: e.Region,
  4086. headers: e.Headers,
  4087. action: "tagging",
  4088. VersionId: e.VersionId
  4089. }, function (e, n) {
  4090. if (e) {
  4091. if (404 !== e.statusCode || !e.error || "Not Found" !== e.error && "NoSuchTagSet" !== e.error.Code) t(e);else {
  4092. var i = {
  4093. Tags: [],
  4094. statusCode: e.statusCode
  4095. };
  4096. e.headers && (i.headers = e.headers), t(null, i);
  4097. }
  4098. } else {
  4099. var a = [];
  4100. try {
  4101. a = n.Tagging.TagSet.Tag || [];
  4102. } catch (e) {}
  4103. a = _e.clone(_e.isArray(a) ? a : [a]), t(null, {
  4104. Tags: a,
  4105. statusCode: n.statusCode,
  4106. headers: n.headers
  4107. });
  4108. }
  4109. });
  4110. }
  4111. function ce(e, t) {
  4112. be.call(this, {
  4113. Interface: "deleteObjectTagging",
  4114. Action: "name/cos:DeleteObjectTagging",
  4115. method: "DELETE",
  4116. Bucket: e.Bucket,
  4117. Region: e.Region,
  4118. Key: e.Key,
  4119. headers: e.Headers,
  4120. action: "tagging",
  4121. VersionId: e.VersionId
  4122. }, function (e, n) {
  4123. return e && 204 === e.statusCode ? t(null, {
  4124. statusCode: e.statusCode
  4125. }) : e ? t(e) : void t(null, {
  4126. statusCode: n.statusCode,
  4127. headers: n.headers
  4128. });
  4129. });
  4130. }
  4131. function le(e, t) {
  4132. var n = this,
  4133. i = e.Headers;
  4134. i["Cache-Control"] || i["cache-control"] || (i["Cache-Control"] = ""), i["Content-Type"] || i["content-type"] || (i["Content-Type"] = Ae.getType(e.Key) || "application/octet-stream"), be.call(n, {
  4135. Action: "name/cos:InitiateMultipartUpload",
  4136. method: "POST",
  4137. Bucket: e.Bucket,
  4138. Region: e.Region,
  4139. Key: e.Key,
  4140. action: "uploads",
  4141. headers: e.Headers,
  4142. qs: e.Query
  4143. }, function (e, n) {
  4144. return e ? t(e) : (n = _e.clone(n || {})) && n.InitiateMultipartUploadResult ? t(null, _e.extend(n.InitiateMultipartUploadResult, {
  4145. statusCode: n.statusCode,
  4146. headers: n.headers
  4147. })) : void t(null, n);
  4148. });
  4149. }
  4150. function pe(e, t) {
  4151. var n = this;
  4152. _e.getFileSize("multipartUpload", e, function () {
  4153. _e.getBodyMd5(n.options.UploadCheckContentMd5, e.Body, function (i) {
  4154. i && (e.Headers["Content-MD5"] = _e.binaryBase64(i)), be.call(n, {
  4155. Action: "name/cos:UploadPart",
  4156. TaskId: e.TaskId,
  4157. method: "PUT",
  4158. Bucket: e.Bucket,
  4159. Region: e.Region,
  4160. Key: e.Key,
  4161. qs: {
  4162. partNumber: e.PartNumber,
  4163. uploadId: e.UploadId
  4164. },
  4165. headers: e.Headers,
  4166. onProgress: e.onProgress,
  4167. body: e.Body || null
  4168. }, function (e, n) {
  4169. if (e) return t(e);
  4170. t(null, {
  4171. ETag: _e.attr(n.headers, "etag", {}),
  4172. statusCode: n.statusCode,
  4173. headers: n.headers
  4174. });
  4175. });
  4176. });
  4177. });
  4178. }
  4179. function ue(e, t) {
  4180. for (var n = this, i = e.UploadId, a = e.Parts, o = 0, r = a.length; o < r; o++) 0 !== a[o].ETag.indexOf('"') && (a[o].ETag = '"' + a[o].ETag + '"');
  4181. var s = _e.json2xml({
  4182. CompleteMultipartUpload: {
  4183. Part: a
  4184. }
  4185. }),
  4186. c = e.Headers;
  4187. c["Content-Type"] = "application/xml", c["Content-MD5"] = _e.binaryBase64(_e.md5(s)), be.call(this, {
  4188. Action: "name/cos:CompleteMultipartUpload",
  4189. method: "POST",
  4190. Bucket: e.Bucket,
  4191. Region: e.Region,
  4192. Key: e.Key,
  4193. qs: {
  4194. uploadId: i
  4195. },
  4196. body: s,
  4197. headers: c
  4198. }, function (i, a) {
  4199. if (i) return t(i);
  4200. var o = ye({
  4201. ForcePathStyle: n.options.ForcePathStyle,
  4202. protocol: n.options.Protocol,
  4203. domain: n.options.Domain,
  4204. bucket: e.Bucket,
  4205. region: e.Region,
  4206. object: e.Key,
  4207. isLocation: !0
  4208. }),
  4209. r = a.CompleteMultipartUploadResult || {},
  4210. s = _e.extend(r, {
  4211. Location: o,
  4212. statusCode: a.statusCode,
  4213. headers: a.headers
  4214. });
  4215. t(null, s);
  4216. });
  4217. }
  4218. function de(e, t) {
  4219. var n = {};
  4220. n.delimiter = e.Delimiter, n["encoding-type"] = e.EncodingType, n.prefix = e.Prefix || "", n["max-uploads"] = e.MaxUploads, n["key-marker"] = e.KeyMarker, n["upload-id-marker"] = e.UploadIdMarker, n = _e.clearKey(n), be.call(this, {
  4221. Action: "name/cos:ListMultipartUploads",
  4222. ResourceKey: n.prefix,
  4223. method: "GET",
  4224. Bucket: e.Bucket,
  4225. Region: e.Region,
  4226. headers: e.Headers,
  4227. qs: n,
  4228. action: "uploads"
  4229. }, function (e, n) {
  4230. if (e) return t(e);
  4231. if (n && n.ListMultipartUploadsResult) {
  4232. var i = n.ListMultipartUploadsResult.Upload || [],
  4233. a = n.ListMultipartUploadsResult.CommonPrefixes || [];
  4234. a = _e.isArray(a) ? a : [a], i = _e.isArray(i) ? i : [i], n.ListMultipartUploadsResult.Upload = i, n.ListMultipartUploadsResult.CommonPrefixes = a;
  4235. }
  4236. var o = _e.clone(n.ListMultipartUploadsResult || {});
  4237. _e.extend(o, {
  4238. statusCode: n.statusCode,
  4239. headers: n.headers
  4240. }), t(null, o);
  4241. });
  4242. }
  4243. function me(e, t) {
  4244. var n = {};
  4245. n.uploadId = e.UploadId, n["encoding-type"] = e.EncodingType, n["max-parts"] = e.MaxParts, n["part-number-marker"] = e.PartNumberMarker, be.call(this, {
  4246. Action: "name/cos:ListParts",
  4247. method: "GET",
  4248. Bucket: e.Bucket,
  4249. Region: e.Region,
  4250. Key: e.Key,
  4251. headers: e.Headers,
  4252. qs: n
  4253. }, function (e, n) {
  4254. if (e) return t(e);
  4255. var i = n.ListPartsResult || {},
  4256. a = i.Part || [];
  4257. a = _e.isArray(a) ? a : [a], i.Part = a;
  4258. var o = _e.clone(i);
  4259. _e.extend(o, {
  4260. statusCode: n.statusCode,
  4261. headers: n.headers
  4262. }), t(null, o);
  4263. });
  4264. }
  4265. function fe(e, t) {
  4266. var n = {};
  4267. n.uploadId = e.UploadId, be.call(this, {
  4268. Action: "name/cos:AbortMultipartUpload",
  4269. method: "DELETE",
  4270. Bucket: e.Bucket,
  4271. Region: e.Region,
  4272. Key: e.Key,
  4273. headers: e.Headers,
  4274. qs: n
  4275. }, function (e, n) {
  4276. if (e) return t(e);
  4277. t(null, {
  4278. statusCode: n.statusCode,
  4279. headers: n.headers
  4280. });
  4281. });
  4282. }
  4283. function he(e) {
  4284. var t = this;
  4285. return _e.getAuth({
  4286. SecretId: e.SecretId || this.options.SecretId || "",
  4287. SecretKey: e.SecretKey || this.options.SecretKey || "",
  4288. Method: e.Method,
  4289. Key: e.Key,
  4290. Query: e.Query,
  4291. Headers: e.Headers,
  4292. Expires: e.Expires,
  4293. SystemClockOffset: t.options.SystemClockOffset
  4294. });
  4295. }
  4296. function ge(e, t) {
  4297. var n = this,
  4298. i = ye({
  4299. ForcePathStyle: n.options.ForcePathStyle,
  4300. protocol: e.Protocol || n.options.Protocol,
  4301. domain: e.Domain || n.options.Domain,
  4302. bucket: e.Bucket,
  4303. region: e.Region,
  4304. object: e.Key
  4305. });
  4306. if (void 0 !== e.Sign && !e.Sign) return t(null, {
  4307. Url: i
  4308. }), i;
  4309. var a = Ce.call(this, {
  4310. Action: "PUT" === (e.Method || "").toUpperCase() ? "name/cos:PutObject" : "name/cos:GetObject",
  4311. Bucket: e.Bucket || "",
  4312. Region: e.Region || "",
  4313. Method: e.Method || "get",
  4314. Key: e.Key,
  4315. Expires: e.Expires
  4316. }, function (e, n) {
  4317. if (t) {
  4318. if (e) return void t(e);
  4319. var a = i;
  4320. a += "?" + (n.Authorization.indexOf("q-signature") > -1 ? n.Authorization : "sign=" + encodeURIComponent(n.Authorization)), n.XCosSecurityToken && (a += "&x-cos-security-token=" + n.XCosSecurityToken), n.ClientIP && (a += "&clientIP=" + n.ClientIP), n.ClientUA && (a += "&clientUA=" + n.ClientUA), n.Token && (a += "&token=" + n.Token), setTimeout(function () {
  4321. t(null, {
  4322. Url: a
  4323. });
  4324. });
  4325. }
  4326. });
  4327. return a ? i + "?" + a.Authorization + (a.XCosSecurityToken ? "&x-cos-security-token=" + a.XCosSecurityToken : "") : i;
  4328. }
  4329. function ve(e) {
  4330. var t = {
  4331. GrantFullControl: [],
  4332. GrantWrite: [],
  4333. GrantRead: [],
  4334. GrantReadAcp: [],
  4335. GrantWriteAcp: [],
  4336. ACL: ""
  4337. },
  4338. n = {
  4339. FULL_CONTROL: "GrantFullControl",
  4340. WRITE: "GrantWrite",
  4341. READ: "GrantRead",
  4342. READ_ACP: "GrantReadAcp",
  4343. WRITE_ACP: "GrantWriteAcp"
  4344. },
  4345. i = e && e.AccessControlList || {},
  4346. a = i.Grant;
  4347. a && (a = _e.isArray(a) ? a : [a]);
  4348. var o = {
  4349. READ: 0,
  4350. WRITE: 0,
  4351. FULL_CONTROL: 0
  4352. };
  4353. return a && a.length && _e.each(a, function (i) {
  4354. "qcs::cam::anyone:anyone" === i.Grantee.ID || "http://cam.qcloud.com/groups/global/AllUsers" === i.Grantee.URI ? o[i.Permission] = 1 : i.Grantee.ID !== e.Owner.ID && t[n[i.Permission]].push('id="' + i.Grantee.ID + '"');
  4355. }), o.FULL_CONTROL || o.WRITE && o.READ ? t.ACL = "public-read-write" : o.READ ? t.ACL = "public-read" : t.ACL = "private", _e.each(n, function (e) {
  4356. t[e] = xe(t[e].join(","));
  4357. }), t;
  4358. }
  4359. function xe(e) {
  4360. var t,
  4361. n,
  4362. i = e.split(","),
  4363. a = {};
  4364. for (t = 0; t < i.length;) n = i[t].trim(), a[n] ? i.splice(t, 1) : (a[n] = !0, i[t] = n, t++);
  4365. return i.join(",");
  4366. }
  4367. function ye(e) {
  4368. var t = e.bucket,
  4369. n = t.substr(0, t.lastIndexOf("-")),
  4370. i = t.substr(t.lastIndexOf("-") + 1),
  4371. a = e.domain,
  4372. o = e.region,
  4373. r = e.object;
  4374. a || (a = ["cn-south", "cn-south-2", "cn-north", "cn-east", "cn-southwest", "sg"].indexOf(o) > -1 ? "{Region}.myqcloud.com" : "cos.{Region}.myqcloud.com", e.ForcePathStyle || (a = "{Bucket}." + a)), a = a.replace(/\{\{AppId\}\}/gi, i).replace(/\{\{Bucket\}\}/gi, n).replace(/\{\{Region\}\}/gi, o).replace(/\{\{.*?\}\}/gi, ""), a = a.replace(/\{AppId\}/gi, i).replace(/\{BucketName\}/gi, n).replace(/\{Bucket\}/gi, t).replace(/\{Region\}/gi, o).replace(/\{.*?\}/gi, ""), /^[a-zA-Z]+:\/\//.test(a) || (a = "https://" + a), "/" === a.slice(-1) && (a = a.slice(0, -1));
  4375. var s = a;
  4376. return e.ForcePathStyle && (s += "/" + t), s += "/", r && (s += _e.camSafeUrlEncode(r).replace(/%2F/g, "/")), e.isLocation && (s = s.replace(/^https?:\/\//, "")), s;
  4377. }
  4378. function Ce(e, t) {
  4379. var n = _e.clone(e.Headers);
  4380. delete n["Content-Type"], delete n["Cache-Control"], _e.each(n, function (e, t) {
  4381. "" === e && delete n[t];
  4382. });
  4383. var i = function (e) {
  4384. var n = !1,
  4385. i = e.Authorization;
  4386. if (i) if (i.indexOf(" ") > -1) n = !1;else if (i.indexOf("q-sign-algorithm=") > -1 && i.indexOf("q-ak=") > -1 && i.indexOf("q-sign-time=") > -1 && i.indexOf("q-key-time=") > -1 && i.indexOf("q-url-param-list=") > -1) n = !0;else try {
  4387. i = we.atob(i), i.indexOf("a=") > -1 && i.indexOf("k=") > -1 && i.indexOf("t=") > -1 && i.indexOf("r=") > -1 && i.indexOf("b=") > -1 && (n = !0);
  4388. } catch (e) {}
  4389. n ? t && t(null, e) : t && t("authorization error");
  4390. },
  4391. a = this,
  4392. o = e.Bucket || "",
  4393. r = e.Region || "",
  4394. s = "name/cos:PostObject" !== e.Action && e.Key ? e.Key : "";
  4395. a.options.ForcePathStyle && o && (s = o + "/" + s);
  4396. var c = "/" + s,
  4397. l = {},
  4398. p = e.Scope;
  4399. if (!p) {
  4400. var u = e.Action || "",
  4401. d = e.ResourceKey || e.Key || "";
  4402. p = e.Scope || [{
  4403. action: u,
  4404. bucket: o,
  4405. region: r,
  4406. prefix: d
  4407. }];
  4408. }
  4409. var m = _e.md5(JSON.stringify(p));
  4410. a._StsCache = a._StsCache || [], function () {
  4411. var e, t;
  4412. for (e = a._StsCache.length - 1; e >= 0; e--) {
  4413. t = a._StsCache[e];
  4414. var n = Math.round(_e.getSkewTime(a.options.SystemClockOffset) / 1e3) + 30;
  4415. if (t.StartTime && n < t.StartTime || n >= t.ExpiredTime) a._StsCache.splice(e, 1);else if (!t.ScopeLimit || t.ScopeLimit && t.ScopeKey === m) {
  4416. l = t;
  4417. break;
  4418. }
  4419. }
  4420. }();
  4421. var f = function () {
  4422. var t = l.StartTime && l.ExpiredTime ? l.StartTime + ";" + l.ExpiredTime : "",
  4423. o = _e.getAuth({
  4424. SecretId: l.TmpSecretId,
  4425. SecretKey: l.TmpSecretKey,
  4426. Method: e.Method,
  4427. Pathname: c,
  4428. Query: e.Query,
  4429. Headers: n,
  4430. Expires: e.Expires,
  4431. SystemClockOffset: a.options.SystemClockOffset,
  4432. KeyTime: t
  4433. }),
  4434. r = {
  4435. Authorization: o,
  4436. XCosSecurityToken: l.XCosSecurityToken || "",
  4437. Token: l.Token || "",
  4438. ClientIP: l.ClientIP || "",
  4439. ClientUA: l.ClientUA || ""
  4440. };
  4441. i(r);
  4442. };
  4443. if (l.ExpiredTime && l.ExpiredTime - _e.getSkewTime(a.options.SystemClockOffset) / 1e3 > 60) f();else if (a.options.getAuthorization) a.options.getAuthorization.call(a, {
  4444. Bucket: o,
  4445. Region: r,
  4446. Method: e.Method,
  4447. Key: s,
  4448. Pathname: c,
  4449. Query: e.Query,
  4450. Headers: n,
  4451. Scope: p,
  4452. SystemClockOffset: a.options.SystemClockOffset
  4453. }, function (e) {
  4454. "string" == typeof e && (e = {
  4455. Authorization: e
  4456. }), e.TmpSecretId && e.TmpSecretKey && e.XCosSecurityToken && e.ExpiredTime ? (l = e || {}, l.Scope = p, l.ScopeKey = m, a._StsCache.push(l), f()) : i(e);
  4457. });else {
  4458. if (!a.options.getSTS) return function () {
  4459. var t = _e.getAuth({
  4460. SecretId: e.SecretId || a.options.SecretId,
  4461. SecretKey: e.SecretKey || a.options.SecretKey,
  4462. Method: e.Method,
  4463. Pathname: c,
  4464. Query: e.Query,
  4465. Headers: n,
  4466. Expires: e.Expires,
  4467. SystemClockOffset: a.options.SystemClockOffset
  4468. }),
  4469. o = {
  4470. Authorization: t,
  4471. XCosSecurityToken: a.options.XCosSecurityToken
  4472. };
  4473. return i(o), o;
  4474. }();
  4475. a.options.getSTS.call(a, {
  4476. Bucket: o,
  4477. Region: r
  4478. }, function (e) {
  4479. l = e || {}, l.Scope = p, l.ScopeKey = m, l.TmpSecretId = l.SecretId, l.TmpSecretKey = l.SecretKey, a._StsCache.push(l), f();
  4480. });
  4481. }
  4482. return "";
  4483. }
  4484. function ke(e) {
  4485. var t = !1,
  4486. n = !1,
  4487. i = e.headers && (e.headers.date || e.headers.Date) || e.error && e.error.ServerTime;
  4488. try {
  4489. var a = e.error.Code,
  4490. o = e.error.Message;
  4491. ("RequestTimeTooSkewed" === a || "AccessDenied" === a && "Request has expired" === o) && (n = !0);
  4492. } catch (e) {}
  4493. if (e) if (n && i) {
  4494. var r = Date.parse(i);
  4495. this.options.CorrectClockSkew && Math.abs(_e.getSkewTime(this.options.SystemClockOffset) - r) >= 3e4 && (console.error("error: Local time is too skewed."), this.options.SystemClockOffset = r - Date.now(), t = !0);
  4496. } else 5 === Math.floor(e.statusCode / 100) && (t = !0);
  4497. return t;
  4498. }
  4499. function be(e, t) {
  4500. var n = this;
  4501. !e.headers && (e.headers = {}), !e.qs && (e.qs = {}), e.VersionId && (e.qs.versionId = e.VersionId), e.qs = _e.clearKey(e.qs), e.headers && (e.headers = _e.clearKey(e.headers)), e.qs && (e.qs = _e.clearKey(e.qs));
  4502. var i = _e.clone(e.qs);
  4503. e.action && (i[e.action] = "");
  4504. var a = function (o) {
  4505. var r = n.options.SystemClockOffset;
  4506. Ce.call(n, {
  4507. Bucket: e.Bucket || "",
  4508. Region: e.Region || "",
  4509. Method: e.method,
  4510. Key: e.Key,
  4511. Query: i,
  4512. Headers: e.headers,
  4513. Action: e.Action,
  4514. ResourceKey: e.ResourceKey,
  4515. Scope: e.Scope
  4516. }, function (i, s) {
  4517. if (i) return void t(i);
  4518. e.AuthData = s, Se.call(n, e, function (i, s) {
  4519. i && o < 2 && (r !== n.options.SystemClockOffset || ke.call(n, i)) ? (e.headers && (delete e.headers.Authorization, delete e.headers.token, delete e.headers.clientIP, delete e.headers.clientUA, delete e.headers["x-cos-security-token"]), a(o + 1)) : t(i, s);
  4520. });
  4521. });
  4522. };
  4523. a(1);
  4524. }
  4525. function Se(e, t) {
  4526. var n = this,
  4527. i = e.TaskId;
  4528. if (!i || n._isRunningTask(i)) {
  4529. var a = e.Bucket,
  4530. o = e.Region,
  4531. r = e.Key,
  4532. s = e.method || "GET",
  4533. c = e.url,
  4534. l = e.body,
  4535. p = e.json,
  4536. u = e.rawBody;
  4537. c = c || ye({
  4538. ForcePathStyle: n.options.ForcePathStyle,
  4539. protocol: n.options.Protocol,
  4540. domain: n.options.Domain,
  4541. bucket: a,
  4542. region: o,
  4543. object: r
  4544. }), e.action && (c = c + "?" + e.action);
  4545. var d = {
  4546. method: s,
  4547. url: c,
  4548. headers: e.headers,
  4549. qs: e.qs,
  4550. filePath: e.filePath,
  4551. body: l,
  4552. json: p
  4553. };
  4554. d.headers.Authorization = e.AuthData.Authorization, e.AuthData.Token && (d.headers.token = e.AuthData.Token), e.AuthData.ClientIP && (d.headers.clientIP = e.AuthData.ClientIP), e.AuthData.ClientUA && (d.headers.clientUA = e.AuthData.ClientUA), e.AuthData.XCosSecurityToken && (d.headers["x-cos-security-token"] = e.AuthData.XCosSecurityToken), d.headers && (d.headers = _e.clearKey(d.headers)), d = _e.clearKey(d), e.onProgress && "function" == typeof e.onProgress && (d.onProgress = function (t) {
  4555. if (!i || n._isRunningTask(i)) {
  4556. var a = t ? t.loaded : 0;
  4557. e.onProgress({
  4558. loaded: a,
  4559. total: t.total
  4560. });
  4561. }
  4562. }), this.options.Timeout && (d.timeout = this.options.Timeout), n.options.ForcePathStyle && (d.pathStyle = n.options.ForcePathStyle), n.emit("before-send", d);
  4563. var m = Re(d, function (e, a, o) {
  4564. if ("abort" !== e) {
  4565. var r,
  4566. s = function (e, o) {
  4567. if (i && n.off("inner-kill-task", f), !r) {
  4568. r = !0;
  4569. var s = {};
  4570. a && a.statusCode && (s.statusCode = a.statusCode), a && a.headers && (s.headers = a.headers), e ? (e = _e.extend(e || {}, s), t(e, null)) : (o = _e.extend(o || {}, s), t(null, o)), m = null;
  4571. }
  4572. };
  4573. if (e) return void s({
  4574. error: e
  4575. });
  4576. var c;
  4577. if (u) c = {}, c.body = o;else try {
  4578. c = o && o.indexOf("<") > -1 && o.indexOf(">") > -1 && _e.xml2json(o) || {};
  4579. } catch (e) {
  4580. c = o || {};
  4581. }
  4582. var l = a.statusCode;
  4583. return 2 === Math.floor(l / 100) ? c.Error ? void s({
  4584. error: c.Error
  4585. }) : void s(null, c) : void s({
  4586. error: c.Error || c
  4587. });
  4588. }
  4589. }),
  4590. f = function (e) {
  4591. e.TaskId === i && (m && m.abort && m.abort(), n.off("inner-kill-task", f));
  4592. };
  4593. i && n.on("inner-kill-task", f);
  4594. }
  4595. }
  4596. var Re = n(18),
  4597. we = n(3),
  4598. _e = n(0),
  4599. Ae = n(19),
  4600. Te = {
  4601. getService: i,
  4602. putBucket: a,
  4603. headBucket: o,
  4604. getBucket: r,
  4605. deleteBucket: s,
  4606. putBucketAcl: c,
  4607. getBucketAcl: l,
  4608. putBucketCors: p,
  4609. getBucketCors: u,
  4610. deleteBucketCors: d,
  4611. getBucketLocation: m,
  4612. getBucketPolicy: h,
  4613. putBucketPolicy: f,
  4614. deleteBucketPolicy: g,
  4615. putBucketTagging: v,
  4616. getBucketTagging: x,
  4617. deleteBucketTagging: y,
  4618. putBucketLifecycle: C,
  4619. getBucketLifecycle: k,
  4620. deleteBucketLifecycle: b,
  4621. putBucketVersioning: S,
  4622. getBucketVersioning: R,
  4623. putBucketReplication: w,
  4624. getBucketReplication: _,
  4625. deleteBucketReplication: A,
  4626. putBucketWebsite: T,
  4627. getBucketWebsite: E,
  4628. deleteBucketWebsite: B,
  4629. putBucketReferer: O,
  4630. getBucketReferer: D,
  4631. putBucketDomain: N,
  4632. getBucketDomain: I,
  4633. deleteBucketDomain: P,
  4634. putBucketOrigin: j,
  4635. getBucketOrigin: M,
  4636. deleteBucketOrigin: U,
  4637. putBucketLogging: F,
  4638. getBucketLogging: H,
  4639. putBucketInventory: L,
  4640. getBucketInventory: z,
  4641. listBucketInventory: K,
  4642. deleteBucketInventory: q,
  4643. putBucketAccelerate: G,
  4644. getBucketAccelerate: V,
  4645. getObject: $,
  4646. headObject: X,
  4647. listObjectVersions: W,
  4648. putObject: Q,
  4649. postObject: J,
  4650. deleteObject: Y,
  4651. getObjectAcl: Z,
  4652. putObjectAcl: ee,
  4653. optionsObject: te,
  4654. putObjectCopy: ne,
  4655. deleteMultipleObject: ae,
  4656. restoreObject: oe,
  4657. putObjectTagging: re,
  4658. getObjectTagging: se,
  4659. deleteObjectTagging: ce,
  4660. uploadPartCopy: ie,
  4661. multipartInit: le,
  4662. multipartUpload: pe,
  4663. multipartComplete: ue,
  4664. multipartList: de,
  4665. multipartListPart: me,
  4666. multipartAbort: fe,
  4667. getObjectUrl: ge,
  4668. getAuth: he
  4669. };
  4670. e.exports.init = function (e, t) {
  4671. t.transferToTaskMethod(Te, "postObject"), t.transferToTaskMethod(Te, "putObject"), _e.each(Te, function (t, n) {
  4672. e.prototype[n] = _e.apiWrapper(n, t);
  4673. });
  4674. };
  4675. }, function (e, t) {
  4676. var n = function (e) {
  4677. var t,
  4678. n,
  4679. i,
  4680. a = [],
  4681. o = Object.keys(e);
  4682. for (t = 0; t < o.length; t++) n = o[t], i = e[n] || "", a.push(n + "=" + encodeURIComponent(i));
  4683. return a.join("&");
  4684. },
  4685. i = function (e, t) {
  4686. var i,
  4687. a = e.filePath,
  4688. o = e.headers || {},
  4689. r = e.url,
  4690. s = e.method,
  4691. c = e.onProgress,
  4692. l = function (e, n) {
  4693. var i = n.header,
  4694. a = {};
  4695. if (i) for (var o in i) i.hasOwnProperty(o) && (a[o.toLowerCase()] = i[o]);
  4696. t(e, {
  4697. statusCode: n.statusCode,
  4698. headers: a
  4699. }, n.data);
  4700. };
  4701. if (a) {
  4702. var p,
  4703. u = r.match(/^(https?:\/\/[^\/]+\/)([^\/]*\/?)(.*)$/);
  4704. e.pathStyle ? (p = decodeURIComponent(u[3] || ""), r = u[1] + u[2]) : (p = decodeURIComponent(u[2] + u[3] || ""), r = u[1]);
  4705. var d = {
  4706. key: p,
  4707. success_action_status: 200,
  4708. Signature: o.Authorization
  4709. },
  4710. m = ["Cache-Control", "Content-Type", "Content-Disposition", "Content-Encoding", "Expires", "x-cos-storage-class", "x-cos-security-token"];
  4711. for (var f in e.headers) e.headers.hasOwnProperty(f) && (f.indexOf("x-cos-meta-") > -1 || m.indexOf(f) > -1) && (d[f] = e.headers[f]);
  4712. o["x-cos-acl"] && (d.acl = o["x-cos-acl"]), !d["Content-Type"] && (d["Content-Type"] = ""), i = uni.uploadFile({
  4713. url: r,
  4714. method: s,
  4715. name: "file",
  4716. header: o,
  4717. filePath: a,
  4718. formData: d,
  4719. timeout: e.timeout,
  4720. success: function (e) {
  4721. l(null, e);
  4722. },
  4723. fail: function (e) {
  4724. l(e.errMsg, e);
  4725. }
  4726. }), i.onProgressUpdate(function (e) {
  4727. c && c({
  4728. loaded: e.totalBytesSent,
  4729. total: e.totalBytesExpectedToSend,
  4730. progress: e.progress / 100
  4731. });
  4732. });
  4733. } else {
  4734. var h = e.qs && n(e.qs) || "";
  4735. h && (r += (r.indexOf("?") > -1 ? "&" : "?") + h), o["Content-Length"] && delete o["Content-Length"], i = uni.request({
  4736. url: r,
  4737. method: s,
  4738. header: o,
  4739. dataType: "text",
  4740. data: e.body,
  4741. timeout: e.timeout,
  4742. success: function (e) {
  4743. l(null, e);
  4744. },
  4745. fail: function (e) {
  4746. l(e.errMsg, e);
  4747. }
  4748. });
  4749. }
  4750. return i;
  4751. };
  4752. e.exports = i;
  4753. }, function (e, t, n) {
  4754. var i = n(20);
  4755. e.exports = new i(n(21), n(22));
  4756. }, function (e, t, n) {
  4757. function i() {
  4758. this._types = Object.create(null), this._extensions = Object.create(null);
  4759. for (var e = 0; e < arguments.length; e++) this.define(arguments[e]);
  4760. this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
  4761. }
  4762. i.prototype.define = function (e, t) {
  4763. for (var n in e) {
  4764. var i = e[n].map(function (e) {
  4765. return e.toLowerCase();
  4766. });
  4767. n = n.toLowerCase();
  4768. for (var a = 0; a < i.length; a++) {
  4769. var o = i[a];
  4770. if ("*" != o[0]) {
  4771. if (!t && o in this._types) throw new Error('Attempt to change mapping for "' + o + '" extension from "' + this._types[o] + '" to "' + n + '". Pass `force=true` to allow this, otherwise remove "' + o + '" from the list of extensions for "' + n + '".');
  4772. this._types[o] = n;
  4773. }
  4774. }
  4775. if (t || !this._extensions[n]) {
  4776. var o = i[0];
  4777. this._extensions[n] = "*" != o[0] ? o : o.substr(1);
  4778. }
  4779. }
  4780. }, i.prototype.getType = function (e) {
  4781. e = String(e);
  4782. var t = e.replace(/^.*[\/\\]/, "").toLowerCase(),
  4783. n = t.replace(/^.*\./, "").toLowerCase(),
  4784. i = t.length < e.length;
  4785. return (n.length < t.length - 1 || !i) && this._types[n] || null;
  4786. }, i.prototype.getExtension = function (e) {
  4787. return (e = /^\s*([^;\s]*)/.test(e) && RegExp.$1) && this._extensions[e.toLowerCase()] || null;
  4788. }, e.exports = i;
  4789. }, function (e, t) {
  4790. e.exports = {
  4791. "application/andrew-inset": ["ez"],
  4792. "application/applixware": ["aw"],
  4793. "application/atom+xml": ["atom"],
  4794. "application/atomcat+xml": ["atomcat"],
  4795. "application/atomdeleted+xml": ["atomdeleted"],
  4796. "application/atomsvc+xml": ["atomsvc"],
  4797. "application/atsc-dwd+xml": ["dwd"],
  4798. "application/atsc-held+xml": ["held"],
  4799. "application/atsc-rsat+xml": ["rsat"],
  4800. "application/bdoc": ["bdoc"],
  4801. "application/calendar+xml": ["xcs"],
  4802. "application/ccxml+xml": ["ccxml"],
  4803. "application/cdfx+xml": ["cdfx"],
  4804. "application/cdmi-capability": ["cdmia"],
  4805. "application/cdmi-container": ["cdmic"],
  4806. "application/cdmi-domain": ["cdmid"],
  4807. "application/cdmi-object": ["cdmio"],
  4808. "application/cdmi-queue": ["cdmiq"],
  4809. "application/cu-seeme": ["cu"],
  4810. "application/dash+xml": ["mpd"],
  4811. "application/davmount+xml": ["davmount"],
  4812. "application/docbook+xml": ["dbk"],
  4813. "application/dssc+der": ["dssc"],
  4814. "application/dssc+xml": ["xdssc"],
  4815. "application/ecmascript": ["ecma", "es"],
  4816. "application/emma+xml": ["emma"],
  4817. "application/emotionml+xml": ["emotionml"],
  4818. "application/epub+zip": ["epub"],
  4819. "application/exi": ["exi"],
  4820. "application/fdt+xml": ["fdt"],
  4821. "application/font-tdpfr": ["pfr"],
  4822. "application/geo+json": ["geojson"],
  4823. "application/gml+xml": ["gml"],
  4824. "application/gpx+xml": ["gpx"],
  4825. "application/gxf": ["gxf"],
  4826. "application/gzip": ["gz"],
  4827. "application/hjson": ["hjson"],
  4828. "application/hyperstudio": ["stk"],
  4829. "application/inkml+xml": ["ink", "inkml"],
  4830. "application/ipfix": ["ipfix"],
  4831. "application/its+xml": ["its"],
  4832. "application/java-archive": ["jar", "war", "ear"],
  4833. "application/java-serialized-object": ["ser"],
  4834. "application/java-vm": ["class"],
  4835. "application/javascript": ["js", "mjs"],
  4836. "application/json": ["json", "map"],
  4837. "application/json5": ["json5"],
  4838. "application/jsonml+json": ["jsonml"],
  4839. "application/ld+json": ["jsonld"],
  4840. "application/lgr+xml": ["lgr"],
  4841. "application/lost+xml": ["lostxml"],
  4842. "application/mac-binhex40": ["hqx"],
  4843. "application/mac-compactpro": ["cpt"],
  4844. "application/mads+xml": ["mads"],
  4845. "application/manifest+json": ["webmanifest"],
  4846. "application/marc": ["mrc"],
  4847. "application/marcxml+xml": ["mrcx"],
  4848. "application/mathematica": ["ma", "nb", "mb"],
  4849. "application/mathml+xml": ["mathml"],
  4850. "application/mbox": ["mbox"],
  4851. "application/mediaservercontrol+xml": ["mscml"],
  4852. "application/metalink+xml": ["metalink"],
  4853. "application/metalink4+xml": ["meta4"],
  4854. "application/mets+xml": ["mets"],
  4855. "application/mmt-aei+xml": ["maei"],
  4856. "application/mmt-usd+xml": ["musd"],
  4857. "application/mods+xml": ["mods"],
  4858. "application/mp21": ["m21", "mp21"],
  4859. "application/mp4": ["mp4s", "m4p"],
  4860. "application/mrb-consumer+xml": ["*xdf"],
  4861. "application/mrb-publish+xml": ["*xdf"],
  4862. "application/msword": ["doc", "dot"],
  4863. "application/mxf": ["mxf"],
  4864. "application/n-quads": ["nq"],
  4865. "application/n-triples": ["nt"],
  4866. "application/node": ["cjs"],
  4867. "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"],
  4868. "application/oda": ["oda"],
  4869. "application/oebps-package+xml": ["opf"],
  4870. "application/ogg": ["ogx"],
  4871. "application/omdoc+xml": ["omdoc"],
  4872. "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"],
  4873. "application/oxps": ["oxps"],
  4874. "application/p2p-overlay+xml": ["relo"],
  4875. "application/patch-ops-error+xml": ["*xer"],
  4876. "application/pdf": ["pdf"],
  4877. "application/pgp-encrypted": ["pgp"],
  4878. "application/pgp-signature": ["asc", "sig"],
  4879. "application/pics-rules": ["prf"],
  4880. "application/pkcs10": ["p10"],
  4881. "application/pkcs7-mime": ["p7m", "p7c"],
  4882. "application/pkcs7-signature": ["p7s"],
  4883. "application/pkcs8": ["p8"],
  4884. "application/pkix-attr-cert": ["ac"],
  4885. "application/pkix-cert": ["cer"],
  4886. "application/pkix-crl": ["crl"],
  4887. "application/pkix-pkipath": ["pkipath"],
  4888. "application/pkixcmp": ["pki"],
  4889. "application/pls+xml": ["pls"],
  4890. "application/postscript": ["ai", "eps", "ps"],
  4891. "application/provenance+xml": ["provx"],
  4892. "application/pskc+xml": ["pskcxml"],
  4893. "application/raml+yaml": ["raml"],
  4894. "application/rdf+xml": ["rdf", "owl"],
  4895. "application/reginfo+xml": ["rif"],
  4896. "application/relax-ng-compact-syntax": ["rnc"],
  4897. "application/resource-lists+xml": ["rl"],
  4898. "application/resource-lists-diff+xml": ["rld"],
  4899. "application/rls-services+xml": ["rs"],
  4900. "application/route-apd+xml": ["rapd"],
  4901. "application/route-s-tsid+xml": ["sls"],
  4902. "application/route-usd+xml": ["rusd"],
  4903. "application/rpki-ghostbusters": ["gbr"],
  4904. "application/rpki-manifest": ["mft"],
  4905. "application/rpki-roa": ["roa"],
  4906. "application/rsd+xml": ["rsd"],
  4907. "application/rss+xml": ["rss"],
  4908. "application/rtf": ["rtf"],
  4909. "application/sbml+xml": ["sbml"],
  4910. "application/scvp-cv-request": ["scq"],
  4911. "application/scvp-cv-response": ["scs"],
  4912. "application/scvp-vp-request": ["spq"],
  4913. "application/scvp-vp-response": ["spp"],
  4914. "application/sdp": ["sdp"],
  4915. "application/senml+xml": ["senmlx"],
  4916. "application/sensml+xml": ["sensmlx"],
  4917. "application/set-payment-initiation": ["setpay"],
  4918. "application/set-registration-initiation": ["setreg"],
  4919. "application/shf+xml": ["shf"],
  4920. "application/sieve": ["siv", "sieve"],
  4921. "application/smil+xml": ["smi", "smil"],
  4922. "application/sparql-query": ["rq"],
  4923. "application/sparql-results+xml": ["srx"],
  4924. "application/srgs": ["gram"],
  4925. "application/srgs+xml": ["grxml"],
  4926. "application/sru+xml": ["sru"],
  4927. "application/ssdl+xml": ["ssdl"],
  4928. "application/ssml+xml": ["ssml"],
  4929. "application/swid+xml": ["swidtag"],
  4930. "application/tei+xml": ["tei", "teicorpus"],
  4931. "application/thraud+xml": ["tfi"],
  4932. "application/timestamped-data": ["tsd"],
  4933. "application/toml": ["toml"],
  4934. "application/ttml+xml": ["ttml"],
  4935. "application/urc-ressheet+xml": ["rsheet"],
  4936. "application/voicexml+xml": ["vxml"],
  4937. "application/wasm": ["wasm"],
  4938. "application/widget": ["wgt"],
  4939. "application/winhlp": ["hlp"],
  4940. "application/wsdl+xml": ["wsdl"],
  4941. "application/wspolicy+xml": ["wspolicy"],
  4942. "application/xaml+xml": ["xaml"],
  4943. "application/xcap-att+xml": ["xav"],
  4944. "application/xcap-caps+xml": ["xca"],
  4945. "application/xcap-diff+xml": ["xdf"],
  4946. "application/xcap-el+xml": ["xel"],
  4947. "application/xcap-error+xml": ["xer"],
  4948. "application/xcap-ns+xml": ["xns"],
  4949. "application/xenc+xml": ["xenc"],
  4950. "application/xhtml+xml": ["xhtml", "xht"],
  4951. "application/xliff+xml": ["xlf"],
  4952. "application/xml": ["xml", "xsl", "xsd", "rng"],
  4953. "application/xml-dtd": ["dtd"],
  4954. "application/xop+xml": ["xop"],
  4955. "application/xproc+xml": ["xpl"],
  4956. "application/xslt+xml": ["xslt"],
  4957. "application/xspf+xml": ["xspf"],
  4958. "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
  4959. "application/yang": ["yang"],
  4960. "application/yin+xml": ["yin"],
  4961. "application/zip": ["zip"],
  4962. "audio/3gpp": ["*3gpp"],
  4963. "audio/adpcm": ["adp"],
  4964. "audio/basic": ["au", "snd"],
  4965. "audio/midi": ["mid", "midi", "kar", "rmi"],
  4966. "audio/mobile-xmf": ["mxmf"],
  4967. "audio/mp3": ["*mp3"],
  4968. "audio/mp4": ["m4a", "mp4a"],
  4969. "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
  4970. "audio/ogg": ["oga", "ogg", "spx"],
  4971. "audio/s3m": ["s3m"],
  4972. "audio/silk": ["sil"],
  4973. "audio/wav": ["wav"],
  4974. "audio/wave": ["*wav"],
  4975. "audio/webm": ["weba"],
  4976. "audio/xm": ["xm"],
  4977. "font/collection": ["ttc"],
  4978. "font/otf": ["otf"],
  4979. "font/ttf": ["ttf"],
  4980. "font/woff": ["woff"],
  4981. "font/woff2": ["woff2"],
  4982. "image/aces": ["exr"],
  4983. "image/apng": ["apng"],
  4984. "image/bmp": ["bmp"],
  4985. "image/cgm": ["cgm"],
  4986. "image/dicom-rle": ["drle"],
  4987. "image/emf": ["emf"],
  4988. "image/fits": ["fits"],
  4989. "image/g3fax": ["g3"],
  4990. "image/gif": ["gif"],
  4991. "image/heic": ["heic"],
  4992. "image/heic-sequence": ["heics"],
  4993. "image/heif": ["heif"],
  4994. "image/heif-sequence": ["heifs"],
  4995. "image/hej2k": ["hej2"],
  4996. "image/hsj2": ["hsj2"],
  4997. "image/ief": ["ief"],
  4998. "image/jls": ["jls"],
  4999. "image/jp2": ["jp2", "jpg2"],
  5000. "image/jpeg": ["jpeg", "jpg", "jpe"],
  5001. "image/jph": ["jph"],
  5002. "image/jphc": ["jhc"],
  5003. "image/jpm": ["jpm"],
  5004. "image/jpx": ["jpx", "jpf"],
  5005. "image/jxr": ["jxr"],
  5006. "image/jxra": ["jxra"],
  5007. "image/jxrs": ["jxrs"],
  5008. "image/jxs": ["jxs"],
  5009. "image/jxsc": ["jxsc"],
  5010. "image/jxsi": ["jxsi"],
  5011. "image/jxss": ["jxss"],
  5012. "image/ktx": ["ktx"],
  5013. "image/png": ["png"],
  5014. "image/sgi": ["sgi"],
  5015. "image/svg+xml": ["svg", "svgz"],
  5016. "image/t38": ["t38"],
  5017. "image/tiff": ["tif", "tiff"],
  5018. "image/tiff-fx": ["tfx"],
  5019. "image/webp": ["webp"],
  5020. "image/wmf": ["wmf"],
  5021. "message/disposition-notification": ["disposition-notification"],
  5022. "message/global": ["u8msg"],
  5023. "message/global-delivery-status": ["u8dsn"],
  5024. "message/global-disposition-notification": ["u8mdn"],
  5025. "message/global-headers": ["u8hdr"],
  5026. "message/rfc822": ["eml", "mime"],
  5027. "model/3mf": ["3mf"],
  5028. "model/gltf+json": ["gltf"],
  5029. "model/gltf-binary": ["glb"],
  5030. "model/iges": ["igs", "iges"],
  5031. "model/mesh": ["msh", "mesh", "silo"],
  5032. "model/mtl": ["mtl"],
  5033. "model/obj": ["obj"],
  5034. "model/stl": ["stl"],
  5035. "model/vrml": ["wrl", "vrml"],
  5036. "model/x3d+binary": ["*x3db", "x3dbz"],
  5037. "model/x3d+fastinfoset": ["x3db"],
  5038. "model/x3d+vrml": ["*x3dv", "x3dvz"],
  5039. "model/x3d+xml": ["x3d", "x3dz"],
  5040. "model/x3d-vrml": ["x3dv"],
  5041. "text/cache-manifest": ["appcache", "manifest"],
  5042. "text/calendar": ["ics", "ifb"],
  5043. "text/coffeescript": ["coffee", "litcoffee"],
  5044. "text/css": ["css"],
  5045. "text/csv": ["csv"],
  5046. "text/html": ["html", "htm", "shtml"],
  5047. "text/jade": ["jade"],
  5048. "text/jsx": ["jsx"],
  5049. "text/less": ["less"],
  5050. "text/markdown": ["markdown", "md"],
  5051. "text/mathml": ["mml"],
  5052. "text/mdx": ["mdx"],
  5053. "text/n3": ["n3"],
  5054. "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
  5055. "text/richtext": ["rtx"],
  5056. "text/rtf": ["*rtf"],
  5057. "text/sgml": ["sgml", "sgm"],
  5058. "text/shex": ["shex"],
  5059. "text/slim": ["slim", "slm"],
  5060. "text/stylus": ["stylus", "styl"],
  5061. "text/tab-separated-values": ["tsv"],
  5062. "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
  5063. "text/turtle": ["ttl"],
  5064. "text/uri-list": ["uri", "uris", "urls"],
  5065. "text/vcard": ["vcard"],
  5066. "text/vtt": ["vtt"],
  5067. "text/xml": ["*xml"],
  5068. "text/yaml": ["yaml", "yml"],
  5069. "video/3gpp": ["3gp", "3gpp"],
  5070. "video/3gpp2": ["3g2"],
  5071. "video/h261": ["h261"],
  5072. "video/h263": ["h263"],
  5073. "video/h264": ["h264"],
  5074. "video/jpeg": ["jpgv"],
  5075. "video/jpm": ["*jpm", "jpgm"],
  5076. "video/mj2": ["mj2", "mjp2"],
  5077. "video/mp2t": ["ts"],
  5078. "video/mp4": ["mp4", "mp4v", "mpg4"],
  5079. "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
  5080. "video/ogg": ["ogv"],
  5081. "video/quicktime": ["qt", "mov"],
  5082. "video/webm": ["webm"]
  5083. };
  5084. }, function (e, t) {
  5085. e.exports = {
  5086. "application/prs.cww": ["cww"],
  5087. "application/vnd.1000minds.decision-model+xml": ["1km"],
  5088. "application/vnd.3gpp.pic-bw-large": ["plb"],
  5089. "application/vnd.3gpp.pic-bw-small": ["psb"],
  5090. "application/vnd.3gpp.pic-bw-var": ["pvb"],
  5091. "application/vnd.3gpp2.tcap": ["tcap"],
  5092. "application/vnd.3m.post-it-notes": ["pwn"],
  5093. "application/vnd.accpac.simply.aso": ["aso"],
  5094. "application/vnd.accpac.simply.imp": ["imp"],
  5095. "application/vnd.acucobol": ["acu"],
  5096. "application/vnd.acucorp": ["atc", "acutc"],
  5097. "application/vnd.adobe.air-application-installer-package+zip": ["air"],
  5098. "application/vnd.adobe.formscentral.fcdt": ["fcdt"],
  5099. "application/vnd.adobe.fxp": ["fxp", "fxpl"],
  5100. "application/vnd.adobe.xdp+xml": ["xdp"],
  5101. "application/vnd.adobe.xfdf": ["xfdf"],
  5102. "application/vnd.ahead.space": ["ahead"],
  5103. "application/vnd.airzip.filesecure.azf": ["azf"],
  5104. "application/vnd.airzip.filesecure.azs": ["azs"],
  5105. "application/vnd.amazon.ebook": ["azw"],
  5106. "application/vnd.americandynamics.acc": ["acc"],
  5107. "application/vnd.amiga.ami": ["ami"],
  5108. "application/vnd.android.package-archive": ["apk"],
  5109. "application/vnd.anser-web-certificate-issue-initiation": ["cii"],
  5110. "application/vnd.anser-web-funds-transfer-initiation": ["fti"],
  5111. "application/vnd.antix.game-component": ["atx"],
  5112. "application/vnd.apple.installer+xml": ["mpkg"],
  5113. "application/vnd.apple.keynote": ["keynote"],
  5114. "application/vnd.apple.mpegurl": ["m3u8"],
  5115. "application/vnd.apple.numbers": ["numbers"],
  5116. "application/vnd.apple.pages": ["pages"],
  5117. "application/vnd.apple.pkpass": ["pkpass"],
  5118. "application/vnd.aristanetworks.swi": ["swi"],
  5119. "application/vnd.astraea-software.iota": ["iota"],
  5120. "application/vnd.audiograph": ["aep"],
  5121. "application/vnd.balsamiq.bmml+xml": ["bmml"],
  5122. "application/vnd.blueice.multipass": ["mpm"],
  5123. "application/vnd.bmi": ["bmi"],
  5124. "application/vnd.businessobjects": ["rep"],
  5125. "application/vnd.chemdraw+xml": ["cdxml"],
  5126. "application/vnd.chipnuts.karaoke-mmd": ["mmd"],
  5127. "application/vnd.cinderella": ["cdy"],
  5128. "application/vnd.citationstyles.style+xml": ["csl"],
  5129. "application/vnd.claymore": ["cla"],
  5130. "application/vnd.cloanto.rp9": ["rp9"],
  5131. "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"],
  5132. "application/vnd.cluetrust.cartomobile-config": ["c11amc"],
  5133. "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"],
  5134. "application/vnd.commonspace": ["csp"],
  5135. "application/vnd.contact.cmsg": ["cdbcmsg"],
  5136. "application/vnd.cosmocaller": ["cmc"],
  5137. "application/vnd.crick.clicker": ["clkx"],
  5138. "application/vnd.crick.clicker.keyboard": ["clkk"],
  5139. "application/vnd.crick.clicker.palette": ["clkp"],
  5140. "application/vnd.crick.clicker.template": ["clkt"],
  5141. "application/vnd.crick.clicker.wordbank": ["clkw"],
  5142. "application/vnd.criticaltools.wbs+xml": ["wbs"],
  5143. "application/vnd.ctc-posml": ["pml"],
  5144. "application/vnd.cups-ppd": ["ppd"],
  5145. "application/vnd.curl.car": ["car"],
  5146. "application/vnd.curl.pcurl": ["pcurl"],
  5147. "application/vnd.dart": ["dart"],
  5148. "application/vnd.data-vision.rdz": ["rdz"],
  5149. "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"],
  5150. "application/vnd.dece.ttml+xml": ["uvt", "uvvt"],
  5151. "application/vnd.dece.unspecified": ["uvx", "uvvx"],
  5152. "application/vnd.dece.zip": ["uvz", "uvvz"],
  5153. "application/vnd.denovo.fcselayout-link": ["fe_launch"],
  5154. "application/vnd.dna": ["dna"],
  5155. "application/vnd.dolby.mlp": ["mlp"],
  5156. "application/vnd.dpgraph": ["dpg"],
  5157. "application/vnd.dreamfactory": ["dfac"],
  5158. "application/vnd.ds-keypoint": ["kpxx"],
  5159. "application/vnd.dvb.ait": ["ait"],
  5160. "application/vnd.dvb.service": ["svc"],
  5161. "application/vnd.dynageo": ["geo"],
  5162. "application/vnd.ecowin.chart": ["mag"],
  5163. "application/vnd.enliven": ["nml"],
  5164. "application/vnd.epson.esf": ["esf"],
  5165. "application/vnd.epson.msf": ["msf"],
  5166. "application/vnd.epson.quickanime": ["qam"],
  5167. "application/vnd.epson.salt": ["slt"],
  5168. "application/vnd.epson.ssf": ["ssf"],
  5169. "application/vnd.eszigno3+xml": ["es3", "et3"],
  5170. "application/vnd.ezpix-album": ["ez2"],
  5171. "application/vnd.ezpix-package": ["ez3"],
  5172. "application/vnd.fdf": ["fdf"],
  5173. "application/vnd.fdsn.mseed": ["mseed"],
  5174. "application/vnd.fdsn.seed": ["seed", "dataless"],
  5175. "application/vnd.flographit": ["gph"],
  5176. "application/vnd.fluxtime.clip": ["ftc"],
  5177. "application/vnd.framemaker": ["fm", "frame", "maker", "book"],
  5178. "application/vnd.frogans.fnc": ["fnc"],
  5179. "application/vnd.frogans.ltf": ["ltf"],
  5180. "application/vnd.fsc.weblaunch": ["fsc"],
  5181. "application/vnd.fujitsu.oasys": ["oas"],
  5182. "application/vnd.fujitsu.oasys2": ["oa2"],
  5183. "application/vnd.fujitsu.oasys3": ["oa3"],
  5184. "application/vnd.fujitsu.oasysgp": ["fg5"],
  5185. "application/vnd.fujitsu.oasysprs": ["bh2"],
  5186. "application/vnd.fujixerox.ddd": ["ddd"],
  5187. "application/vnd.fujixerox.docuworks": ["xdw"],
  5188. "application/vnd.fujixerox.docuworks.binder": ["xbd"],
  5189. "application/vnd.fuzzysheet": ["fzs"],
  5190. "application/vnd.genomatix.tuxedo": ["txd"],
  5191. "application/vnd.geogebra.file": ["ggb"],
  5192. "application/vnd.geogebra.tool": ["ggt"],
  5193. "application/vnd.geometry-explorer": ["gex", "gre"],
  5194. "application/vnd.geonext": ["gxt"],
  5195. "application/vnd.geoplan": ["g2w"],
  5196. "application/vnd.geospace": ["g3w"],
  5197. "application/vnd.gmx": ["gmx"],
  5198. "application/vnd.google-apps.document": ["gdoc"],
  5199. "application/vnd.google-apps.presentation": ["gslides"],
  5200. "application/vnd.google-apps.spreadsheet": ["gsheet"],
  5201. "application/vnd.google-earth.kml+xml": ["kml"],
  5202. "application/vnd.google-earth.kmz": ["kmz"],
  5203. "application/vnd.grafeq": ["gqf", "gqs"],
  5204. "application/vnd.groove-account": ["gac"],
  5205. "application/vnd.groove-help": ["ghf"],
  5206. "application/vnd.groove-identity-message": ["gim"],
  5207. "application/vnd.groove-injector": ["grv"],
  5208. "application/vnd.groove-tool-message": ["gtm"],
  5209. "application/vnd.groove-tool-template": ["tpl"],
  5210. "application/vnd.groove-vcard": ["vcg"],
  5211. "application/vnd.hal+xml": ["hal"],
  5212. "application/vnd.handheld-entertainment+xml": ["zmm"],
  5213. "application/vnd.hbci": ["hbci"],
  5214. "application/vnd.hhe.lesson-player": ["les"],
  5215. "application/vnd.hp-hpgl": ["hpgl"],
  5216. "application/vnd.hp-hpid": ["hpid"],
  5217. "application/vnd.hp-hps": ["hps"],
  5218. "application/vnd.hp-jlyt": ["jlt"],
  5219. "application/vnd.hp-pcl": ["pcl"],
  5220. "application/vnd.hp-pclxl": ["pclxl"],
  5221. "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"],
  5222. "application/vnd.ibm.minipay": ["mpy"],
  5223. "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"],
  5224. "application/vnd.ibm.rights-management": ["irm"],
  5225. "application/vnd.ibm.secure-container": ["sc"],
  5226. "application/vnd.iccprofile": ["icc", "icm"],
  5227. "application/vnd.igloader": ["igl"],
  5228. "application/vnd.immervision-ivp": ["ivp"],
  5229. "application/vnd.immervision-ivu": ["ivu"],
  5230. "application/vnd.insors.igm": ["igm"],
  5231. "application/vnd.intercon.formnet": ["xpw", "xpx"],
  5232. "application/vnd.intergeo": ["i2g"],
  5233. "application/vnd.intu.qbo": ["qbo"],
  5234. "application/vnd.intu.qfx": ["qfx"],
  5235. "application/vnd.ipunplugged.rcprofile": ["rcprofile"],
  5236. "application/vnd.irepository.package+xml": ["irp"],
  5237. "application/vnd.is-xpr": ["xpr"],
  5238. "application/vnd.isac.fcs": ["fcs"],
  5239. "application/vnd.jam": ["jam"],
  5240. "application/vnd.jcp.javame.midlet-rms": ["rms"],
  5241. "application/vnd.jisp": ["jisp"],
  5242. "application/vnd.joost.joda-archive": ["joda"],
  5243. "application/vnd.kahootz": ["ktz", "ktr"],
  5244. "application/vnd.kde.karbon": ["karbon"],
  5245. "application/vnd.kde.kchart": ["chrt"],
  5246. "application/vnd.kde.kformula": ["kfo"],
  5247. "application/vnd.kde.kivio": ["flw"],
  5248. "application/vnd.kde.kontour": ["kon"],
  5249. "application/vnd.kde.kpresenter": ["kpr", "kpt"],
  5250. "application/vnd.kde.kspread": ["ksp"],
  5251. "application/vnd.kde.kword": ["kwd", "kwt"],
  5252. "application/vnd.kenameaapp": ["htke"],
  5253. "application/vnd.kidspiration": ["kia"],
  5254. "application/vnd.kinar": ["kne", "knp"],
  5255. "application/vnd.koan": ["skp", "skd", "skt", "skm"],
  5256. "application/vnd.kodak-descriptor": ["sse"],
  5257. "application/vnd.las.las+xml": ["lasxml"],
  5258. "application/vnd.llamagraphics.life-balance.desktop": ["lbd"],
  5259. "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"],
  5260. "application/vnd.lotus-1-2-3": ["123"],
  5261. "application/vnd.lotus-approach": ["apr"],
  5262. "application/vnd.lotus-freelance": ["pre"],
  5263. "application/vnd.lotus-notes": ["nsf"],
  5264. "application/vnd.lotus-organizer": ["org"],
  5265. "application/vnd.lotus-screencam": ["scm"],
  5266. "application/vnd.lotus-wordpro": ["lwp"],
  5267. "application/vnd.macports.portpkg": ["portpkg"],
  5268. "application/vnd.mcd": ["mcd"],
  5269. "application/vnd.medcalcdata": ["mc1"],
  5270. "application/vnd.mediastation.cdkey": ["cdkey"],
  5271. "application/vnd.mfer": ["mwf"],
  5272. "application/vnd.mfmp": ["mfm"],
  5273. "application/vnd.micrografx.flo": ["flo"],
  5274. "application/vnd.micrografx.igx": ["igx"],
  5275. "application/vnd.mif": ["mif"],
  5276. "application/vnd.mobius.daf": ["daf"],
  5277. "application/vnd.mobius.dis": ["dis"],
  5278. "application/vnd.mobius.mbk": ["mbk"],
  5279. "application/vnd.mobius.mqy": ["mqy"],
  5280. "application/vnd.mobius.msl": ["msl"],
  5281. "application/vnd.mobius.plc": ["plc"],
  5282. "application/vnd.mobius.txf": ["txf"],
  5283. "application/vnd.mophun.application": ["mpn"],
  5284. "application/vnd.mophun.certificate": ["mpc"],
  5285. "application/vnd.mozilla.xul+xml": ["xul"],
  5286. "application/vnd.ms-artgalry": ["cil"],
  5287. "application/vnd.ms-cab-compressed": ["cab"],
  5288. "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"],
  5289. "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"],
  5290. "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"],
  5291. "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"],
  5292. "application/vnd.ms-excel.template.macroenabled.12": ["xltm"],
  5293. "application/vnd.ms-fontobject": ["eot"],
  5294. "application/vnd.ms-htmlhelp": ["chm"],
  5295. "application/vnd.ms-ims": ["ims"],
  5296. "application/vnd.ms-lrm": ["lrm"],
  5297. "application/vnd.ms-officetheme": ["thmx"],
  5298. "application/vnd.ms-outlook": ["msg"],
  5299. "application/vnd.ms-pki.seccat": ["cat"],
  5300. "application/vnd.ms-pki.stl": ["*stl"],
  5301. "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"],
  5302. "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"],
  5303. "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"],
  5304. "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"],
  5305. "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"],
  5306. "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"],
  5307. "application/vnd.ms-project": ["mpp", "mpt"],
  5308. "application/vnd.ms-word.document.macroenabled.12": ["docm"],
  5309. "application/vnd.ms-word.template.macroenabled.12": ["dotm"],
  5310. "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"],
  5311. "application/vnd.ms-wpl": ["wpl"],
  5312. "application/vnd.ms-xpsdocument": ["xps"],
  5313. "application/vnd.mseq": ["mseq"],
  5314. "application/vnd.musician": ["mus"],
  5315. "application/vnd.muvee.style": ["msty"],
  5316. "application/vnd.mynfc": ["taglet"],
  5317. "application/vnd.neurolanguage.nlu": ["nlu"],
  5318. "application/vnd.nitf": ["ntf", "nitf"],
  5319. "application/vnd.noblenet-directory": ["nnd"],
  5320. "application/vnd.noblenet-sealer": ["nns"],
  5321. "application/vnd.noblenet-web": ["nnw"],
  5322. "application/vnd.nokia.n-gage.ac+xml": ["*ac"],
  5323. "application/vnd.nokia.n-gage.data": ["ngdat"],
  5324. "application/vnd.nokia.n-gage.symbian.install": ["n-gage"],
  5325. "application/vnd.nokia.radio-preset": ["rpst"],
  5326. "application/vnd.nokia.radio-presets": ["rpss"],
  5327. "application/vnd.novadigm.edm": ["edm"],
  5328. "application/vnd.novadigm.edx": ["edx"],
  5329. "application/vnd.novadigm.ext": ["ext"],
  5330. "application/vnd.oasis.opendocument.chart": ["odc"],
  5331. "application/vnd.oasis.opendocument.chart-template": ["otc"],
  5332. "application/vnd.oasis.opendocument.database": ["odb"],
  5333. "application/vnd.oasis.opendocument.formula": ["odf"],
  5334. "application/vnd.oasis.opendocument.formula-template": ["odft"],
  5335. "application/vnd.oasis.opendocument.graphics": ["odg"],
  5336. "application/vnd.oasis.opendocument.graphics-template": ["otg"],
  5337. "application/vnd.oasis.opendocument.image": ["odi"],
  5338. "application/vnd.oasis.opendocument.image-template": ["oti"],
  5339. "application/vnd.oasis.opendocument.presentation": ["odp"],
  5340. "application/vnd.oasis.opendocument.presentation-template": ["otp"],
  5341. "application/vnd.oasis.opendocument.spreadsheet": ["ods"],
  5342. "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"],
  5343. "application/vnd.oasis.opendocument.text": ["odt"],
  5344. "application/vnd.oasis.opendocument.text-master": ["odm"],
  5345. "application/vnd.oasis.opendocument.text-template": ["ott"],
  5346. "application/vnd.oasis.opendocument.text-web": ["oth"],
  5347. "application/vnd.olpc-sugar": ["xo"],
  5348. "application/vnd.oma.dd2+xml": ["dd2"],
  5349. "application/vnd.openblox.game+xml": ["obgx"],
  5350. "application/vnd.openofficeorg.extension": ["oxt"],
  5351. "application/vnd.openstreetmap.data+xml": ["osm"],
  5352. "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"],
  5353. "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"],
  5354. "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"],
  5355. "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"],
  5356. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
  5357. "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"],
  5358. "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"],
  5359. "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"],
  5360. "application/vnd.osgeo.mapguide.package": ["mgp"],
  5361. "application/vnd.osgi.dp": ["dp"],
  5362. "application/vnd.osgi.subsystem": ["esa"],
  5363. "application/vnd.palm": ["pdb", "pqa", "oprc"],
  5364. "application/vnd.pawaafile": ["paw"],
  5365. "application/vnd.pg.format": ["str"],
  5366. "application/vnd.pg.osasli": ["ei6"],
  5367. "application/vnd.picsel": ["efif"],
  5368. "application/vnd.pmi.widget": ["wg"],
  5369. "application/vnd.pocketlearn": ["plf"],
  5370. "application/vnd.powerbuilder6": ["pbd"],
  5371. "application/vnd.previewsystems.box": ["box"],
  5372. "application/vnd.proteus.magazine": ["mgz"],
  5373. "application/vnd.publishare-delta-tree": ["qps"],
  5374. "application/vnd.pvi.ptid1": ["ptid"],
  5375. "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"],
  5376. "application/vnd.realvnc.bed": ["bed"],
  5377. "application/vnd.recordare.musicxml": ["mxl"],
  5378. "application/vnd.recordare.musicxml+xml": ["musicxml"],
  5379. "application/vnd.rig.cryptonote": ["cryptonote"],
  5380. "application/vnd.rim.cod": ["cod"],
  5381. "application/vnd.rn-realmedia": ["rm"],
  5382. "application/vnd.rn-realmedia-vbr": ["rmvb"],
  5383. "application/vnd.route66.link66+xml": ["link66"],
  5384. "application/vnd.sailingtracker.track": ["st"],
  5385. "application/vnd.seemail": ["see"],
  5386. "application/vnd.sema": ["sema"],
  5387. "application/vnd.semd": ["semd"],
  5388. "application/vnd.semf": ["semf"],
  5389. "application/vnd.shana.informed.formdata": ["ifm"],
  5390. "application/vnd.shana.informed.formtemplate": ["itp"],
  5391. "application/vnd.shana.informed.interchange": ["iif"],
  5392. "application/vnd.shana.informed.package": ["ipk"],
  5393. "application/vnd.simtech-mindmapper": ["twd", "twds"],
  5394. "application/vnd.smaf": ["mmf"],
  5395. "application/vnd.smart.teacher": ["teacher"],
  5396. "application/vnd.software602.filler.form+xml": ["fo"],
  5397. "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"],
  5398. "application/vnd.spotfire.dxp": ["dxp"],
  5399. "application/vnd.spotfire.sfs": ["sfs"],
  5400. "application/vnd.stardivision.calc": ["sdc"],
  5401. "application/vnd.stardivision.draw": ["sda"],
  5402. "application/vnd.stardivision.impress": ["sdd"],
  5403. "application/vnd.stardivision.math": ["smf"],
  5404. "application/vnd.stardivision.writer": ["sdw", "vor"],
  5405. "application/vnd.stardivision.writer-global": ["sgl"],
  5406. "application/vnd.stepmania.package": ["smzip"],
  5407. "application/vnd.stepmania.stepchart": ["sm"],
  5408. "application/vnd.sun.wadl+xml": ["wadl"],
  5409. "application/vnd.sun.xml.calc": ["sxc"],
  5410. "application/vnd.sun.xml.calc.template": ["stc"],
  5411. "application/vnd.sun.xml.draw": ["sxd"],
  5412. "application/vnd.sun.xml.draw.template": ["std"],
  5413. "application/vnd.sun.xml.impress": ["sxi"],
  5414. "application/vnd.sun.xml.impress.template": ["sti"],
  5415. "application/vnd.sun.xml.math": ["sxm"],
  5416. "application/vnd.sun.xml.writer": ["sxw"],
  5417. "application/vnd.sun.xml.writer.global": ["sxg"],
  5418. "application/vnd.sun.xml.writer.template": ["stw"],
  5419. "application/vnd.sus-calendar": ["sus", "susp"],
  5420. "application/vnd.svd": ["svd"],
  5421. "application/vnd.symbian.install": ["sis", "sisx"],
  5422. "application/vnd.syncml+xml": ["xsm"],
  5423. "application/vnd.syncml.dm+wbxml": ["bdm"],
  5424. "application/vnd.syncml.dm+xml": ["xdm"],
  5425. "application/vnd.syncml.dmddf+xml": ["ddf"],
  5426. "application/vnd.tao.intent-module-archive": ["tao"],
  5427. "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"],
  5428. "application/vnd.tmobile-livetv": ["tmo"],
  5429. "application/vnd.trid.tpt": ["tpt"],
  5430. "application/vnd.triscape.mxs": ["mxs"],
  5431. "application/vnd.trueapp": ["tra"],
  5432. "application/vnd.ufdl": ["ufd", "ufdl"],
  5433. "application/vnd.uiq.theme": ["utz"],
  5434. "application/vnd.umajin": ["umj"],
  5435. "application/vnd.unity": ["unityweb"],
  5436. "application/vnd.uoml+xml": ["uoml"],
  5437. "application/vnd.vcx": ["vcx"],
  5438. "application/vnd.visio": ["vsd", "vst", "vss", "vsw"],
  5439. "application/vnd.visionary": ["vis"],
  5440. "application/vnd.vsf": ["vsf"],
  5441. "application/vnd.wap.wbxml": ["wbxml"],
  5442. "application/vnd.wap.wmlc": ["wmlc"],
  5443. "application/vnd.wap.wmlscriptc": ["wmlsc"],
  5444. "application/vnd.webturbo": ["wtb"],
  5445. "application/vnd.wolfram.player": ["nbp"],
  5446. "application/vnd.wordperfect": ["wpd"],
  5447. "application/vnd.wqd": ["wqd"],
  5448. "application/vnd.wt.stf": ["stf"],
  5449. "application/vnd.xara": ["xar"],
  5450. "application/vnd.xfdl": ["xfdl"],
  5451. "application/vnd.yamaha.hv-dic": ["hvd"],
  5452. "application/vnd.yamaha.hv-script": ["hvs"],
  5453. "application/vnd.yamaha.hv-voice": ["hvp"],
  5454. "application/vnd.yamaha.openscoreformat": ["osf"],
  5455. "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"],
  5456. "application/vnd.yamaha.smaf-audio": ["saf"],
  5457. "application/vnd.yamaha.smaf-phrase": ["spf"],
  5458. "application/vnd.yellowriver-custom-menu": ["cmp"],
  5459. "application/vnd.zul": ["zir", "zirz"],
  5460. "application/vnd.zzazz.deck+xml": ["zaz"],
  5461. "application/x-7z-compressed": ["7z"],
  5462. "application/x-abiword": ["abw"],
  5463. "application/x-ace-compressed": ["ace"],
  5464. "application/x-apple-diskimage": ["*dmg"],
  5465. "application/x-arj": ["arj"],
  5466. "application/x-authorware-bin": ["aab", "x32", "u32", "vox"],
  5467. "application/x-authorware-map": ["aam"],
  5468. "application/x-authorware-seg": ["aas"],
  5469. "application/x-bcpio": ["bcpio"],
  5470. "application/x-bdoc": ["*bdoc"],
  5471. "application/x-bittorrent": ["torrent"],
  5472. "application/x-blorb": ["blb", "blorb"],
  5473. "application/x-bzip": ["bz"],
  5474. "application/x-bzip2": ["bz2", "boz"],
  5475. "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"],
  5476. "application/x-cdlink": ["vcd"],
  5477. "application/x-cfs-compressed": ["cfs"],
  5478. "application/x-chat": ["chat"],
  5479. "application/x-chess-pgn": ["pgn"],
  5480. "application/x-chrome-extension": ["crx"],
  5481. "application/x-cocoa": ["cco"],
  5482. "application/x-conference": ["nsc"],
  5483. "application/x-cpio": ["cpio"],
  5484. "application/x-csh": ["csh"],
  5485. "application/x-debian-package": ["*deb", "udeb"],
  5486. "application/x-dgc-compressed": ["dgc"],
  5487. "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"],
  5488. "application/x-doom": ["wad"],
  5489. "application/x-dtbncx+xml": ["ncx"],
  5490. "application/x-dtbook+xml": ["dtb"],
  5491. "application/x-dtbresource+xml": ["res"],
  5492. "application/x-dvi": ["dvi"],
  5493. "application/x-envoy": ["evy"],
  5494. "application/x-eva": ["eva"],
  5495. "application/x-font-bdf": ["bdf"],
  5496. "application/x-font-ghostscript": ["gsf"],
  5497. "application/x-font-linux-psf": ["psf"],
  5498. "application/x-font-pcf": ["pcf"],
  5499. "application/x-font-snf": ["snf"],
  5500. "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"],
  5501. "application/x-freearc": ["arc"],
  5502. "application/x-futuresplash": ["spl"],
  5503. "application/x-gca-compressed": ["gca"],
  5504. "application/x-glulx": ["ulx"],
  5505. "application/x-gnumeric": ["gnumeric"],
  5506. "application/x-gramps-xml": ["gramps"],
  5507. "application/x-gtar": ["gtar"],
  5508. "application/x-hdf": ["hdf"],
  5509. "application/x-httpd-php": ["php"],
  5510. "application/x-install-instructions": ["install"],
  5511. "application/x-iso9660-image": ["*iso"],
  5512. "application/x-java-archive-diff": ["jardiff"],
  5513. "application/x-java-jnlp-file": ["jnlp"],
  5514. "application/x-keepass2": ["kdbx"],
  5515. "application/x-latex": ["latex"],
  5516. "application/x-lua-bytecode": ["luac"],
  5517. "application/x-lzh-compressed": ["lzh", "lha"],
  5518. "application/x-makeself": ["run"],
  5519. "application/x-mie": ["mie"],
  5520. "application/x-mobipocket-ebook": ["prc", "mobi"],
  5521. "application/x-ms-application": ["application"],
  5522. "application/x-ms-shortcut": ["lnk"],
  5523. "application/x-ms-wmd": ["wmd"],
  5524. "application/x-ms-wmz": ["wmz"],
  5525. "application/x-ms-xbap": ["xbap"],
  5526. "application/x-msaccess": ["mdb"],
  5527. "application/x-msbinder": ["obd"],
  5528. "application/x-mscardfile": ["crd"],
  5529. "application/x-msclip": ["clp"],
  5530. "application/x-msdos-program": ["*exe"],
  5531. "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"],
  5532. "application/x-msmediaview": ["mvb", "m13", "m14"],
  5533. "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"],
  5534. "application/x-msmoney": ["mny"],
  5535. "application/x-mspublisher": ["pub"],
  5536. "application/x-msschedule": ["scd"],
  5537. "application/x-msterminal": ["trm"],
  5538. "application/x-mswrite": ["wri"],
  5539. "application/x-netcdf": ["nc", "cdf"],
  5540. "application/x-ns-proxy-autoconfig": ["pac"],
  5541. "application/x-nzb": ["nzb"],
  5542. "application/x-perl": ["pl", "pm"],
  5543. "application/x-pilot": ["*prc", "*pdb"],
  5544. "application/x-pkcs12": ["p12", "pfx"],
  5545. "application/x-pkcs7-certificates": ["p7b", "spc"],
  5546. "application/x-pkcs7-certreqresp": ["p7r"],
  5547. "application/x-rar-compressed": ["rar"],
  5548. "application/x-redhat-package-manager": ["rpm"],
  5549. "application/x-research-info-systems": ["ris"],
  5550. "application/x-sea": ["sea"],
  5551. "application/x-sh": ["sh"],
  5552. "application/x-shar": ["shar"],
  5553. "application/x-shockwave-flash": ["swf"],
  5554. "application/x-silverlight-app": ["xap"],
  5555. "application/x-sql": ["sql"],
  5556. "application/x-stuffit": ["sit"],
  5557. "application/x-stuffitx": ["sitx"],
  5558. "application/x-subrip": ["srt"],
  5559. "application/x-sv4cpio": ["sv4cpio"],
  5560. "application/x-sv4crc": ["sv4crc"],
  5561. "application/x-t3vm-image": ["t3"],
  5562. "application/x-tads": ["gam"],
  5563. "application/x-tar": ["tar"],
  5564. "application/x-tcl": ["tcl", "tk"],
  5565. "application/x-tex": ["tex"],
  5566. "application/x-tex-tfm": ["tfm"],
  5567. "application/x-texinfo": ["texinfo", "texi"],
  5568. "application/x-tgif": ["*obj"],
  5569. "application/x-ustar": ["ustar"],
  5570. "application/x-virtualbox-hdd": ["hdd"],
  5571. "application/x-virtualbox-ova": ["ova"],
  5572. "application/x-virtualbox-ovf": ["ovf"],
  5573. "application/x-virtualbox-vbox": ["vbox"],
  5574. "application/x-virtualbox-vbox-extpack": ["vbox-extpack"],
  5575. "application/x-virtualbox-vdi": ["vdi"],
  5576. "application/x-virtualbox-vhd": ["vhd"],
  5577. "application/x-virtualbox-vmdk": ["vmdk"],
  5578. "application/x-wais-source": ["src"],
  5579. "application/x-web-app-manifest+json": ["webapp"],
  5580. "application/x-x509-ca-cert": ["der", "crt", "pem"],
  5581. "application/x-xfig": ["fig"],
  5582. "application/x-xliff+xml": ["*xlf"],
  5583. "application/x-xpinstall": ["xpi"],
  5584. "application/x-xz": ["xz"],
  5585. "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"],
  5586. "audio/vnd.dece.audio": ["uva", "uvva"],
  5587. "audio/vnd.digital-winds": ["eol"],
  5588. "audio/vnd.dra": ["dra"],
  5589. "audio/vnd.dts": ["dts"],
  5590. "audio/vnd.dts.hd": ["dtshd"],
  5591. "audio/vnd.lucent.voice": ["lvp"],
  5592. "audio/vnd.ms-playready.media.pya": ["pya"],
  5593. "audio/vnd.nuera.ecelp4800": ["ecelp4800"],
  5594. "audio/vnd.nuera.ecelp7470": ["ecelp7470"],
  5595. "audio/vnd.nuera.ecelp9600": ["ecelp9600"],
  5596. "audio/vnd.rip": ["rip"],
  5597. "audio/x-aac": ["aac"],
  5598. "audio/x-aiff": ["aif", "aiff", "aifc"],
  5599. "audio/x-caf": ["caf"],
  5600. "audio/x-flac": ["flac"],
  5601. "audio/x-m4a": ["*m4a"],
  5602. "audio/x-matroska": ["mka"],
  5603. "audio/x-mpegurl": ["m3u"],
  5604. "audio/x-ms-wax": ["wax"],
  5605. "audio/x-ms-wma": ["wma"],
  5606. "audio/x-pn-realaudio": ["ram", "ra"],
  5607. "audio/x-pn-realaudio-plugin": ["rmp"],
  5608. "audio/x-realaudio": ["*ra"],
  5609. "audio/x-wav": ["*wav"],
  5610. "chemical/x-cdx": ["cdx"],
  5611. "chemical/x-cif": ["cif"],
  5612. "chemical/x-cmdf": ["cmdf"],
  5613. "chemical/x-cml": ["cml"],
  5614. "chemical/x-csml": ["csml"],
  5615. "chemical/x-xyz": ["xyz"],
  5616. "image/prs.btif": ["btif"],
  5617. "image/prs.pti": ["pti"],
  5618. "image/vnd.adobe.photoshop": ["psd"],
  5619. "image/vnd.airzip.accelerator.azv": ["azv"],
  5620. "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"],
  5621. "image/vnd.djvu": ["djvu", "djv"],
  5622. "image/vnd.dvb.subtitle": ["*sub"],
  5623. "image/vnd.dwg": ["dwg"],
  5624. "image/vnd.dxf": ["dxf"],
  5625. "image/vnd.fastbidsheet": ["fbs"],
  5626. "image/vnd.fpx": ["fpx"],
  5627. "image/vnd.fst": ["fst"],
  5628. "image/vnd.fujixerox.edmics-mmr": ["mmr"],
  5629. "image/vnd.fujixerox.edmics-rlc": ["rlc"],
  5630. "image/vnd.microsoft.icon": ["ico"],
  5631. "image/vnd.ms-dds": ["dds"],
  5632. "image/vnd.ms-modi": ["mdi"],
  5633. "image/vnd.ms-photo": ["wdp"],
  5634. "image/vnd.net-fpx": ["npx"],
  5635. "image/vnd.tencent.tap": ["tap"],
  5636. "image/vnd.valve.source.texture": ["vtf"],
  5637. "image/vnd.wap.wbmp": ["wbmp"],
  5638. "image/vnd.xiff": ["xif"],
  5639. "image/vnd.zbrush.pcx": ["pcx"],
  5640. "image/x-3ds": ["3ds"],
  5641. "image/x-cmu-raster": ["ras"],
  5642. "image/x-cmx": ["cmx"],
  5643. "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"],
  5644. "image/x-icon": ["*ico"],
  5645. "image/x-jng": ["jng"],
  5646. "image/x-mrsid-image": ["sid"],
  5647. "image/x-ms-bmp": ["*bmp"],
  5648. "image/x-pcx": ["*pcx"],
  5649. "image/x-pict": ["pic", "pct"],
  5650. "image/x-portable-anymap": ["pnm"],
  5651. "image/x-portable-bitmap": ["pbm"],
  5652. "image/x-portable-graymap": ["pgm"],
  5653. "image/x-portable-pixmap": ["ppm"],
  5654. "image/x-rgb": ["rgb"],
  5655. "image/x-tga": ["tga"],
  5656. "image/x-xbitmap": ["xbm"],
  5657. "image/x-xpixmap": ["xpm"],
  5658. "image/x-xwindowdump": ["xwd"],
  5659. "message/vnd.wfa.wsc": ["wsc"],
  5660. "model/vnd.collada+xml": ["dae"],
  5661. "model/vnd.dwf": ["dwf"],
  5662. "model/vnd.gdl": ["gdl"],
  5663. "model/vnd.gtw": ["gtw"],
  5664. "model/vnd.mts": ["mts"],
  5665. "model/vnd.opengex": ["ogex"],
  5666. "model/vnd.parasolid.transmit.binary": ["x_b"],
  5667. "model/vnd.parasolid.transmit.text": ["x_t"],
  5668. "model/vnd.usdz+zip": ["usdz"],
  5669. "model/vnd.valve.source.compiled-map": ["bsp"],
  5670. "model/vnd.vtu": ["vtu"],
  5671. "text/prs.lines.tag": ["dsc"],
  5672. "text/vnd.curl": ["curl"],
  5673. "text/vnd.curl.dcurl": ["dcurl"],
  5674. "text/vnd.curl.mcurl": ["mcurl"],
  5675. "text/vnd.curl.scurl": ["scurl"],
  5676. "text/vnd.dvb.subtitle": ["sub"],
  5677. "text/vnd.fly": ["fly"],
  5678. "text/vnd.fmi.flexstor": ["flx"],
  5679. "text/vnd.graphviz": ["gv"],
  5680. "text/vnd.in3d.3dml": ["3dml"],
  5681. "text/vnd.in3d.spot": ["spot"],
  5682. "text/vnd.sun.j2me.app-descriptor": ["jad"],
  5683. "text/vnd.wap.wml": ["wml"],
  5684. "text/vnd.wap.wmlscript": ["wmls"],
  5685. "text/x-asm": ["s", "asm"],
  5686. "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"],
  5687. "text/x-component": ["htc"],
  5688. "text/x-fortran": ["f", "for", "f77", "f90"],
  5689. "text/x-handlebars-template": ["hbs"],
  5690. "text/x-java-source": ["java"],
  5691. "text/x-lua": ["lua"],
  5692. "text/x-markdown": ["mkd"],
  5693. "text/x-nfo": ["nfo"],
  5694. "text/x-opml": ["opml"],
  5695. "text/x-org": ["*org"],
  5696. "text/x-pascal": ["p", "pas"],
  5697. "text/x-processing": ["pde"],
  5698. "text/x-sass": ["sass"],
  5699. "text/x-scss": ["scss"],
  5700. "text/x-setext": ["etx"],
  5701. "text/x-sfv": ["sfv"],
  5702. "text/x-suse-ymp": ["ymp"],
  5703. "text/x-uuencode": ["uu"],
  5704. "text/x-vcalendar": ["vcs"],
  5705. "text/x-vcard": ["vcf"],
  5706. "video/vnd.dece.hd": ["uvh", "uvvh"],
  5707. "video/vnd.dece.mobile": ["uvm", "uvvm"],
  5708. "video/vnd.dece.pd": ["uvp", "uvvp"],
  5709. "video/vnd.dece.sd": ["uvs", "uvvs"],
  5710. "video/vnd.dece.video": ["uvv", "uvvv"],
  5711. "video/vnd.dvb.file": ["dvb"],
  5712. "video/vnd.fvt": ["fvt"],
  5713. "video/vnd.mpegurl": ["mxu", "m4u"],
  5714. "video/vnd.ms-playready.media.pyv": ["pyv"],
  5715. "video/vnd.uvvu.mp4": ["uvu", "uvvu"],
  5716. "video/vnd.vivo": ["viv"],
  5717. "video/x-f4v": ["f4v"],
  5718. "video/x-fli": ["fli"],
  5719. "video/x-flv": ["flv"],
  5720. "video/x-m4v": ["m4v"],
  5721. "video/x-matroska": ["mkv", "mk3d", "mks"],
  5722. "video/x-mng": ["mng"],
  5723. "video/x-ms-asf": ["asf", "asx"],
  5724. "video/x-ms-vob": ["vob"],
  5725. "video/x-ms-wm": ["wm"],
  5726. "video/x-ms-wmv": ["wmv"],
  5727. "video/x-ms-wmx": ["wmx"],
  5728. "video/x-ms-wvx": ["wvx"],
  5729. "video/x-msvideo": ["avi"],
  5730. "video/x-sgi-movie": ["movie"],
  5731. "video/x-smv": ["smv"],
  5732. "x-conference/x-cooltalk": ["ice"]
  5733. };
  5734. }, function (e, t, n) {
  5735. function i(e, t) {
  5736. var n = this;
  5737. if (!x.canFileSlice()) return e.SkipTask = !0, void n.postObject(e, t);
  5738. var i,
  5739. o,
  5740. r = new v(),
  5741. c = e.TaskId,
  5742. p = e.Bucket,
  5743. u = e.Region,
  5744. d = e.Key,
  5745. m = e.FilePath,
  5746. f = e.ChunkSize || e.SliceSize || n.options.ChunkSize,
  5747. g = e.AsyncLimit,
  5748. y = e.StorageClass,
  5749. C = e.ServerSideEncryption,
  5750. k = e.onHashProgress;
  5751. r.on("error", function (e) {
  5752. if (n._isRunningTask(c)) return t(e);
  5753. }), r.on("upload_complete", function (e) {
  5754. t(null, e);
  5755. }), r.on("upload_slice_complete", function (e) {
  5756. l.call(n, {
  5757. Bucket: p,
  5758. Region: u,
  5759. Key: d,
  5760. UploadId: e.UploadId,
  5761. SliceList: e.SliceList
  5762. }, function (t, a) {
  5763. if (n._isRunningTask(c)) {
  5764. if (h.removeUsing(e.UploadId), t) return o(null, !0), r.emit("error", t);
  5765. h.removeUploadId(e.UploadId), o({
  5766. loaded: i,
  5767. total: i
  5768. }, !0), r.emit("upload_complete", a);
  5769. }
  5770. });
  5771. }), r.on("get_upload_data_finish", function (t) {
  5772. var a = h.getFileId(e.FileStat, e.ChunkSize, p, d);
  5773. a && h.saveUploadId(a, t.UploadId, n.options.UploadIdCacheLimit), h.setUsing(t.UploadId), o(null, !0), s.call(n, {
  5774. TaskId: c,
  5775. Bucket: p,
  5776. Region: u,
  5777. Key: d,
  5778. FilePath: m,
  5779. FileSize: i,
  5780. SliceSize: f,
  5781. AsyncLimit: g,
  5782. ServerSideEncryption: C,
  5783. UploadData: t,
  5784. onProgress: o
  5785. }, function (e, t) {
  5786. if (n._isRunningTask(c)) return e ? (o(null, !0), r.emit("error", e)) : void r.emit("upload_slice_complete", t);
  5787. });
  5788. }), r.on("get_file_size_finish", function () {
  5789. if (o = x.throttleOnProgress.call(n, i, e.onProgress), e.UploadData.UploadId) r.emit("get_upload_data_finish", e.UploadData);else {
  5790. var t = x.extend({
  5791. TaskId: c,
  5792. Bucket: p,
  5793. Region: u,
  5794. Key: d,
  5795. Headers: e.Headers,
  5796. StorageClass: y,
  5797. FilePath: m,
  5798. FileSize: i,
  5799. SliceSize: f,
  5800. onHashProgress: k
  5801. }, e);
  5802. a.call(n, t, function (t, i) {
  5803. if (n._isRunningTask(c)) {
  5804. if (t) return r.emit("error", t);
  5805. e.UploadData.UploadId = i.UploadId, e.UploadData.PartList = i.PartList, r.emit("get_upload_data_finish", e.UploadData);
  5806. }
  5807. });
  5808. }
  5809. }), i = e.ContentLength, delete e.ContentLength, !e.Headers && (e.Headers = {}), x.each(e.Headers, function (t, n) {
  5810. "content-length" === n.toLowerCase() && delete e.Headers[n];
  5811. }), function () {
  5812. for (var t = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], a = 1048576, o = 0; o < t.length && (a = 1024 * t[o] * 1024, !(i / a <= n.options.MaxPartNumber)); o++);
  5813. e.ChunkSize = e.SliceSize = f = Math.max(f, a);
  5814. }(), 0 === i ? (e.Body = "", e.ContentLength = 0, e.SkipTask = !0, n.putObject(e, function (e, n) {
  5815. if (e) return t(e);
  5816. t(null, n);
  5817. })) : r.emit("get_file_size_finish");
  5818. }
  5819. function a(e, t) {
  5820. var n = e.TaskId,
  5821. i = e.Bucket,
  5822. a = e.Region,
  5823. s = e.Key,
  5824. c = e.StorageClass,
  5825. l = this,
  5826. p = {},
  5827. u = e.FileSize,
  5828. d = e.SliceSize,
  5829. m = Math.ceil(u / d),
  5830. f = 0,
  5831. y = 0,
  5832. C = x.throttleOnProgress.call(l, u, e.onHashProgress),
  5833. k = function (t, n) {
  5834. var i = d * (t - 1),
  5835. a = Math.min(i + d, u),
  5836. o = a - i;
  5837. p[t] ? n(null, {
  5838. PartNumber: t,
  5839. ETag: p[t],
  5840. Size: o
  5841. }) : x.fileSlice(e.FilePath, i, a, function (e) {
  5842. try {
  5843. var i = x.getFileMd5(e);
  5844. } catch (e) {
  5845. return n(e);
  5846. }
  5847. var a = '"' + i + '"';
  5848. p[t] = a, f += 1, y += o, n(null, {
  5849. PartNumber: t,
  5850. ETag: a,
  5851. Size: o
  5852. }), C({
  5853. loaded: y,
  5854. total: u
  5855. });
  5856. });
  5857. },
  5858. b = function (e, t) {
  5859. var n = e.length;
  5860. if (0 === n) return t(null, !0);
  5861. if (n > m) return t(null, !1);
  5862. if (n > 1) {
  5863. if (Math.max(e[0].Size, e[1].Size) !== d) return t(null, !1);
  5864. }
  5865. var i = function (a) {
  5866. if (a < n) {
  5867. var o = e[a];
  5868. k(o.PartNumber, function (e, n) {
  5869. n && n.ETag === o.ETag && n.Size === o.Size ? i(a + 1) : t(null, !1);
  5870. });
  5871. } else t(null, !0);
  5872. };
  5873. i(0);
  5874. },
  5875. S = new v();
  5876. S.on("error", function (e) {
  5877. if (l._isRunningTask(n)) return t(e);
  5878. }), S.on("upload_id_available", function (e) {
  5879. var n = {},
  5880. i = [];
  5881. x.each(e.PartList, function (e) {
  5882. n[e.PartNumber] = e;
  5883. });
  5884. for (var a = 1; a <= m; a++) {
  5885. var o = n[a];
  5886. o ? (o.PartNumber = a, o.Uploaded = !0) : o = {
  5887. PartNumber: a,
  5888. ETag: null,
  5889. Uploaded: !1
  5890. }, i.push(o);
  5891. }
  5892. e.PartList = i, t(null, e);
  5893. }), S.on("no_available_upload_id", function () {
  5894. if (l._isRunningTask(n)) {
  5895. var o = x.extend({
  5896. Bucket: i,
  5897. Region: a,
  5898. Key: s,
  5899. Headers: x.clone(e.Headers),
  5900. Query: x.clone(e.Query),
  5901. StorageClass: c
  5902. }, e);
  5903. l.multipartInit(o, function (e, i) {
  5904. if (l._isRunningTask(n)) {
  5905. if (e) return S.emit("error", e);
  5906. var a = i.UploadId;
  5907. if (!a) return t({
  5908. Message: "no upload id"
  5909. });
  5910. S.emit("upload_id_available", {
  5911. UploadId: a,
  5912. PartList: []
  5913. });
  5914. }
  5915. });
  5916. }
  5917. }), S.on("has_and_check_upload_id", function (e) {
  5918. e = e.reverse(), g.eachLimit(e, 1, function (e, t) {
  5919. if (l._isRunningTask(n)) return h.using[e] ? void t() : void r.call(l, {
  5920. Bucket: i,
  5921. Region: a,
  5922. Key: s,
  5923. UploadId: e
  5924. }, function (i, a) {
  5925. if (l._isRunningTask(n)) {
  5926. if (i) return h.removeUsing(e), S.emit("error", i);
  5927. var o = a.PartList;
  5928. o.forEach(function (e) {
  5929. e.PartNumber *= 1, e.Size *= 1, e.ETag = e.ETag || "";
  5930. }), b(o, function (i, a) {
  5931. if (l._isRunningTask(n)) return i ? S.emit("error", i) : void (a ? t({
  5932. UploadId: e,
  5933. PartList: o
  5934. }) : t());
  5935. });
  5936. }
  5937. });
  5938. }, function (e) {
  5939. l._isRunningTask(n) && (C(null, !0), e && e.UploadId ? S.emit("upload_id_available", e) : S.emit("no_available_upload_id"));
  5940. });
  5941. }), S.on("seek_local_avail_upload_id", function (t) {
  5942. var o = h.getFileId(e.FileStat, e.ChunkSize, i, s),
  5943. c = h.getUploadIdList(o);
  5944. if (!o || !c) return void S.emit("has_and_check_upload_id", t);
  5945. var p = function (e) {
  5946. if (e >= c.length) return void S.emit("has_and_check_upload_id", t);
  5947. var o = c[e];
  5948. return x.isInArray(t, o) ? h.using[o] ? void p(e + 1) : void r.call(l, {
  5949. Bucket: i,
  5950. Region: a,
  5951. Key: s,
  5952. UploadId: o
  5953. }, function (t, i) {
  5954. l._isRunningTask(n) && (t ? (h.removeUploadId(o), p(e + 1)) : S.emit("upload_id_available", {
  5955. UploadId: o,
  5956. PartList: i.PartList
  5957. }));
  5958. }) : (h.removeUploadId(o), void p(e + 1));
  5959. };
  5960. p(0);
  5961. }), S.on("get_remote_upload_id_list", function () {
  5962. o.call(l, {
  5963. Bucket: i,
  5964. Region: a,
  5965. Key: s
  5966. }, function (t, a) {
  5967. if (l._isRunningTask(n)) {
  5968. if (t) return S.emit("error", t);
  5969. var o = x.filter(a.UploadList, function (e) {
  5970. return e.Key === s && (!c || e.StorageClass.toUpperCase() === c.toUpperCase());
  5971. }).reverse().map(function (e) {
  5972. return e.UploadId || e.UploadID;
  5973. });
  5974. if (o.length) S.emit("seek_local_avail_upload_id", o);else {
  5975. var r,
  5976. p = h.getFileId(e.FileStat, e.ChunkSize, i, s);
  5977. p && (r = h.getUploadIdList(p)) && x.each(r, function (e) {
  5978. h.removeUploadId(e);
  5979. }), S.emit("no_available_upload_id");
  5980. }
  5981. }
  5982. });
  5983. }), S.emit("get_remote_upload_id_list");
  5984. }
  5985. function o(e, t) {
  5986. var n = this,
  5987. i = [],
  5988. a = {
  5989. Bucket: e.Bucket,
  5990. Region: e.Region,
  5991. Prefix: e.Key
  5992. },
  5993. o = function () {
  5994. n.multipartList(a, function (e, n) {
  5995. if (e) return t(e);
  5996. i.push.apply(i, n.Upload || []), "true" === n.IsTruncated ? (a.KeyMarker = n.NextKeyMarker, a.UploadIdMarker = n.NextUploadIdMarker, o()) : t(null, {
  5997. UploadList: i
  5998. });
  5999. });
  6000. };
  6001. o();
  6002. }
  6003. function r(e, t) {
  6004. var n = this,
  6005. i = [],
  6006. a = {
  6007. Bucket: e.Bucket,
  6008. Region: e.Region,
  6009. Key: e.Key,
  6010. UploadId: e.UploadId
  6011. },
  6012. o = function () {
  6013. n.multipartListPart(a, function (e, n) {
  6014. if (e) return t(e);
  6015. i.push.apply(i, n.Part || []), "true" === n.IsTruncated ? (a.PartNumberMarker = n.NextPartNumberMarker, o()) : t(null, {
  6016. PartList: i
  6017. });
  6018. });
  6019. };
  6020. o();
  6021. }
  6022. function s(e, t) {
  6023. var n = this,
  6024. i = e.TaskId,
  6025. a = e.Bucket,
  6026. o = e.Region,
  6027. r = e.Key,
  6028. s = e.UploadData,
  6029. l = e.FileSize,
  6030. p = e.SliceSize,
  6031. u = Math.min(e.AsyncLimit || n.options.ChunkParallelLimit || 1, 256),
  6032. d = e.FilePath,
  6033. m = Math.ceil(l / p),
  6034. f = 0,
  6035. h = e.ServerSideEncryption,
  6036. v = x.filter(s.PartList, function (e) {
  6037. return e.Uploaded && (f += e.PartNumber >= m ? l % p || p : p), !e.Uploaded;
  6038. }),
  6039. y = e.onProgress;
  6040. g.eachLimit(v, u, function (e, t) {
  6041. if (n._isRunningTask(i)) {
  6042. var u = e.PartNumber,
  6043. m = Math.min(l, e.PartNumber * p) - (e.PartNumber - 1) * p,
  6044. g = 0;
  6045. c.call(n, {
  6046. TaskId: i,
  6047. Bucket: a,
  6048. Region: o,
  6049. Key: r,
  6050. SliceSize: p,
  6051. FileSize: l,
  6052. PartNumber: u,
  6053. ServerSideEncryption: h,
  6054. FilePath: d,
  6055. UploadData: s,
  6056. onProgress: function (e) {
  6057. f += e.loaded - g, g = e.loaded, y({
  6058. loaded: f,
  6059. total: l
  6060. });
  6061. }
  6062. }, function (a, o) {
  6063. n._isRunningTask(i) && (a ? f -= g : (f += m - g, e.ETag = o.ETag), y({
  6064. loaded: f,
  6065. total: l
  6066. }), t(a || null, o));
  6067. });
  6068. }
  6069. }, function (e) {
  6070. if (n._isRunningTask(i)) return e ? t(e) : void t(null, {
  6071. UploadId: s.UploadId,
  6072. SliceList: s.PartList
  6073. });
  6074. });
  6075. }
  6076. function c(e, t) {
  6077. var n = this,
  6078. i = e.TaskId,
  6079. a = e.Bucket,
  6080. o = e.Region,
  6081. r = e.Key,
  6082. s = e.FileSize,
  6083. c = e.FilePath,
  6084. l = 1 * e.PartNumber,
  6085. p = e.SliceSize,
  6086. u = e.ServerSideEncryption,
  6087. d = e.UploadData,
  6088. m = n.options.ChunkRetryTimes + 1,
  6089. f = p * (l - 1),
  6090. h = p,
  6091. v = f + p;
  6092. v > s && (v = s, h = v - f), x.fileSlice(c, f, v, function (s) {
  6093. var c = x.getFileMd5(s),
  6094. p = c ? x.binaryBase64(c) : null,
  6095. f = d.PartList[l - 1];
  6096. g.retry(m, function (t) {
  6097. n._isRunningTask(i) && n.multipartUpload({
  6098. TaskId: i,
  6099. Bucket: a,
  6100. Region: o,
  6101. Key: r,
  6102. ContentLength: h,
  6103. PartNumber: l,
  6104. UploadId: d.UploadId,
  6105. ServerSideEncryption: u,
  6106. Body: s,
  6107. onProgress: e.onProgress,
  6108. ContentMD5: p
  6109. }, function (e, a) {
  6110. if (n._isRunningTask(i)) return e ? t(e) : (f.Uploaded = !0, t(null, a));
  6111. });
  6112. }, function (e, a) {
  6113. if (n._isRunningTask(i)) return t(e, a);
  6114. });
  6115. });
  6116. }
  6117. function l(e, t) {
  6118. var n = e.Bucket,
  6119. i = e.Region,
  6120. a = e.Key,
  6121. o = e.UploadId,
  6122. r = e.SliceList,
  6123. s = this,
  6124. c = this.options.ChunkRetryTimes + 1,
  6125. l = r.map(function (e) {
  6126. return {
  6127. PartNumber: e.PartNumber,
  6128. ETag: e.ETag
  6129. };
  6130. });
  6131. g.retry(c, function (e) {
  6132. s.multipartComplete({
  6133. Bucket: n,
  6134. Region: i,
  6135. Key: a,
  6136. UploadId: o,
  6137. Parts: l
  6138. }, e);
  6139. }, function (e, n) {
  6140. t(e, n);
  6141. });
  6142. }
  6143. function p(e, t) {
  6144. var n = e.Bucket,
  6145. i = e.Region,
  6146. a = e.Key,
  6147. r = e.UploadId,
  6148. s = e.Level || "task",
  6149. c = e.AsyncLimit,
  6150. l = this,
  6151. p = new v();
  6152. if (p.on("error", function (e) {
  6153. return t(e);
  6154. }), p.on("get_abort_array", function (o) {
  6155. u.call(l, {
  6156. Bucket: n,
  6157. Region: i,
  6158. Key: a,
  6159. Headers: e.Headers,
  6160. AsyncLimit: c,
  6161. AbortArray: o
  6162. }, function (e, n) {
  6163. if (e) return t(e);
  6164. t(null, n);
  6165. });
  6166. }), "bucket" === s) o.call(l, {
  6167. Bucket: n,
  6168. Region: i
  6169. }, function (e, n) {
  6170. if (e) return t(e);
  6171. p.emit("get_abort_array", n.UploadList || []);
  6172. });else if ("file" === s) {
  6173. if (!a) return t({
  6174. error: "abort_upload_task_no_key"
  6175. });
  6176. o.call(l, {
  6177. Bucket: n,
  6178. Region: i,
  6179. Key: a
  6180. }, function (e, n) {
  6181. if (e) return t(e);
  6182. p.emit("get_abort_array", n.UploadList || []);
  6183. });
  6184. } else {
  6185. if ("task" !== s) return t({
  6186. error: "abort_unknown_level"
  6187. });
  6188. if (!r) return t({
  6189. error: "abort_upload_task_no_id"
  6190. });
  6191. if (!a) return t({
  6192. error: "abort_upload_task_no_key"
  6193. });
  6194. p.emit("get_abort_array", [{
  6195. Key: a,
  6196. UploadId: r
  6197. }]);
  6198. }
  6199. }
  6200. function u(e, t) {
  6201. var n = e.Bucket,
  6202. i = e.Region,
  6203. a = e.Key,
  6204. o = e.AbortArray,
  6205. r = e.AsyncLimit || 1,
  6206. s = this,
  6207. c = 0,
  6208. l = new Array(o.length);
  6209. g.eachLimit(o, r, function (t, o) {
  6210. var r = c;
  6211. if (a && a !== t.Key) return l[r] = {
  6212. error: {
  6213. KeyNotMatch: !0
  6214. }
  6215. }, void o(null);
  6216. var p = t.UploadId || t.UploadID;
  6217. s.multipartAbort({
  6218. Bucket: n,
  6219. Region: i,
  6220. Key: t.Key,
  6221. Headers: e.Headers,
  6222. UploadId: p
  6223. }, function (e) {
  6224. var a = {
  6225. Bucket: n,
  6226. Region: i,
  6227. Key: t.Key,
  6228. UploadId: p
  6229. };
  6230. l[r] = {
  6231. error: e,
  6232. task: a
  6233. }, o(null);
  6234. }), c++;
  6235. }, function (e) {
  6236. if (e) return t(e);
  6237. for (var n = [], i = [], a = 0, o = l.length; a < o; a++) {
  6238. var r = l[a];
  6239. r.task && (r.error ? i.push(r.task) : n.push(r.task));
  6240. }
  6241. return t(null, {
  6242. successList: n,
  6243. errorList: i
  6244. });
  6245. });
  6246. }
  6247. function d(e, t) {
  6248. var n = this,
  6249. i = void 0 === e.SliceSize ? n.options.SliceSize : e.SliceSize,
  6250. a = 0,
  6251. o = 0,
  6252. r = x.throttleOnProgress.call(n, o, e.onProgress),
  6253. s = e.files.length,
  6254. c = e.onFileFinish,
  6255. l = Array(s),
  6256. p = function (e, n, i) {
  6257. r(null, !0), c && c(e, n, i), l[i.Index] = {
  6258. options: i,
  6259. error: e,
  6260. data: n
  6261. }, --s <= 0 && t && t(null, {
  6262. files: l
  6263. });
  6264. },
  6265. u = [];
  6266. x.each(e.files, function (e, t) {
  6267. var n = e.FileSize,
  6268. s = {
  6269. Index: t,
  6270. TaskId: ""
  6271. };
  6272. a += n, x.each(e, function (e, t) {
  6273. "object" != typeof e && "function" != typeof e && (s[t] = e);
  6274. });
  6275. var c = e.onTaskReady;
  6276. e.onTaskReady = function (e) {
  6277. s.TaskId = e, c && c(e);
  6278. };
  6279. var l = 0,
  6280. d = e.onProgress;
  6281. e.onProgress = function (e) {
  6282. o = o - l + e.loaded, l = e.loaded, d && d(e), r({
  6283. loaded: o,
  6284. total: a
  6285. });
  6286. };
  6287. var m = e.onFileFinish,
  6288. f = function (e, t) {
  6289. m && m(e, t), p && p(e, t, s);
  6290. },
  6291. h = n > i ? "sliceUploadFile" : "postObject";
  6292. u.push({
  6293. api: h,
  6294. params: e,
  6295. callback: f
  6296. });
  6297. }), n._addTasks(u);
  6298. }
  6299. function m(e, t) {
  6300. var n = new v(),
  6301. i = this,
  6302. a = e.Bucket,
  6303. o = e.Region,
  6304. r = e.Key,
  6305. s = e.CopySource,
  6306. c = s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);
  6307. if (!c) return void t({
  6308. error: "CopySource format error"
  6309. });
  6310. var l = c[1],
  6311. p = c[3],
  6312. u = decodeURIComponent(c[4]),
  6313. d = void 0 === e.CopySliceSize ? i.options.CopySliceSize : e.CopySliceSize;
  6314. d = Math.max(0, d);
  6315. var m,
  6316. h,
  6317. y = e.CopyChunkSize || this.options.CopyChunkSize,
  6318. C = this.options.CopyChunkParallelLimit,
  6319. k = 0;
  6320. n.on("copy_slice_complete", function (e) {
  6321. i.multipartComplete({
  6322. Bucket: a,
  6323. Region: o,
  6324. Key: r,
  6325. UploadId: e.UploadId,
  6326. Parts: e.PartList
  6327. }, function (e, n) {
  6328. if (e) return h(null, !0), t(e);
  6329. h({
  6330. loaded: m,
  6331. total: m
  6332. }, !0), t(null, n);
  6333. });
  6334. }), n.on("get_copy_data_finish", function (e) {
  6335. g.eachLimit(e.PartList, C, function (t, n) {
  6336. var c = t.PartNumber,
  6337. l = t.CopySourceRange,
  6338. p = t.end - t.start,
  6339. u = 0;
  6340. f.call(i, {
  6341. Bucket: a,
  6342. Region: o,
  6343. Key: r,
  6344. CopySource: s,
  6345. UploadId: e.UploadId,
  6346. PartNumber: c,
  6347. CopySourceRange: l,
  6348. onProgress: function (e) {
  6349. k += e.loaded - u, u = e.loaded, h({
  6350. loaded: k,
  6351. total: m
  6352. });
  6353. }
  6354. }, function (e, i) {
  6355. if (e) return n(e);
  6356. h({
  6357. loaded: k,
  6358. total: m
  6359. }), k += p - u, t.ETag = i.ETag, n(e || null, i);
  6360. });
  6361. }, function (i) {
  6362. if (i) return h(null, !0), t(i);
  6363. n.emit("copy_slice_complete", e);
  6364. });
  6365. }), n.on("get_file_size_finish", function (s) {
  6366. !function () {
  6367. for (var t = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], n = 1048576, a = 0; a < t.length && (n = 1024 * t[a] * 1024, !(m / n <= i.options.MaxPartNumber)); a++);
  6368. e.ChunkSize = y = Math.max(y, n);
  6369. for (var o = Math.ceil(m / y), r = [], s = 1; s <= o; s++) {
  6370. var c = (s - 1) * y,
  6371. l = s * y < m ? s * y - 1 : m - 1,
  6372. p = {
  6373. PartNumber: s,
  6374. start: c,
  6375. end: l,
  6376. CopySourceRange: "bytes=" + c + "-" + l
  6377. };
  6378. r.push(p);
  6379. }
  6380. e.PartList = r;
  6381. }();
  6382. var c;
  6383. if (c = "Replaced" === e.Headers["x-cos-metadata-directive"] ? e.Headers : s, c["x-cos-storage-class"] = e.Headers["x-cos-storage-class"] || s["x-cos-storage-class"], c = x.clearKey(c), "ARCHIVE" === s["x-cos-storage-class"] || "DEEP_ARCHIVE" === s["x-cos-storage-class"]) {
  6384. var l = s["x-cos-restore"];
  6385. if (!l || 'ongoing-request="true"' === l) return void t({
  6386. error: "Unrestored archive object is not allowed to be copied"
  6387. });
  6388. }
  6389. delete c["x-cos-copy-source"], delete c["x-cos-metadata-directive"], delete c["x-cos-copy-source-If-Modified-Since"], delete c["x-cos-copy-source-If-Unmodified-Since"], delete c["x-cos-copy-source-If-Match"], delete c["x-cos-copy-source-If-None-Match"], i.multipartInit({
  6390. Bucket: a,
  6391. Region: o,
  6392. Key: r,
  6393. Headers: c
  6394. }, function (i, a) {
  6395. if (i) return t(i);
  6396. e.UploadId = a.UploadId, n.emit("get_copy_data_finish", e);
  6397. });
  6398. }), i.headObject({
  6399. Bucket: l,
  6400. Region: p,
  6401. Key: u
  6402. }, function (a, o) {
  6403. if (a) return void t(a.statusCode && 404 === a.statusCode ? {
  6404. ErrorStatus: u + " Not Exist"
  6405. } : a);
  6406. if (void 0 === (m = e.FileSize = o.headers["content-length"]) || !m) return void t({
  6407. error: 'get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.'
  6408. });
  6409. if (h = x.throttleOnProgress.call(i, m, e.onProgress), m <= d) e.Headers["x-cos-metadata-directive"] || (e.Headers["x-cos-metadata-directive"] = "Copy"), i.putObjectCopy(e, function (e, n) {
  6410. if (e) return h(null, !0), t(e);
  6411. h({
  6412. loaded: m,
  6413. total: m
  6414. }, !0), t(e, n);
  6415. });else {
  6416. var r = o.headers,
  6417. s = {
  6418. "Cache-Control": r["cache-control"],
  6419. "Content-Disposition": r["content-disposition"],
  6420. "Content-Encoding": r["content-encoding"],
  6421. "Content-Type": r["content-type"],
  6422. Expires: r.expires,
  6423. "x-cos-storage-class": r["x-cos-storage-class"]
  6424. };
  6425. x.each(r, function (e, t) {
  6426. 0 === t.indexOf("x-cos-meta-") && t.length > "x-cos-meta-".length && (s[t] = e);
  6427. }), n.emit("get_file_size_finish", s);
  6428. }
  6429. });
  6430. }
  6431. function f(e, t) {
  6432. var n = e.TaskId,
  6433. i = e.Bucket,
  6434. a = e.Region,
  6435. o = e.Key,
  6436. r = e.CopySource,
  6437. s = e.UploadId,
  6438. c = 1 * e.PartNumber,
  6439. l = e.CopySourceRange,
  6440. p = this.options.ChunkRetryTimes + 1,
  6441. u = this;
  6442. g.retry(p, function (t) {
  6443. u.uploadPartCopy({
  6444. TaskId: n,
  6445. Bucket: i,
  6446. Region: a,
  6447. Key: o,
  6448. CopySource: r,
  6449. UploadId: s,
  6450. PartNumber: c,
  6451. CopySourceRange: l,
  6452. onProgress: e.onProgress
  6453. }, function (e, n) {
  6454. t(e || null, n);
  6455. });
  6456. }, function (e, n) {
  6457. return t(e, n);
  6458. });
  6459. }
  6460. var h = n(5),
  6461. g = n(24),
  6462. v = n(4).EventProxy,
  6463. x = n(0),
  6464. y = {
  6465. sliceUploadFile: i,
  6466. abortUploadTask: p,
  6467. uploadFiles: d,
  6468. sliceCopyFile: m
  6469. };
  6470. e.exports.init = function (e, t) {
  6471. t.transferToTaskMethod(y, "sliceUploadFile"), x.each(y, function (t, n) {
  6472. e.prototype[n] = x.apiWrapper(n, t);
  6473. });
  6474. };
  6475. }, function (e, t) {
  6476. var n = function (e, t, n, i) {
  6477. if (i = i || function () {}, !e.length || t <= 0) return i();
  6478. var a = 0,
  6479. o = 0,
  6480. r = 0;
  6481. !function s() {
  6482. if (a >= e.length) return i();
  6483. for (; r < t && o < e.length;) o += 1, r += 1, n(e[o - 1], function (t) {
  6484. t ? (i(t), i = function () {}) : (a += 1, r -= 1, a >= e.length ? i() : s());
  6485. });
  6486. }();
  6487. },
  6488. i = function (e, t, n) {
  6489. var i = function (a) {
  6490. t(function (t, o) {
  6491. t && a < e ? i(a + 1) : n(t, o);
  6492. });
  6493. };
  6494. e < 1 ? n() : i(1);
  6495. },
  6496. a = {
  6497. eachLimit: n,
  6498. retry: i
  6499. };
  6500. e.exports = a;
  6501. }]);
  6502. });
  6503. }, function (modId) {
  6504. var map = {};
  6505. return __REQUIRE__(map[modId], modId);
  6506. });
  6507. return __REQUIRE__(1611536304717);
  6508. }(); //# sourceMappingURL=index.js.map