12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733 |
-
-
- import ons from './ons/index.js';
- import './ons/platform';
- import './ons/microevent.js';
-
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
-
-
-
-
-
-
-
-
-
-
-
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
-
- var createClass = function () {
- function defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
-
- var fastclick = createCommonjsModule(function (module) {
- (function () {
- function FastClick(layer, options) {
- var oldOnClick;
-
- options = options || {};
-
-
-
- this.trackingClick = false;
-
-
-
- this.trackingClickStart = 0;
-
-
-
- this.targetElement = null;
-
-
-
- this.touchStartX = 0;
-
-
-
- this.touchStartY = 0;
-
-
-
- this.lastTouchIdentifier = 0;
-
-
-
- this.touchBoundary = options.touchBoundary || 10;
-
-
-
- this.layer = layer;
-
-
-
- this.tapDelay = options.tapDelay || 200;
-
-
-
- this.tapTimeout = options.tapTimeout || 700;
-
- if (FastClick.notNeeded(layer)) {
- return;
- }
-
-
- function bind(method, context) {
- return function () {
- return method.apply(context, arguments);
- };
- }
-
- var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
- var context = this;
- for (var i = 0, l = methods.length; i < l; i++) {
- context[methods[i]] = bind(context[methods[i]], context);
- }
-
-
- if (deviceIsAndroid) {
- layer.addEventListener('mouseover', this.onMouse, true);
- layer.addEventListener('mousedown', this.onMouse, true);
- layer.addEventListener('mouseup', this.onMouse, true);
- }
-
- layer.addEventListener('click', this.onClick, true);
- layer.addEventListener('touchstart', this.onTouchStart, false);
- layer.addEventListener('touchmove', this.onTouchMove, false);
- layer.addEventListener('touchend', this.onTouchEnd, false);
- layer.addEventListener('touchcancel', this.onTouchCancel, false);
-
-
-
-
- if (!Event.prototype.stopImmediatePropagation) {
- layer.removeEventListener = function (type, callback, capture) {
- var rmv = Node.prototype.removeEventListener;
- if (type === 'click') {
- rmv.call(layer, type, callback.hijacked || callback, capture);
- } else {
- rmv.call(layer, type, callback, capture);
- }
- };
-
- layer.addEventListener = function (type, callback, capture) {
- var adv = Node.prototype.addEventListener;
- if (type === 'click') {
- adv.call(layer, type, callback.hijacked || (callback.hijacked = function (event) {
- if (!event.propagationStopped) {
- callback(event);
- }
- }), capture);
- } else {
- adv.call(layer, type, callback, capture);
- }
- };
- }
-
-
-
-
- if (typeof layer.onclick === 'function') {
-
-
-
- oldOnClick = layer.onclick;
- layer.addEventListener('click', function (event) {
- oldOnClick(event);
- }, false);
- layer.onclick = null;
- }
- }
-
-
-
- var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
-
-
-
- var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
-
-
-
- var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
-
-
-
- var deviceIsIOS4 = deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent);
-
-
-
- var deviceIsIOSWithBadTarget = deviceIsIOS && /OS [6-7]_\d/.test(navigator.userAgent);
-
-
-
- var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
-
-
-
- var textFields = ['email', 'number', 'password', 'search', 'tel', 'text', 'url'];
-
-
-
- FastClick.prototype.needsClick = function (target) {
- switch (target.nodeName.toLowerCase()) {
-
-
- case 'button':
- case 'select':
- case 'textarea':
- if (target.disabled) {
- return true;
- }
-
- break;
- case 'input':
-
-
- if (deviceIsIOS && target.type === 'file' || target.disabled) {
- return true;
- }
-
- break;
- case 'label':
- case 'iframe':
- case 'video':
- return true;
- }
-
- return (/\bneedsclick\b/.test(target.className)
- );
- };
-
-
-
- FastClick.prototype.needsFocus = function (target) {
- switch (target.nodeName.toLowerCase()) {
- case 'textarea':
- return true;
- case 'select':
- return !deviceIsAndroid;
- case 'input':
- switch (target.type) {
- case 'button':
- case 'checkbox':
- case 'file':
- case 'image':
- case 'radio':
- case 'submit':
- return false;
- }
-
-
- return !target.disabled && !target.readOnly;
- default:
- return (/\bneedsfocus\b/.test(target.className)
- );
- }
- };
-
-
-
- FastClick.prototype.sendClick = function (targetElement, event) {
- var clickEvent, touch;
-
-
- if (document.activeElement && document.activeElement !== targetElement) {
- document.activeElement.blur();
- }
-
- touch = event.changedTouches[0];
-
-
- clickEvent = document.createEvent('MouseEvents');
- clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
- clickEvent.forwardedTouchEvent = true;
- targetElement.dispatchEvent(clickEvent);
- };
-
- FastClick.prototype.determineEventType = function (targetElement) {
-
-
- if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
- return 'mousedown';
- }
-
- return 'click';
- };
-
-
-
- FastClick.prototype.focus = function (targetElement) {
- var length;
-
-
- if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email' && targetElement.type !== 'number') {
- length = targetElement.value.length;
- targetElement.setSelectionRange(length, length);
- } else {
- targetElement.focus();
- }
- };
-
-
-
- FastClick.prototype.updateScrollParent = function (targetElement) {
- var scrollParent, parentElement;
-
- scrollParent = targetElement.fastClickScrollParent;
-
-
-
- if (!scrollParent || !scrollParent.contains(targetElement)) {
- parentElement = targetElement;
- do {
- if (parentElement.scrollHeight > parentElement.offsetHeight) {
- scrollParent = parentElement;
- targetElement.fastClickScrollParent = parentElement;
- break;
- }
-
- parentElement = parentElement.parentElement;
- } while (parentElement);
- }
-
-
- if (scrollParent) {
- scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
- }
- };
-
-
-
- FastClick.prototype.getTargetElementFromEventTarget = function (eventTarget) {
-
-
- if (eventTarget.nodeType === Node.TEXT_NODE) {
- return eventTarget.parentNode;
- }
-
- return eventTarget;
- };
-
-
-
- FastClick.prototype.isTextField = function (targetElement) {
- return targetElement.tagName.toLowerCase() === 'textarea' || textFields.indexOf(targetElement.type) !== -1;
- };
-
-
-
- FastClick.prototype.onTouchStart = function (event) {
- var targetElement, touch;
-
-
- if (event.targetTouches.length > 1) {
- return true;
- }
-
- targetElement = this.getTargetElementFromEventTarget(event.target);
- touch = event.targetTouches[0];
-
-
-
- if (targetElement.isContentEditable) {
- return true;
- }
-
- if (deviceIsIOS) {
-
-
-
- if (targetElement === document.activeElement && this.isTextField(targetElement)) {
- return true;
- }
-
- if (!deviceIsIOS4) {
-
-
-
-
-
-
-
-
-
- if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
- event.preventDefault();
- return false;
- }
-
- this.lastTouchIdentifier = touch.identifier;
-
-
-
-
-
-
-
- this.updateScrollParent(targetElement);
- }
- }
-
- this.trackingClick = true;
- this.trackingClickStart = event.timeStamp;
- this.targetElement = targetElement;
-
- this.touchStartX = touch.pageX;
- this.touchStartY = touch.pageY;
-
-
- if (event.timeStamp - this.lastClickTime < this.tapDelay && event.timeStamp - this.lastClickTime > -1) {
- event.preventDefault();
- }
-
- return true;
- };
-
-
-
- FastClick.prototype.touchHasMoved = function (event) {
- var touch = event.changedTouches[0],
- boundary = this.touchBoundary;
-
- if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
- return true;
- }
-
- return false;
- };
-
-
-
- FastClick.prototype.onTouchMove = function (event) {
- if (!this.trackingClick) {
- return true;
- }
-
-
- if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
- this.trackingClick = false;
- this.targetElement = null;
- }
-
- return true;
- };
-
-
-
- FastClick.prototype.findControl = function (labelElement) {
-
-
- if (labelElement.control !== undefined) {
- return labelElement.control;
- }
-
-
- if (labelElement.htmlFor) {
- return document.getElementById(labelElement.htmlFor);
- }
-
-
-
- return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
- };
-
-
-
- FastClick.prototype.onTouchEnd = function (event) {
- var forElement,
- trackingClickStart,
- targetTagName,
- scrollParent,
- touch,
- targetElement = this.targetElement;
-
- if (!this.trackingClick) {
- return true;
- }
-
-
- if (event.timeStamp - this.lastClickTime < this.tapDelay && event.timeStamp - this.lastClickTime > -1) {
- this.cancelNextClick = true;
- return true;
- }
-
- if (event.timeStamp - this.trackingClickStart > this.tapTimeout) {
- return true;
- }
-
-
- this.cancelNextClick = false;
-
- this.lastClickTime = event.timeStamp;
-
- trackingClickStart = this.trackingClickStart;
- this.trackingClick = false;
- this.trackingClickStart = 0;
-
-
-
-
-
- if (deviceIsIOSWithBadTarget) {
- touch = event.changedTouches[0];
-
-
- targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
- targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
- }
-
- targetTagName = targetElement.tagName.toLowerCase();
- if (targetTagName === 'label') {
- forElement = this.findControl(targetElement);
- if (forElement) {
- this.focus(targetElement);
- if (deviceIsAndroid) {
- return false;
- }
-
- targetElement = forElement;
- }
- } else if (this.needsFocus(targetElement)) {
-
-
-
- if (event.timeStamp - trackingClickStart > 100 || deviceIsIOS && window.top !== window && targetTagName === 'input') {
- this.targetElement = null;
- return false;
- }
-
- this.focus(targetElement);
- this.sendClick(targetElement, event);
-
-
-
- if (!deviceIsIOS4 || targetTagName !== 'select') {
- this.targetElement = null;
- event.preventDefault();
- }
-
- return false;
- }
-
- if (deviceIsIOS && !deviceIsIOS4) {
-
-
-
- scrollParent = targetElement.fastClickScrollParent;
- if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
- return true;
- }
- }
-
-
-
- if (!this.needsClick(targetElement)) {
- event.preventDefault();
- this.sendClick(targetElement, event);
- }
-
- return false;
- };
-
-
-
- FastClick.prototype.onTouchCancel = function () {
- this.trackingClick = false;
- this.targetElement = null;
- };
-
-
-
- FastClick.prototype.onMouse = function (event) {
-
-
- if (!this.targetElement) {
- return true;
- }
-
- if (event.forwardedTouchEvent) {
- return true;
- }
-
-
- if (!event.cancelable) {
- return true;
- }
-
-
-
-
- if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
-
-
- if (event.stopImmediatePropagation) {
- event.stopImmediatePropagation();
- } else {
-
-
- event.propagationStopped = true;
- }
-
-
- event.stopPropagation();
- event.preventDefault();
-
- return false;
- }
-
-
- return true;
- };
-
-
-
- FastClick.prototype.onClick = function (event) {
- var permitted;
-
-
- if (this.trackingClick) {
- this.targetElement = null;
- this.trackingClick = false;
- return true;
- }
-
-
- if (event.target.type === 'submit' && event.detail === 0) {
- return true;
- }
-
- permitted = this.onMouse(event);
-
-
- if (!permitted) {
- this.targetElement = null;
- }
-
-
- return permitted;
- };
-
-
-
- FastClick.prototype.destroy = function () {
- var layer = this.layer;
-
- if (deviceIsAndroid) {
- layer.removeEventListener('mouseover', this.onMouse, true);
- layer.removeEventListener('mousedown', this.onMouse, true);
- layer.removeEventListener('mouseup', this.onMouse, true);
- }
-
- layer.removeEventListener('click', this.onClick, true);
- layer.removeEventListener('touchstart', this.onTouchStart, false);
- layer.removeEventListener('touchmove', this.onTouchMove, false);
- layer.removeEventListener('touchend', this.onTouchEnd, false);
- layer.removeEventListener('touchcancel', this.onTouchCancel, false);
- };
-
-
-
- FastClick.notNeeded = function (layer) {
- var metaViewport;
- var chromeVersion;
- var blackberryVersion;
- var firefoxVersion;
-
-
- if (typeof window.ontouchstart === 'undefined') {
- return true;
- }
-
-
- chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
-
- if (chromeVersion) {
-
- if (deviceIsAndroid) {
- metaViewport = document.querySelector('meta[name=viewport]');
-
- if (metaViewport) {
-
- if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
- return true;
- }
-
- if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
- return true;
- }
- }
-
-
- } else {
- return true;
- }
- }
-
- if (deviceIsBlackBerry10) {
- blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
-
-
-
- if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
- metaViewport = document.querySelector('meta[name=viewport]');
-
- if (metaViewport) {
-
- if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
- return true;
- }
-
- if (document.documentElement.scrollWidth <= window.outerWidth) {
- return true;
- }
- }
- }
- }
-
-
- if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
- return true;
- }
-
-
- firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
-
- if (firefoxVersion >= 27) {
-
-
- metaViewport = document.querySelector('meta[name=viewport]');
- if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
- return true;
- }
- }
-
-
-
- if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
- return true;
- }
-
- return false;
- };
-
-
-
- FastClick.attach = function (layer, options) {
- return new FastClick(layer, options);
- };
-
- if (typeof undefined === 'function' && _typeof(undefined.amd) === 'object' && undefined.amd) {
-
-
- undefined(function () {
- return FastClick;
- });
- } else if ('object' !== 'undefined' && module.exports) {
- module.exports = FastClick.attach;
- module.exports.FastClick = FastClick;
- } else {
- window.FastClick = FastClick;
- }
- })();
- });
-
- var fastclick_1 = fastclick.FastClick;
-
-
- if (window.customElements) {
-
- window.customElements.forcePolyfill = true;
- }
-
- var _global = createCommonjsModule(function (module) {
-
- var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self
-
- : Function('return this')();
- if (typeof __g == 'number') __g = global;
- });
-
- var _core = createCommonjsModule(function (module) {
- var core = module.exports = { version: '2.5.1' };
- if (typeof __e == 'number') __e = core;
- });
-
- var _core_1 = _core.version;
-
- var _isObject = function _isObject(it) {
- return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) === 'object' ? it !== null : typeof it === 'function';
- };
-
- var _anObject = function _anObject(it) {
- if (!_isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
- };
-
- var _fails = function _fails(exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
-
-
- var _descriptors = !_fails(function () {
- return Object.defineProperty({}, 'a', { get: function get() {
- return 7;
- } }).a != 7;
- });
-
- var document$1 = _global.document;
-
- var is = _isObject(document$1) && _isObject(document$1.createElement);
- var _domCreate = function _domCreate(it) {
- return is ? document$1.createElement(it) : {};
- };
-
- var _ie8DomDefine = !_descriptors && !_fails(function () {
- return Object.defineProperty(_domCreate('div'), 'a', { get: function get() {
- return 7;
- } }).a != 7;
- });
-
-
-
-
-
- var _toPrimitive = function _toPrimitive(it, S) {
- if (!_isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
-
- var dP = Object.defineProperty;
-
- var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- _anObject(O);
- P = _toPrimitive(P, true);
- _anObject(Attributes);
- if (_ie8DomDefine) try {
- return dP(O, P, Attributes);
- } catch (e) {}
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
-
- var _objectDp = {
- f: f
- };
-
- var _propertyDesc = function _propertyDesc(bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
-
- var _hide = _descriptors ? function (object, key, value) {
- return _objectDp.f(object, key, _propertyDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
-
- var hasOwnProperty = {}.hasOwnProperty;
- var _has = function _has(it, key) {
- return hasOwnProperty.call(it, key);
- };
-
- var id = 0;
- var px = Math.random();
- var _uid = function _uid(key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
-
- var _redefine = createCommonjsModule(function (module) {
- var SRC = _uid('src');
- var TO_STRING = 'toString';
- var $toString = Function[TO_STRING];
- var TPL = ('' + $toString).split(TO_STRING);
-
- _core.inspectSource = function (it) {
- return $toString.call(it);
- };
-
- (module.exports = function (O, key, val, safe) {
- var isFunction = typeof val == 'function';
- if (isFunction) _has(val, 'name') || _hide(val, 'name', key);
- if (O[key] === val) return;
- if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
- if (O === _global) {
- O[key] = val;
- } else if (!safe) {
- delete O[key];
- _hide(O, key, val);
- } else if (O[key]) {
- O[key] = val;
- } else {
- _hide(O, key, val);
- }
-
- })(Function.prototype, TO_STRING, function toString() {
- return typeof this == 'function' && this[SRC] || $toString.call(this);
- });
- });
-
- var _aFunction = function _aFunction(it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
- };
-
-
-
- var _ctx = function _ctx(fn, that, length) {
- _aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 1:
- return function (a) {
- return fn.call(that, a);
- };
- case 2:
- return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3:
- return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function () /* ...args */{
- return fn.apply(that, arguments);
- };
- };
-
- var PROTOTYPE = 'prototype';
-
- var $export = function $export(type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];
- var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
- var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
- var key, own, out, exp;
- if (IS_GLOBAL) source = name;
- for (key in source) {
-
- own = !IS_FORCED && target && target[key] !== undefined;
-
- out = (own ? target : source)[key];
-
- exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
-
- if (target) _redefine(target, key, out, type & $export.U);
-
- if (exports[key] != out) _hide(exports, key, exp);
- if (IS_PROTO && expProto[key] != out) expProto[key] = out;
- }
- };
- _global.core = _core;
-
- $export.F = 1;
- $export.G = 2;
- $export.S = 4;
- $export.P = 8;
- $export.B = 16;
- $export.W = 32;
- $export.U = 64;
- $export.R = 128;
- var _export = $export;
-
- var f$2 = {}.propertyIsEnumerable;
-
- var _objectPie = {
- f: f$2
- };
-
- var toString = {}.toString;
-
- var _cof = function _cof(it) {
- return toString.call(it).slice(8, -1);
- };
-
-
-
-
- var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
- return _cof(it) == 'String' ? it.split('') : Object(it);
- };
-
-
- var _defined = function _defined(it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
-
-
-
-
- var _toIobject = function _toIobject(it) {
- return _iobject(_defined(it));
- };
-
- var gOPD = Object.getOwnPropertyDescriptor;
-
- var f$1 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
- O = _toIobject(O);
- P = _toPrimitive(P, true);
- if (_ie8DomDefine) try {
- return gOPD(O, P);
- } catch (e) {}
- if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
- };
-
- var _objectGopd = {
- f: f$1
- };
-
-
-
-
- var check = function check(O, proto) {
- _anObject(O);
- if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
- };
- var _setProto = {
- set: Object.setPrototypeOf || ('__proto__' in {} ?
- function (test, buggy, set) {
- try {
- set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2);
- set(test, []);
- buggy = !(test instanceof Array);
- } catch (e) {
- buggy = true;
- }
- return function setPrototypeOf(O, proto) {
- check(O, proto);
- if (buggy) O.__proto__ = proto;else set(O, proto);
- return O;
- };
- }({}, false) : undefined),
- check: check
- };
-
-
-
- _export(_export.S, 'Object', { setPrototypeOf: _setProto.set });
-
- var setPrototypeOf = _core.Object.setPrototypeOf;
-
- var SHARED = '__core-js_shared__';
- var store = _global[SHARED] || (_global[SHARED] = {});
- var _shared = function _shared(key) {
- return store[key] || (store[key] = {});
- };
-
- var _wks = createCommonjsModule(function (module) {
- var store = _shared('wks');
-
- var _Symbol = _global.Symbol;
- var USE_SYMBOL = typeof _Symbol == 'function';
-
- var $exports = module.exports = function (name) {
- return store[name] || (store[name] = USE_SYMBOL && _Symbol[name] || (USE_SYMBOL ? _Symbol : _uid)('Symbol.' + name));
- };
-
- $exports.store = store;
- });
-
-
-
- var TAG = _wks('toStringTag');
-
- var ARG = _cof(function () {
- return arguments;
- }()) == 'Arguments';
-
-
- var tryGet = function tryGet(it, key) {
- try {
- return it[key];
- } catch (e) {}
- };
-
- var _classof = function _classof(it) {
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
-
- : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
-
- : ARG ? _cof(O)
-
- : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
- };
-
-
-
- var test = {};
- test[_wks('toStringTag')] = 'z';
- if (test + '' != '[object z]') {
- _redefine(Object.prototype, 'toString', function toString() {
- return '[object ' + _classof(this) + ']';
- }, true);
- }
-
-
- var ceil = Math.ceil;
- var floor = Math.floor;
- var _toInteger = function _toInteger(it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
-
-
-
- var _stringAt = function _stringAt(TO_STRING) {
- return function (that, pos) {
- var s = String(_defined(that));
- var i = _toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
-
- var _library = false;
-
- var _iterators = {};
-
-
-
- var min = Math.min;
- var _toLength = function _toLength(it) {
- return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0;
- };
-
- var max = Math.max;
- var min$1 = Math.min;
- var _toAbsoluteIndex = function _toAbsoluteIndex(index, length) {
- index = _toInteger(index);
- return index < 0 ? max(index + length, 0) : min$1(index, length);
- };
-
-
-
-
-
- var _arrayIncludes = function _arrayIncludes(IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = _toIobject($this);
- var length = _toLength(O.length);
- var index = _toAbsoluteIndex(fromIndex, length);
- var value;
-
-
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
-
- if (value != value) return true;
-
- } else for (; length > index; index++) {
- if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
- }
- }return !IS_INCLUDES && -1;
- };
- };
-
- var shared = _shared('keys');
-
- var _sharedKey = function _sharedKey(key) {
- return shared[key] || (shared[key] = _uid(key));
- };
-
- var arrayIndexOf = _arrayIncludes(false);
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
-
- var _objectKeysInternal = function _objectKeysInternal(object, names) {
- var O = _toIobject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) {
- if (key != IE_PROTO$1) _has(O, key) && result.push(key);
- }
- while (names.length > i) {
- if (_has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
- }
- }return result;
- };
-
-
- var _enumBugKeys = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(',');
-
-
-
-
- var _objectKeys = Object.keys || function keys(O) {
- return _objectKeysInternal(O, _enumBugKeys);
- };
-
- var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
- _anObject(O);
- var keys = _objectKeys(Properties);
- var length = keys.length;
- var i = 0;
- var P;
- while (length > i) {
- _objectDp.f(O, P = keys[i++], Properties[P]);
- }return O;
- };
-
- var document$2 = _global.document;
- var _html = document$2 && document$2.documentElement;
-
-
-
-
- var IE_PROTO = _sharedKey('IE_PROTO');
- var Empty = function Empty() {};
- var PROTOTYPE$1 = 'prototype';
-
-
- var _createDict = function createDict() {
-
- var iframe = _domCreate('iframe');
- var i = _enumBugKeys.length;
- var lt = '<';
- var gt = '>';
- var iframeDocument;
- iframe.style.display = 'none';
- _html.appendChild(iframe);
- iframe.src = 'javascript:';
-
-
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- _createDict = iframeDocument.F;
- while (i--) {
- delete _createDict[PROTOTYPE$1][_enumBugKeys[i]];
- }return _createDict();
- };
-
- var _objectCreate = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE$1] = _anObject(O);
- result = new Empty();
- Empty[PROTOTYPE$1] = null;
-
- result[IE_PROTO] = O;
- } else result = _createDict();
- return Properties === undefined ? result : _objectDps(result, Properties);
- };
-
- var def = _objectDp.f;
-
- var TAG$1 = _wks('toStringTag');
-
- var _setToStringTag = function _setToStringTag(it, tag, stat) {
- if (it && !_has(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
- };
-
- var IteratorPrototype = {};
-
-
- _hide(IteratorPrototype, _wks('iterator'), function () {
- return this;
- });
-
- var _iterCreate = function _iterCreate(Constructor, NAME, next) {
- Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
- _setToStringTag(Constructor, NAME + ' Iterator');
- };
-
-
-
- var _toObject = function _toObject(it) {
- return Object(_defined(it));
- };
-
-
-
-
- var IE_PROTO$2 = _sharedKey('IE_PROTO');
- var ObjectProto = Object.prototype;
-
- var _objectGpo = Object.getPrototypeOf || function (O) {
- O = _toObject(O);
- if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- }return O instanceof Object ? ObjectProto : null;
- };
-
- var ITERATOR = _wks('iterator');
- var BUGGY = !([].keys && 'next' in [].keys());
- var FF_ITERATOR = '@@iterator';
- var KEYS = 'keys';
- var VALUES = 'values';
-
- var returnThis = function returnThis() {
- return this;
- };
-
- var _iterDefine = function _iterDefine(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- _iterCreate(Constructor, NAME, next);
- var getMethod = function getMethod(kind) {
- if (!BUGGY && kind in proto) return proto[kind];
- switch (kind) {
- case KEYS:
- return function keys() {
- return new Constructor(this, kind);
- };
- case VALUES:
- return function values() {
- return new Constructor(this, kind);
- };
- }return function entries() {
- return new Constructor(this, kind);
- };
- };
- var TAG = NAME + ' Iterator';
- var DEF_VALUES = DEFAULT == VALUES;
- var VALUES_BUG = false;
- var proto = Base.prototype;
- var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
- var $default = $native || getMethod(DEFAULT);
- var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
- var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
- var methods, key, IteratorPrototype;
-
- if ($anyNative) {
- IteratorPrototype = _objectGpo($anyNative.call(new Base()));
- if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
-
- _setToStringTag(IteratorPrototype, TAG, true);
-
- if (!_library && !_has(IteratorPrototype, ITERATOR)) _hide(IteratorPrototype, ITERATOR, returnThis);
- }
- }
-
- if (DEF_VALUES && $native && $native.name !== VALUES) {
- VALUES_BUG = true;
- $default = function values() {
- return $native.call(this);
- };
- }
-
- if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
- _hide(proto, ITERATOR, $default);
- }
-
- _iterators[NAME] = $default;
- _iterators[TAG] = returnThis;
- if (DEFAULT) {
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if (FORCED) for (key in methods) {
- if (!(key in proto)) _redefine(proto, key, methods[key]);
- } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
- };
-
- var $at = _stringAt(true);
-
-
- _iterDefine(String, 'String', function (iterated) {
- this._t = String(iterated);
- this._i = 0;
-
- }, function () {
- var O = this._t;
- var index = this._i;
- var point;
- if (index >= O.length) return { value: undefined, done: true };
- point = $at(O, index);
- this._i += point.length;
- return { value: point, done: false };
- });
-
-
- var UNSCOPABLES = _wks('unscopables');
- var ArrayProto = Array.prototype;
- if (ArrayProto[UNSCOPABLES] == undefined) _hide(ArrayProto, UNSCOPABLES, {});
- var _addToUnscopables = function _addToUnscopables(key) {
- ArrayProto[UNSCOPABLES][key] = true;
- };
-
- var _iterStep = function _iterStep(done, value) {
- return { value: value, done: !!done };
- };
-
-
-
-
-
- var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
- this._t = _toIobject(iterated);
- this._i = 0;
- this._k = kind;
-
- }, function () {
- var O = this._t;
- var kind = this._k;
- var index = this._i++;
- if (!O || index >= O.length) {
- this._t = undefined;
- return _iterStep(1);
- }
- if (kind == 'keys') return _iterStep(0, index);
- if (kind == 'values') return _iterStep(0, O[index]);
- return _iterStep(0, [index, O[index]]);
- }, 'values');
-
-
- _iterators.Arguments = _iterators.Array;
-
- _addToUnscopables('keys');
- _addToUnscopables('values');
- _addToUnscopables('entries');
-
- var ITERATOR$1 = _wks('iterator');
- var TO_STRING_TAG = _wks('toStringTag');
- var ArrayValues = _iterators.Array;
-
- var DOMIterables = {
- CSSRuleList: true,
- CSSStyleDeclaration: false,
- CSSValueList: false,
- ClientRectList: false,
- DOMRectList: false,
- DOMStringList: false,
- DOMTokenList: true,
- DataTransferItemList: false,
- FileList: false,
- HTMLAllCollection: false,
- HTMLCollection: false,
- HTMLFormElement: false,
- HTMLSelectElement: false,
- MediaList: true,
- MimeTypeArray: false,
- NamedNodeMap: false,
- NodeList: true,
- PaintRequestList: false,
- Plugin: false,
- PluginArray: false,
- SVGLengthList: false,
- SVGNumberList: false,
- SVGPathSegList: false,
- SVGPointList: false,
- SVGStringList: false,
- SVGTransformList: false,
- SourceBufferList: false,
- StyleSheetList: true,
- TextTrackCueList: false,
- TextTrackList: false,
- TouchList: false
- };
-
- for (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) {
- var NAME = collections[i];
- var explicit = DOMIterables[NAME];
- var Collection = _global[NAME];
- var proto = Collection && Collection.prototype;
- var key;
- if (proto) {
- if (!proto[ITERATOR$1]) _hide(proto, ITERATOR$1, ArrayValues);
- if (!proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);
- _iterators[NAME] = ArrayValues;
- if (explicit) for (key in es6_array_iterator) {
- if (!proto[key]) _redefine(proto, key, es6_array_iterator[key], true);
- }
- }
- }
-
- var _redefineAll = function _redefineAll(target, src, safe) {
- for (var key in src) {
- _redefine(target, key, src[key], safe);
- }return target;
- };
-
- var _anInstance = function _anInstance(it, Constructor, name, forbiddenField) {
- if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) {
- throw TypeError(name + ': incorrect invocation!');
- }return it;
- };
-
-
-
- var _iterCall = function _iterCall(iterator, fn, value, entries) {
- try {
- return entries ? fn(_anObject(value)[0], value[1]) : fn(value);
-
- } catch (e) {
- var ret = iterator['return'];
- if (ret !== undefined) _anObject(ret.call(iterator));
- throw e;
- }
- };
-
-
-
- var ITERATOR$2 = _wks('iterator');
- var ArrayProto$1 = Array.prototype;
-
- var _isArrayIter = function _isArrayIter(it) {
- return it !== undefined && (_iterators.Array === it || ArrayProto$1[ITERATOR$2] === it);
- };
-
- var ITERATOR$3 = _wks('iterator');
-
- var core_getIteratorMethod = _core.getIteratorMethod = function (it) {
- if (it != undefined) return it[ITERATOR$3] || it['@@iterator'] || _iterators[_classof(it)];
- };
-
- var _forOf = createCommonjsModule(function (module) {
- var BREAK = {};
- var RETURN = {};
- var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
- var iterFn = ITERATOR ? function () {
- return iterable;
- } : core_getIteratorMethod(iterable);
- var f = _ctx(fn, that, entries ? 2 : 1);
- var index = 0;
- var length, step, iterator, result;
- if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
-
- if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
- result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
- if (result === BREAK || result === RETURN) return result;
- } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
- result = _iterCall(iterator, f, step.value, entries);
- if (result === BREAK || result === RETURN) return result;
- }
- };
- exports.BREAK = BREAK;
- exports.RETURN = RETURN;
- });
-
- var SPECIES = _wks('species');
-
- var _setSpecies = function _setSpecies(KEY) {
- var C = _global[KEY];
- if (_descriptors && C && !C[SPECIES]) _objectDp.f(C, SPECIES, {
- configurable: true,
- get: function get() {
- return this;
- }
- });
- };
-
- var _meta = createCommonjsModule(function (module) {
- var META = _uid('meta');
-
- var setDesc = _objectDp.f;
- var id = 0;
- var isExtensible = Object.isExtensible || function () {
- return true;
- };
- var FREEZE = !_fails(function () {
- return isExtensible(Object.preventExtensions({}));
- });
- var setMeta = function setMeta(it) {
- setDesc(it, META, { value: {
- i: 'O' + ++id,
- w: {}
- } });
- };
- var fastKey = function fastKey(it, create) {
-
- if (!_isObject(it)) return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!_has(it, META)) {
-
- if (!isExtensible(it)) return 'F';
-
- if (!create) return 'E';
-
- setMeta(it);
-
- }return it[META].i;
- };
- var getWeak = function getWeak(it, create) {
- if (!_has(it, META)) {
-
- if (!isExtensible(it)) return true;
-
- if (!create) return false;
-
- setMeta(it);
-
- }return it[META].w;
- };
-
- var onFreeze = function onFreeze(it) {
- if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);
- return it;
- };
- var meta = module.exports = {
- KEY: META,
- NEED: false,
- fastKey: fastKey,
- getWeak: getWeak,
- onFreeze: onFreeze
- };
- });
-
- var _meta_1 = _meta.KEY;
- var _meta_2 = _meta.NEED;
- var _meta_3 = _meta.fastKey;
- var _meta_4 = _meta.getWeak;
- var _meta_5 = _meta.onFreeze;
-
- var _validateCollection = function _validateCollection(it, TYPE) {
- if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
- return it;
- };
-
- var dP$1 = _objectDp.f;
-
- var fastKey = _meta.fastKey;
-
- var SIZE = _descriptors ? '_s' : 'size';
-
- var getEntry = function getEntry(that, key) {
-
- var index = fastKey(key);
- var entry;
- if (index !== 'F') return that._i[index];
-
- for (entry = that._f; entry; entry = entry.n) {
- if (entry.k == key) return entry;
- }
- };
-
- var _collectionStrong = {
- getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- _anInstance(that, C, NAME, '_i');
- that._t = NAME;
- that._i = _objectCreate(null);
- that._f = undefined;
- that._l = undefined;
- that[SIZE] = 0;
- if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
- });
- _redefineAll(C.prototype, {
-
-
- clear: function clear() {
- for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
- entry.r = true;
- if (entry.p) entry.p = entry.p.n = undefined;
- delete data[entry.i];
- }
- that._f = that._l = undefined;
- that[SIZE] = 0;
- },
-
-
- 'delete': function _delete(key) {
- var that = _validateCollection(this, NAME);
- var entry = getEntry(that, key);
- if (entry) {
- var next = entry.n;
- var prev = entry.p;
- delete that._i[entry.i];
- entry.r = true;
- if (prev) prev.n = next;
- if (next) next.p = prev;
- if (that._f == entry) that._f = next;
- if (that._l == entry) that._l = prev;
- that[SIZE]--;
- }return !!entry;
- },
-
-
- forEach: function forEach(callbackfn /* , that = undefined */) {
- _validateCollection(this, NAME);
- var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
- var entry;
- while (entry = entry ? entry.n : this._f) {
- f(entry.v, entry.k, this);
-
- while (entry && entry.r) {
- entry = entry.p;
- }
- }
- },
-
-
- has: function has(key) {
- return !!getEntry(_validateCollection(this, NAME), key);
- }
- });
- if (_descriptors) dP$1(C.prototype, 'size', {
- get: function get() {
- return _validateCollection(this, NAME)[SIZE];
- }
- });
- return C;
- },
- def: function def(that, key, value) {
- var entry = getEntry(that, key);
- var prev, index;
-
- if (entry) {
- entry.v = value;
-
- } else {
- that._l = entry = {
- i: index = fastKey(key, true),
- k: key,
- v: value,
- p: prev = that._l,
- n: undefined,
- r: false
- };
- if (!that._f) that._f = entry;
- if (prev) prev.n = entry;
- that[SIZE]++;
-
- if (index !== 'F') that._i[index] = entry;
- }return that;
- },
- getEntry: getEntry,
- setStrong: function setStrong(C, NAME, IS_MAP) {
-
-
- _iterDefine(C, NAME, function (iterated, kind) {
- this._t = _validateCollection(iterated, NAME);
- this._k = kind;
- this._l = undefined;
- }, function () {
- var that = this;
- var kind = that._k;
- var entry = that._l;
-
- while (entry && entry.r) {
- entry = entry.p;
- }
- if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
-
- that._t = undefined;
- return _iterStep(1);
- }
-
- if (kind == 'keys') return _iterStep(0, entry.k);
- if (kind == 'values') return _iterStep(0, entry.v);
- return _iterStep(0, [entry.k, entry.v]);
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
-
-
- _setSpecies(NAME);
- }
- };
-
- var ITERATOR$4 = _wks('iterator');
- var SAFE_CLOSING = false;
-
- try {
- var riter = [7][ITERATOR$4]();
- riter['return'] = function () {
- SAFE_CLOSING = true;
- };
-
-
- } catch (e) {}
-
- var _iterDetect = function _iterDetect(exec, skipClosing) {
- if (!skipClosing && !SAFE_CLOSING) return false;
- var safe = false;
- try {
- var arr = [7];
- var iter = arr[ITERATOR$4]();
- iter.next = function () {
- return { done: safe = true };
- };
- arr[ITERATOR$4] = function () {
- return iter;
- };
- exec(arr);
- } catch (e) {}
- return safe;
- };
-
- var setPrototypeOf$2 = _setProto.set;
- var _inheritIfRequired = function _inheritIfRequired(that, target, C) {
- var S = target.constructor;
- var P;
- if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && _isObject(P) && setPrototypeOf$2) {
- setPrototypeOf$2(that, P);
- }return that;
- };
-
- var _collection = function _collection(NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
- var Base = _global[NAME];
- var C = Base;
- var ADDER = IS_MAP ? 'set' : 'add';
- var proto = C && C.prototype;
- var O = {};
- var fixMethod = function fixMethod(KEY) {
- var fn = proto[KEY];
- _redefine(proto, KEY, KEY == 'delete' ? function (a) {
- return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'has' ? function has(a) {
- return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'get' ? function get(a) {
- return IS_WEAK && !_isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'add' ? function add(a) {
- fn.call(this, a === 0 ? 0 : a);return this;
- } : function set(a, b) {
- fn.call(this, a === 0 ? 0 : a, b);return this;
- });
- };
- if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () {
- new C().entries().next();
- }))) {
-
- C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
- _redefineAll(C.prototype, methods);
- _meta.NEED = true;
- } else {
- var instance = new C();
-
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
-
- var THROWS_ON_PRIMITIVES = _fails(function () {
- instance.has(1);
- });
-
- var ACCEPT_ITERABLES = _iterDetect(function (iter) {
- new C(iter);
- });
-
- var BUGGY_ZERO = !IS_WEAK && _fails(function () {
-
- var $instance = new C();
- var index = 5;
- while (index--) {
- $instance[ADDER](index, index);
- }return !$instance.has(-0);
- });
- if (!ACCEPT_ITERABLES) {
- C = wrapper(function (target, iterable) {
- _anInstance(target, C, NAME);
- var that = _inheritIfRequired(new Base(), target, C);
- if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
- return that;
- });
- C.prototype = proto;
- proto.constructor = C;
- }
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
- fixMethod('delete');
- fixMethod('has');
- IS_MAP && fixMethod('get');
- }
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
-
- if (IS_WEAK && proto.clear) delete proto.clear;
- }
-
- _setToStringTag(C, NAME);
-
- O[NAME] = C;
- _export(_export.G + _export.W + _export.F * (C != Base), O);
-
- if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
-
- return C;
- };
-
- var SET = 'Set';
-
-
- var es6_set = _collection(SET, function (get) {
- return function Set() {
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
- };
- }, {
-
- add: function add(value) {
- return _collectionStrong.def(_validateCollection(this, SET), value = value === 0 ? 0 : value, value);
- }
- }, _collectionStrong);
-
- var _arrayFromIterable = function _arrayFromIterable(iter, ITERATOR) {
- var result = [];
- _forOf(iter, false, result.push, result, ITERATOR);
- return result;
- };
-
-
-
-
- var _collectionToJson = function _collectionToJson(NAME) {
- return function toJSON() {
- if (_classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
- return _arrayFromIterable(this);
- };
- };
-
-
-
-
- _export(_export.P + _export.R, 'Set', { toJSON: _collectionToJson('Set') });
-
-
-
-
- var _setCollectionOf = function _setCollectionOf(COLLECTION) {
- _export(_export.S, COLLECTION, { of: function of() {
- var length = arguments.length;
- var A = Array(length);
- while (length--) {
- A[length] = arguments[length];
- }return new this(A);
- } });
- };
-
-
- _setCollectionOf('Set');
-
-
-
-
- var _setCollectionFrom = function _setCollectionFrom(COLLECTION) {
- _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
- var mapFn = arguments[1];
- var mapping, A, n, cb;
- _aFunction(this);
- mapping = mapFn !== undefined;
- if (mapping) _aFunction(mapFn);
- if (source == undefined) return new this();
- A = [];
- if (mapping) {
- n = 0;
- cb = _ctx(mapFn, arguments[2], 2);
- _forOf(source, false, function (nextItem) {
- A.push(cb(nextItem, n++));
- });
- } else {
- _forOf(source, false, A.push, A);
- }
- return new this(A);
- } });
- };
-
-
- _setCollectionFrom('Set');
-
- var set$1 = _core.Set;
-
- var MAP = 'Map';
-
-
- var es6_map = _collection(MAP, function (get) {
- return function Map() {
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
- };
- }, {
-
- get: function get(key) {
- var entry = _collectionStrong.getEntry(_validateCollection(this, MAP), key);
- return entry && entry.v;
- },
-
- set: function set(key, value) {
- return _collectionStrong.def(_validateCollection(this, MAP), key === 0 ? 0 : key, value);
- }
- }, _collectionStrong, true);
-
-
-
-
- _export(_export.P + _export.R, 'Map', { toJSON: _collectionToJson('Map') });
-
-
- _setCollectionOf('Map');
-
-
- _setCollectionFrom('Map');
-
- var map = _core.Map;
-
-
-
- var _isArray = Array.isArray || function isArray(arg) {
- return _cof(arg) == 'Array';
- };
-
- var SPECIES$1 = _wks('species');
-
- var _arraySpeciesConstructor = function _arraySpeciesConstructor(original) {
- var C;
- if (_isArray(original)) {
- C = original.constructor;
-
- if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
- if (_isObject(C)) {
- C = C[SPECIES$1];
- if (C === null) C = undefined;
- }
- }return C === undefined ? Array : C;
- };
-
-
-
-
- var _arraySpeciesCreate = function _arraySpeciesCreate(original, length) {
- return new (_arraySpeciesConstructor(original))(length);
- };
-
-
-
-
-
-
-
-
-
-
- var _arrayMethods = function _arrayMethods(TYPE, $create) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- var create = $create || _arraySpeciesCreate;
- return function ($this, callbackfn, that) {
- var O = _toObject($this);
- var self = _iobject(O);
- var f = _ctx(callbackfn, that, 3);
- var length = _toLength(self.length);
- var index = 0;
- var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var val, res;
- for (; length > index; index++) {
- if (NO_HOLES || index in self) {
- val = self[index];
- res = f(val, index, O);
- if (TYPE) {
- if (IS_MAP) result[index] = res;
- else if (res) switch (TYPE) {
- case 3:
- return true;
- case 5:
- return val;
- case 6:
- return index;
- case 2:
- result.push(val);
- } else if (IS_EVERY) return false;
- }
- }
- }return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
- };
- };
-
- var f$3 = Object.getOwnPropertySymbols;
-
- var _objectGops = {
- f: f$3
- };
-
-
-
-
- var $assign = Object.assign;
-
-
- var _objectAssign = !$assign || _fails(function () {
- var A = {};
- var B = {};
-
- var S = Symbol();
- var K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function (k) {
- B[k] = k;
- });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source) {
-
- var T = _toObject(target);
- var aLen = arguments.length;
- var index = 1;
- var getSymbols = _objectGops.f;
- var isEnum = _objectPie.f;
- while (aLen > index) {
- var S = _iobject(arguments[index++]);
- var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
- }
- }return T;
- } : $assign;
-
- var getWeak = _meta.getWeak;
-
- var arrayFind = _arrayMethods(5);
- var arrayFindIndex = _arrayMethods(6);
- var id$1 = 0;
-
-
- var uncaughtFrozenStore = function uncaughtFrozenStore(that) {
- return that._l || (that._l = new UncaughtFrozenStore());
- };
- var UncaughtFrozenStore = function UncaughtFrozenStore() {
- this.a = [];
- };
- var findUncaughtFrozen = function findUncaughtFrozen(store, key) {
- return arrayFind(store.a, function (it) {
- return it[0] === key;
- });
- };
- UncaughtFrozenStore.prototype = {
- get: function get(key) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) return entry[1];
- },
- has: function has(key) {
- return !!findUncaughtFrozen(this, key);
- },
- set: function set(key, value) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) entry[1] = value;else this.a.push([key, value]);
- },
- 'delete': function _delete(key) {
- var index = arrayFindIndex(this.a, function (it) {
- return it[0] === key;
- });
- if (~index) this.a.splice(index, 1);
- return !!~index;
- }
- };
-
- var _collectionWeak = {
- getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- _anInstance(that, C, NAME, '_i');
- that._t = NAME;
- that._i = id$1++;
- that._l = undefined;
- if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
- });
- _redefineAll(C.prototype, {
-
-
- 'delete': function _delete(key) {
- if (!_isObject(key)) return false;
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME))['delete'](key);
- return data && _has(data, this._i) && delete data[this._i];
- },
-
-
- has: function has(key) {
- if (!_isObject(key)) return false;
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME)).has(key);
- return data && _has(data, this._i);
- }
- });
- return C;
- },
- def: function def(that, key, value) {
- var data = getWeak(_anObject(key), true);
- if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value;
- return that;
- },
- ufstore: uncaughtFrozenStore
- };
-
- var es6_weakMap = createCommonjsModule(function (module) {
- var each = _arrayMethods(0);
-
- var WEAK_MAP = 'WeakMap';
- var getWeak = _meta.getWeak;
- var isExtensible = Object.isExtensible;
- var uncaughtFrozenStore = _collectionWeak.ufstore;
- var tmp = {};
- var InternalMap;
-
- var wrapper = function wrapper(get) {
- return function WeakMap() {
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
- };
- };
-
- var methods = {
-
- get: function get(key) {
- if (_isObject(key)) {
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(_validateCollection(this, WEAK_MAP)).get(key);
- return data ? data[this._i] : undefined;
- }
- },
-
- set: function set(key, value) {
- return _collectionWeak.def(_validateCollection(this, WEAK_MAP), key, value);
- }
- };
-
-
- var $WeakMap = module.exports = _collection(WEAK_MAP, wrapper, methods, _collectionWeak, true, true);
-
-
- if (_fails(function () {
- return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7;
- })) {
- InternalMap = _collectionWeak.getConstructor(wrapper, WEAK_MAP);
- _objectAssign(InternalMap.prototype, methods);
- _meta.NEED = true;
- each(['delete', 'has', 'get', 'set'], function (key) {
- var proto = $WeakMap.prototype;
- var method = proto[key];
- _redefine(proto, key, function (a, b) {
-
- if (_isObject(a) && !isExtensible(a)) {
- if (!this._f) this._f = new InternalMap();
- var result = this._f[key](a, b);
- return key == 'set' ? this : result;
-
- }return method.call(this, a, b);
- });
- });
- }
- });
-
-
- _setCollectionOf('WeakMap');
-
-
- _setCollectionFrom('WeakMap');
-
- var weakMap = _core.WeakMap;
-
- var _createProperty = function _createProperty(object, index, value) {
- if (index in object) _objectDp.f(object, index, _propertyDesc(0, value));else object[index] = value;
- };
-
- _export(_export.S + _export.F * !_iterDetect(function (iter) {
-
- }), 'Array', {
-
- from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = _toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var aLen = arguments.length;
- var mapfn = aLen > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var index = 0;
- var iterFn = core_getIteratorMethod(O);
- var length, result, step, iterator;
- if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
-
- if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) {
- for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
- _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value);
- }
- } else {
- length = _toLength(O.length);
- for (result = new C(length); length > index; index++) {
- _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
- }
- }
- result.length = index;
- return result;
- }
- });
-
- var from$1 = _core.Array.from;
-
- var reservedTagList = new Set(['annotation-xml', 'color-profile', 'font-face', 'font-face-src', 'font-face-uri', 'font-face-format', 'font-face-name', 'missing-glyph']);
-
-
- function isValidCustomElementName(localName) {
- var reserved = reservedTagList.has(localName);
- var validForm = /^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(localName);
- return !reserved && validForm;
- }
-
-
- function isConnected(node) {
-
- var nativeValue = node.isConnected;
- if (nativeValue !== undefined) {
- return nativeValue;
- }
-
-
- var current = node;
- while (current && !(current.__CE_isImportDocument || current instanceof Document)) {
- current = current.parentNode || (window.ShadowRoot && current instanceof ShadowRoot ? current.host : undefined);
- }
- return !!(current && (current.__CE_isImportDocument || current instanceof Document));
- }
-
-
- function nextSiblingOrAncestorSibling(root, start) {
- var node = start;
- while (node && node !== root && !node.nextSibling) {
- node = node.parentNode;
- }
- return !node || node === root ? null : node.nextSibling;
- }
-
-
- function nextNode(root, start) {
- return start.firstChild ? start.firstChild : nextSiblingOrAncestorSibling(root, start);
- }
-
-
- function walkDeepDescendantElements(root, callback) {
- var visitedImports = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
-
- var node = root;
- while (node) {
- if (node.nodeType === Node.ELEMENT_NODE) {
- var element = node;
-
- callback(element);
-
- var localName = element.localName;
- if (localName === 'link' && element.getAttribute('rel') === 'import') {
-
-
- var importNode = element.import;
- if (importNode instanceof Node && !visitedImports.has(importNode)) {
-
- visitedImports.add(importNode);
-
- for (var child = importNode.firstChild; child; child = child.nextSibling) {
- walkDeepDescendantElements(child, callback, visitedImports);
- }
- }
-
-
-
-
- node = nextSiblingOrAncestorSibling(root, element);
- continue;
- } else if (localName === 'template') {
-
-
-
-
- node = nextSiblingOrAncestorSibling(root, element);
- continue;
- }
-
-
- var shadowRoot = element.__CE_shadowRoot;
- if (shadowRoot) {
- for (var _child = shadowRoot.firstChild; _child; _child = _child.nextSibling) {
- walkDeepDescendantElements(_child, callback, visitedImports);
- }
- }
- }
-
- node = nextNode(root, node);
- }
- }
-
-
- function setPropertyUnchecked(destination, name, value) {
- destination[name] = value;
- }
-
-
- var CustomElementState = {
- custom: 1,
- failed: 2
- };
-
- var CustomElementInternals = function () {
- function CustomElementInternals() {
- classCallCheck(this, CustomElementInternals);
-
-
- this._localNameToDefinition = new Map();
-
-
- this._constructorToDefinition = new Map();
-
-
- this._patches = [];
-
-
- this._hasPatches = false;
- }
-
-
-
-
-
- createClass(CustomElementInternals, [{
- key: 'setDefinition',
- value: function setDefinition(localName, definition) {
- this._localNameToDefinition.set(localName, definition);
- this._constructorToDefinition.set(definition.constructor, definition);
- }
-
-
-
-
- }, {
- key: 'localNameToDefinition',
- value: function localNameToDefinition(localName) {
- return this._localNameToDefinition.get(localName);
- }
-
-
-
-
- }, {
- key: 'constructorToDefinition',
- value: function constructorToDefinition(constructor) {
- return this._constructorToDefinition.get(constructor);
- }
-
- /**
- * @param {!function(!Node)} listener
- */
-
- }, {
- key: 'addPatch',
- value: function addPatch(listener) {
- this._hasPatches = true;
- this._patches.push(listener);
- }
-
-
-
-
- }, {
- key: 'patchTree',
- value: function patchTree(node) {
- var _this = this;
-
- if (!this._hasPatches) return;
-
- walkDeepDescendantElements(node, function (element) {
- return _this.patch(element);
- });
- }
-
-
-
-
- }, {
- key: 'patch',
- value: function patch(node) {
- if (!this._hasPatches) return;
-
- if (node.__CE_patched) return;
- node.__CE_patched = true;
-
- for (var i = 0; i < this._patches.length; i++) {
- this._patches[i](node);
- }
- }
-
-
-
-
- }, {
- key: 'connectTree',
- value: function connectTree(root) {
- var elements = [];
-
- walkDeepDescendantElements(root, function (element) {
- return elements.push(element);
- });
-
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- if (element.__CE_state === CustomElementState.custom) {
- if (isConnected(element)) {
- this.connectedCallback(element);
- }
- } else {
- this.upgradeElement(element);
- }
- }
- }
-
-
-
-
- }, {
- key: 'disconnectTree',
- value: function disconnectTree(root) {
- var elements = [];
-
- walkDeepDescendantElements(root, function (element) {
- return elements.push(element);
- });
-
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- if (element.__CE_state === CustomElementState.custom) {
- this.disconnectedCallback(element);
- }
- }
- }
-
-
-
-
- }, {
- key: 'patchAndUpgradeTree',
- value: function patchAndUpgradeTree(root) {
- var _this2 = this;
-
- var visitedImports = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
-
- var elements = [];
-
- var gatherElements = function gatherElements(element) {
- if (element.localName === 'link' && element.getAttribute('rel') === 'import') {
-
-
- var importNode = element.import;
-
- if (importNode instanceof Node && importNode.readyState === 'complete') {
- importNode.__CE_isImportDocument = true;
-
-
- importNode.__CE_hasRegistry = true;
- } else {
-
-
- element.addEventListener('load', function () {
- var importNode = element.import;
-
- if (importNode.__CE_documentLoadHandled) return;
- importNode.__CE_documentLoadHandled = true;
-
- importNode.__CE_isImportDocument = true;
-
-
- importNode.__CE_hasRegistry = true;
-
-
-
-
-
-
- visitedImports.delete(importNode);
-
- _this2.patchAndUpgradeTree(importNode, visitedImports);
- });
- }
- } else {
- elements.push(element);
- }
- };
-
-
-
- walkDeepDescendantElements(root, gatherElements, visitedImports);
-
- if (this._hasPatches) {
- for (var i = 0; i < elements.length; i++) {
- this.patch(elements[i]);
- }
- }
-
- for (var _i = 0; _i < elements.length; _i++) {
- this.upgradeElement(elements[_i]);
- }
- }
-
-
-
-
- }, {
- key: 'upgradeElement',
- value: function upgradeElement(element) {
- var currentState = element.__CE_state;
- if (currentState !== undefined) return;
-
- var definition = this.localNameToDefinition(element.localName);
- if (!definition) return;
-
- definition.constructionStack.push(element);
-
- var constructor = definition.constructor;
- try {
- try {
- var result = new constructor();
- if (result !== element) {
- throw new Error('The custom element constructor did not produce the element being upgraded.');
- }
- } finally {
- definition.constructionStack.pop();
- }
- } catch (e) {
- element.__CE_state = CustomElementState.failed;
- throw e;
- }
-
- element.__CE_state = CustomElementState.custom;
- element.__CE_definition = definition;
-
- if (definition.attributeChangedCallback) {
- var observedAttributes = definition.observedAttributes;
- for (var i = 0; i < observedAttributes.length; i++) {
- var name = observedAttributes[i];
- var value = element.getAttribute(name);
- if (value !== null) {
- this.attributeChangedCallback(element, name, null, value, null);
- }
- }
- }
-
- if (isConnected(element)) {
- this.connectedCallback(element);
- }
- }
-
-
-
-
- }, {
- key: 'connectedCallback',
- value: function connectedCallback(element) {
- var definition = element.__CE_definition;
- if (definition.connectedCallback) {
- definition.connectedCallback.call(element);
- }
-
- element.__CE_isConnectedCallbackCalled = true;
- }
-
-
-
-
- }, {
- key: 'disconnectedCallback',
- value: function disconnectedCallback(element) {
- if (!element.__CE_isConnectedCallbackCalled) {
- this.connectedCallback(element);
- }
-
- var definition = element.__CE_definition;
- if (definition.disconnectedCallback) {
- definition.disconnectedCallback.call(element);
- }
-
- element.__CE_isConnectedCallbackCalled = undefined;
- }
-
-
-
-
- }, {
- key: 'attributeChangedCallback',
- value: function attributeChangedCallback(element, name, oldValue, newValue, namespace) {
- var definition = element.__CE_definition;
- if (definition.attributeChangedCallback && definition.observedAttributes.indexOf(name) > -1) {
- definition.attributeChangedCallback.call(element, name, oldValue, newValue, namespace);
- }
- }
- }]);
- return CustomElementInternals;
- }();
-
- var DocumentConstructionObserver = function () {
- function DocumentConstructionObserver(internals, doc) {
- classCallCheck(this, DocumentConstructionObserver);
-
-
-
- this._internals = internals;
-
-
-
- this._document = doc;
-
-
-
- this._observer = undefined;
-
-
-
- this._internals.patchAndUpgradeTree(this._document);
-
- if (this._document.readyState === 'loading') {
- this._observer = new MutationObserver(this._handleMutations.bind(this));
-
-
-
-
-
- this._observer.observe(this._document, {
- childList: true,
- subtree: true
- });
- }
- }
-
- createClass(DocumentConstructionObserver, [{
- key: 'disconnect',
- value: function disconnect() {
- if (this._observer) {
- this._observer.disconnect();
- }
- }
-
-
-
-
- }, {
- key: '_handleMutations',
- value: function _handleMutations(mutations) {
-
-
-
- var readyState = this._document.readyState;
- if (readyState === 'interactive' || readyState === 'complete') {
- this.disconnect();
- }
-
- for (var i = 0; i < mutations.length; i++) {
- var addedNodes = mutations[i].addedNodes;
- for (var j = 0; j < addedNodes.length; j++) {
- var node = addedNodes[j];
- this._internals.patchAndUpgradeTree(node);
- }
- }
- }
- }]);
- return DocumentConstructionObserver;
- }();
-
-
- var Deferred = function () {
- function Deferred() {
- var _this = this;
-
- classCallCheck(this, Deferred);
-
-
-
- this._value = undefined;
-
-
-
- this._resolve = undefined;
-
-
-
- this._promise = new Promise(function (resolve) {
- _this._resolve = resolve;
-
- if (_this._value) {
- resolve(_this._value);
- }
- });
- }
-
-
-
-
-
- createClass(Deferred, [{
- key: 'resolve',
- value: function resolve(value) {
- if (this._value) {
- throw new Error('Already resolved.');
- }
-
- this._value = value;
-
- if (this._resolve) {
- this._resolve(value);
- }
- }
-
-
-
-
- }, {
- key: 'toPromise',
- value: function toPromise() {
- return this._promise;
- }
- }]);
- return Deferred;
- }();
-
-
-
- var CustomElementRegistry = function () {
-
-
-
- function CustomElementRegistry(internals) {
- classCallCheck(this, CustomElementRegistry);
-
-
-
- this._elementDefinitionIsRunning = false;
-
-
-
- this._internals = internals;
-
-
-
- this._whenDefinedDeferred = new Map();
-
-
-
- this._flushCallback = function (fn) {
- return fn();
- };
-
-
-
- this._flushPending = false;
-
-
-
- this._unflushedLocalNames = [];
-
-
-
- this._documentConstructionObserver = new DocumentConstructionObserver(internals, document);
- }
-
-
-
-
-
- createClass(CustomElementRegistry, [{
- key: 'define',
- value: function define(localName, constructor) {
- var _this = this;
-
- if (!(constructor instanceof Function)) {
- throw new TypeError('Custom element constructors must be functions.');
- }
-
- if (!isValidCustomElementName(localName)) {
- throw new SyntaxError('The element name \'' + localName + '\' is not valid.');
- }
-
- if (this._internals.localNameToDefinition(localName)) {
- throw new Error('A custom element with name \'' + localName + '\' has already been defined.');
- }
-
- if (this._elementDefinitionIsRunning) {
- throw new Error('A custom element is already being defined.');
- }
- this._elementDefinitionIsRunning = true;
-
- var connectedCallback = void 0;
- var disconnectedCallback = void 0;
- var adoptedCallback = void 0;
- var attributeChangedCallback = void 0;
- var observedAttributes = void 0;
- try {
- var getCallback = function getCallback(name) {
- var callbackValue = prototype[name];
- if (callbackValue !== undefined && !(callbackValue instanceof Function)) {
- throw new Error('The \'' + name + '\' callback must be a function.');
- }
- return callbackValue;
- };
-
-
- var prototype = constructor.prototype;
- if (!(prototype instanceof Object)) {
- throw new TypeError('The custom element constructor\'s prototype is not an object.');
- }
-
- connectedCallback = getCallback('connectedCallback');
- disconnectedCallback = getCallback('disconnectedCallback');
- adoptedCallback = getCallback('adoptedCallback');
- attributeChangedCallback = getCallback('attributeChangedCallback');
- observedAttributes = constructor['observedAttributes'] || [];
- } catch (e) {
- return;
- } finally {
- this._elementDefinitionIsRunning = false;
- }
-
- var definition = {
- localName: localName,
- constructor: constructor,
- connectedCallback: connectedCallback,
- disconnectedCallback: disconnectedCallback,
- adoptedCallback: adoptedCallback,
- attributeChangedCallback: attributeChangedCallback,
- observedAttributes: observedAttributes,
- constructionStack: []
- };
-
- this._internals.setDefinition(localName, definition);
-
- this._unflushedLocalNames.push(localName);
-
- // If we've already called the flush callback and it hasn't called back yet,
- // don't call it again.
- if (!this._flushPending) {
- this._flushPending = true;
- this._flushCallback(function () {
- return _this._flush();
- });
- }
- }
- }, {
- key: '_flush',
- value: function _flush() {
-
-
-
- if (this._flushPending === false) return;
-
- this._flushPending = false;
- this._internals.patchAndUpgradeTree(document);
-
- while (this._unflushedLocalNames.length > 0) {
- var localName = this._unflushedLocalNames.shift();
- var deferred = this._whenDefinedDeferred.get(localName);
- if (deferred) {
- deferred.resolve(undefined);
- }
- }
- }
-
-
-
-
- }, {
- key: 'get',
- value: function get$$1(localName) {
- var definition = this._internals.localNameToDefinition(localName);
- if (definition) {
- return definition.constructor;
- }
-
- return undefined;
- }
-
-
-
-
- }, {
- key: 'whenDefined',
- value: function whenDefined(localName) {
- if (!isValidCustomElementName(localName)) {
- return Promise.reject(new SyntaxError('\'' + localName + '\' is not a valid custom element name.'));
- }
-
- var prior = this._whenDefinedDeferred.get(localName);
- if (prior) {
- return prior.toPromise();
- }
-
- var deferred = new Deferred();
- this._whenDefinedDeferred.set(localName, deferred);
-
- var definition = this._internals.localNameToDefinition(localName);
-
-
-
- if (definition && this._unflushedLocalNames.indexOf(localName) === -1) {
- deferred.resolve(undefined);
- }
-
- return deferred.toPromise();
- }
- }, {
- key: 'polyfillWrapFlushCallback',
- value: function polyfillWrapFlushCallback(outer) {
- this._documentConstructionObserver.disconnect();
- var inner = this._flushCallback;
- this._flushCallback = function (flush) {
- return outer(function () {
- return inner(flush);
- });
- };
- }
- }]);
- return CustomElementRegistry;
- }();
-
- window['CustomElementRegistry'] = CustomElementRegistry;
- CustomElementRegistry.prototype['define'] = CustomElementRegistry.prototype.define;
- CustomElementRegistry.prototype['get'] = CustomElementRegistry.prototype.get;
- CustomElementRegistry.prototype['whenDefined'] = CustomElementRegistry.prototype.whenDefined;
- CustomElementRegistry.prototype['polyfillWrapFlushCallback'] = CustomElementRegistry.prototype.polyfillWrapFlushCallback;
-
- var Native = {
- Document_createElement: window.Document.prototype.createElement,
- Document_createElementNS: window.Document.prototype.createElementNS,
- Document_importNode: window.Document.prototype.importNode,
- Document_prepend: window.Document.prototype['prepend'],
- Document_append: window.Document.prototype['append'],
- Node_cloneNode: window.Node.prototype.cloneNode,
- Node_appendChild: window.Node.prototype.appendChild,
- Node_insertBefore: window.Node.prototype.insertBefore,
- Node_removeChild: window.Node.prototype.removeChild,
- Node_replaceChild: window.Node.prototype.replaceChild,
- Node_textContent: Object.getOwnPropertyDescriptor(window.Node.prototype, 'textContent'),
- Element_attachShadow: window.Element.prototype['attachShadow'],
- Element_innerHTML: Object.getOwnPropertyDescriptor(window.Element.prototype, 'innerHTML'),
- Element_getAttribute: window.Element.prototype.getAttribute,
- Element_setAttribute: window.Element.prototype.setAttribute,
- Element_removeAttribute: window.Element.prototype.removeAttribute,
- Element_getAttributeNS: window.Element.prototype.getAttributeNS,
- Element_setAttributeNS: window.Element.prototype.setAttributeNS,
- Element_removeAttributeNS: window.Element.prototype.removeAttributeNS,
- Element_insertAdjacentElement: window.Element.prototype['insertAdjacentElement'],
- Element_prepend: window.Element.prototype['prepend'],
- Element_append: window.Element.prototype['append'],
- Element_before: window.Element.prototype['before'],
- Element_after: window.Element.prototype['after'],
- Element_replaceWith: window.Element.prototype['replaceWith'],
- Element_remove: window.Element.prototype['remove'],
- HTMLElement: window.HTMLElement,
- HTMLElement_innerHTML: Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, 'innerHTML'),
- HTMLElement_insertAdjacentElement: window.HTMLElement.prototype['insertAdjacentElement']
- };
-
-
- var AlreadyConstructedMarker = function AlreadyConstructedMarker() {
- classCallCheck(this, AlreadyConstructedMarker);
- };
-
- var AlreadyConstructedMarker$1 = new AlreadyConstructedMarker();
-
-
- var PatchHTMLElement = function (internals) {
- window['HTMLElement'] = function () {
-
-
- function HTMLElement() {
-
-
-
-
- var constructor = this.constructor;
-
- var definition = internals.constructorToDefinition(constructor);
- if (!definition) {
- throw new Error('The custom element being constructed was not registered with `customElements`.');
- }
-
- var constructionStack = definition.constructionStack;
-
- if (constructionStack.length === 0) {
- var _element = Native.Document_createElement.call(document, definition.localName);
- Object.setPrototypeOf(_element, constructor.prototype);
- _element.__CE_state = CustomElementState.custom;
- _element.__CE_definition = definition;
- internals.patch(_element);
- return _element;
- }
-
- var lastIndex = constructionStack.length - 1;
- var element = constructionStack[lastIndex];
- if (element === AlreadyConstructedMarker$1) {
- throw new Error('The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.');
- }
- constructionStack[lastIndex] = AlreadyConstructedMarker$1;
-
- Object.setPrototypeOf(element, constructor.prototype);
- internals.patch( /** @type {!HTMLElement} */element);
-
- return element;
- }
-
- HTMLElement.prototype = Native.HTMLElement.prototype;
-
- return HTMLElement;
- }();
- };
-
- /**
- * @param {!CustomElementInternals} internals
- * @param {!Object} destination
- * @param {!ParentNodeNativeMethods} builtIn
- */
- var PatchParentNode = function (internals, destination, builtIn) {
- /**
- * @param {...(!Node|string)} nodes
- */
- destination['prepend'] = function () {
- for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
- nodes[_key] = arguments[_key];
- }
-
- // TODO: Fix this for when one of `nodes` is a DocumentFragment!
- var connectedBefore = /** @type {!Array<!Node>} */nodes.filter(function (node) {
- // DocumentFragments are not connected and will not be added to the list.
- return node instanceof Node && isConnected(node);
- });
-
- builtIn.prepend.apply(this, nodes);
-
- for (var i = 0; i < connectedBefore.length; i++) {
- internals.disconnectTree(connectedBefore[i]);
- }
-
- if (isConnected(this)) {
- for (var _i = 0; _i < nodes.length; _i++) {
- var node = nodes[_i];
- if (node instanceof Element) {
- internals.connectTree(node);
- }
- }
- }
- };
-
- /**
- * @param {...(!Node|string)} nodes
- */
- destination['append'] = function () {
- for (var _len2 = arguments.length, nodes = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- nodes[_key2] = arguments[_key2];
- }
-
- // TODO: Fix this for when one of `nodes` is a DocumentFragment!
- var connectedBefore = /** @type {!Array<!Node>} */nodes.filter(function (node) {
- // DocumentFragments are not connected and will not be added to the list.
- return node instanceof Node && isConnected(node);
- });
-
- builtIn.append.apply(this, nodes);
-
- for (var i = 0; i < connectedBefore.length; i++) {
- internals.disconnectTree(connectedBefore[i]);
- }
-
- if (isConnected(this)) {
- for (var _i2 = 0; _i2 < nodes.length; _i2++) {
- var node = nodes[_i2];
- if (node instanceof Element) {
- internals.connectTree(node);
- }
- }
- }
- };
- };
-
- /**
- * @param {!CustomElementInternals} internals
- */
- var PatchDocument = function (internals) {
- setPropertyUnchecked(Document.prototype, 'createElement',
- /**
- * @this {Document}
- * @param {string} localName
- * @return {!Element}
- */
- function (localName) {
- // Only create custom elements if this document is associated with the registry.
- if (this.__CE_hasRegistry) {
- var definition = internals.localNameToDefinition(localName);
- if (definition) {
- return new definition.constructor();
- }
- }
-
- var result = /** @type {!Element} */
- Native.Document_createElement.call(this, localName);
- internals.patch(result);
- return result;
- });
-
- setPropertyUnchecked(Document.prototype, 'importNode',
- /**
- * @this {Document}
- * @param {!Node} node
- * @param {boolean=} deep
- * @return {!Node}
- */
- function (node, deep) {
- var clone = Native.Document_importNode.call(this, node, deep);
- // Only create custom elements if this document is associated with the registry.
- if (!this.__CE_hasRegistry) {
- internals.patchTree(clone);
- } else {
- internals.patchAndUpgradeTree(clone);
- }
- return clone;
- });
-
- var NS_HTML = "http://www.w3.org/1999/xhtml";
-
- setPropertyUnchecked(Document.prototype, 'createElementNS',
- /**
- * @this {Document}
- * @param {?string} namespace
- * @param {string} localName
- * @return {!Element}
- */
- function (namespace, localName) {
- // Only create custom elements if this document is associated with the registry.
- if (this.__CE_hasRegistry && (namespace === null || namespace === NS_HTML)) {
- var definition = internals.localNameToDefinition(localName);
- if (definition) {
- return new definition.constructor();
- }
- }
-
- var result = /** @type {!Element} */
- Native.Document_createElementNS.call(this, namespace, localName);
- internals.patch(result);
- return result;
- });
-
- PatchParentNode(internals, Document.prototype, {
- prepend: Native.Document_prepend,
- append: Native.Document_append
- });
- };
-
- /**
- * @param {!CustomElementInternals} internals
- */
- var PatchNode = function (internals) {
- // `Node#nodeValue` is implemented on `Attr`.
- // `Node#textContent` is implemented on `Attr`, `Element`.
-
- setPropertyUnchecked(Node.prototype, 'insertBefore',
- /**
- * @this {Node}
- * @param {!Node} node
- * @param {?Node} refNode
- * @return {!Node}
- */
- function (node, refNode) {
- if (node instanceof DocumentFragment) {
- var insertedNodes = Array.prototype.slice.apply(node.childNodes);
- var _nativeResult = Native.Node_insertBefore.call(this, node, refNode);
-
- // DocumentFragments can't be connected, so `disconnectTree` will never
- // need to be called on a DocumentFragment's children after inserting it.
-
- if (isConnected(this)) {
- for (var i = 0; i < insertedNodes.length; i++) {
- internals.connectTree(insertedNodes[i]);
- }
- }
-
- return _nativeResult;
- }
-
- var nodeWasConnected = isConnected(node);
- var nativeResult = Native.Node_insertBefore.call(this, node, refNode);
-
- if (nodeWasConnected) {
- internals.disconnectTree(node);
- }
-
- if (isConnected(this)) {
- internals.connectTree(node);
- }
-
- return nativeResult;
- });
-
- setPropertyUnchecked(Node.prototype, 'appendChild',
- /**
- * @this {Node}
- * @param {!Node} node
- * @return {!Node}
- */
- function (node) {
- if (node instanceof DocumentFragment) {
- var insertedNodes = Array.prototype.slice.apply(node.childNodes);
- var _nativeResult2 = Native.Node_appendChild.call(this, node);
-
- // DocumentFragments can't be connected, so `disconnectTree` will never
- // need to be called on a DocumentFragment's children after inserting it.
-
- if (isConnected(this)) {
- for (var i = 0; i < insertedNodes.length; i++) {
- internals.connectTree(insertedNodes[i]);
- }
- }
-
- return _nativeResult2;
- }
-
- var nodeWasConnected = isConnected(node);
- var nativeResult = Native.Node_appendChild.call(this, node);
-
- if (nodeWasConnected) {
- internals.disconnectTree(node);
- }
-
- if (isConnected(this)) {
- internals.connectTree(node);
- }
-
- return nativeResult;
- });
-
- setPropertyUnchecked(Node.prototype, 'cloneNode',
- /**
- * @this {Node}
- * @param {boolean=} deep
- * @return {!Node}
- */
- function (deep) {
- var clone = Native.Node_cloneNode.call(this, deep);
- // Only create custom elements if this element's owner document is
- // associated with the registry.
- if (!this.ownerDocument.__CE_hasRegistry) {
- internals.patchTree(clone);
- } else {
- internals.patchAndUpgradeTree(clone);
- }
- return clone;
- });
-
- setPropertyUnchecked(Node.prototype, 'removeChild',
- /**
- * @this {Node}
- * @param {!Node} node
- * @return {!Node}
- */
- function (node) {
- var nodeWasConnected = isConnected(node);
- var nativeResult = Native.Node_removeChild.call(this, node);
-
- if (nodeWasConnected) {
- internals.disconnectTree(node);
- }
-
- return nativeResult;
- });
-
- setPropertyUnchecked(Node.prototype, 'replaceChild',
- /**
- * @this {Node}
- * @param {!Node} nodeToInsert
- * @param {!Node} nodeToRemove
- * @return {!Node}
- */
- function (nodeToInsert, nodeToRemove) {
- if (nodeToInsert instanceof DocumentFragment) {
- var insertedNodes = Array.prototype.slice.apply(nodeToInsert.childNodes);
- var _nativeResult3 = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);
-
- // DocumentFragments can't be connected, so `disconnectTree` will never
- // need to be called on a DocumentFragment's children after inserting it.
-
- if (isConnected(this)) {
- internals.disconnectTree(nodeToRemove);
- for (var i = 0; i < insertedNodes.length; i++) {
- internals.connectTree(insertedNodes[i]);
- }
- }
-
- return _nativeResult3;
- }
-
- var nodeToInsertWasConnected = isConnected(nodeToInsert);
- var nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);
- var thisIsConnected = isConnected(this);
-
- if (thisIsConnected) {
- internals.disconnectTree(nodeToRemove);
- }
-
- if (nodeToInsertWasConnected) {
- internals.disconnectTree(nodeToInsert);
- }
-
- if (thisIsConnected) {
- internals.connectTree(nodeToInsert);
- }
-
- return nativeResult;
- });
-
- function patch_textContent(destination, baseDescriptor) {
- Object.defineProperty(destination, 'textContent', {
- enumerable: baseDescriptor.enumerable,
- configurable: true,
- get: baseDescriptor.get,
- set: /** @this {Node} */function set(assignedValue) {
- // If this is a text node then there are no nodes to disconnect.
- if (this.nodeType === Node.TEXT_NODE) {
- baseDescriptor.set.call(this, assignedValue);
- return;
- }
-
- var removedNodes = undefined;
- // Checking for `firstChild` is faster than reading `childNodes.length`
- // to compare with 0.
- if (this.firstChild) {
- // Using `childNodes` is faster than `children`, even though we only
- // care about elements.
- var childNodes = this.childNodes;
- var childNodesLength = childNodes.length;
- if (childNodesLength > 0 && isConnected(this)) {
- // Copying an array by iterating is faster than using slice.
- removedNodes = new Array(childNodesLength);
- for (var i = 0; i < childNodesLength; i++) {
- removedNodes[i] = childNodes[i];
- }
- }
- }
-
- baseDescriptor.set.call(this, assignedValue);
-
- if (removedNodes) {
- for (var _i = 0; _i < removedNodes.length; _i++) {
- internals.disconnectTree(removedNodes[_i]);
- }
- }
- }
- });
- }
-
- if (Native.Node_textContent && Native.Node_textContent.get) {
- patch_textContent(Node.prototype, Native.Node_textContent);
- } else {
- internals.addPatch(function (element) {
- patch_textContent(element, {
- enumerable: true,
- configurable: true,
- // NOTE: This implementation of the `textContent` getter assumes that
- // text nodes' `textContent` getter will not be patched.
- get: /** @this {Node} */function get() {
- /** @type {!Array<string>} */
- var parts = [];
-
- for (var i = 0; i < this.childNodes.length; i++) {
- parts.push(this.childNodes[i].textContent);
- }
-
- return parts.join('');
- },
- set: /** @this {Node} */function set(assignedValue) {
- while (this.firstChild) {
- Native.Node_removeChild.call(this, this.firstChild);
- }
- Native.Node_appendChild.call(this, document.createTextNode(assignedValue));
- }
- });
- });
- }
- };
-
- /**
- * @param {!CustomElementInternals} internals
- * @param {!Object} destination
- * @param {!ChildNodeNativeMethods} builtIn
- */
- var PatchChildNode = function (internals, destination, builtIn) {
- /**
- * @param {...(!Node|string)} nodes
- */
- destination['before'] = function () {
- for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
- nodes[_key] = arguments[_key];
- }
-
- // TODO: Fix this for when one of `nodes` is a DocumentFragment!
- var connectedBefore = /** @type {!Array<!Node>} */nodes.filter(function (node) {
- // DocumentFragments are not connected and will not be added to the list.
- return node instanceof Node && isConnected(node);
- });
-
- builtIn.before.apply(this, nodes);
-
- for (var i = 0; i < connectedBefore.length; i++) {
- internals.disconnectTree(connectedBefore[i]);
- }
-
- if (isConnected(this)) {
- for (var _i = 0; _i < nodes.length; _i++) {
- var node = nodes[_i];
- if (node instanceof Element) {
- internals.connectTree(node);
- }
- }
- }
- };
-
- /**
- * @param {...(!Node|string)} nodes
- */
- destination['after'] = function () {
- for (var _len2 = arguments.length, nodes = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- nodes[_key2] = arguments[_key2];
- }
-
- // TODO: Fix this for when one of `nodes` is a DocumentFragment!
- var connectedBefore = /** @type {!Array<!Node>} */nodes.filter(function (node) {
- // DocumentFragments are not connected and will not be added to the list.
- return node instanceof Node && isConnected(node);
- });
-
- builtIn.after.apply(this, nodes);
-
- for (var i = 0; i < connectedBefore.length; i++) {
- internals.disconnectTree(connectedBefore[i]);
- }
-
- if (isConnected(this)) {
- for (var _i2 = 0; _i2 < nodes.length; _i2++) {
- var node = nodes[_i2];
- if (node instanceof Element) {
- internals.connectTree(node);
- }
- }
- }
- };
-
- /**
- * @param {...(!Node|string)} nodes
- */
- destination['replaceWith'] = function () {
- for (var _len3 = arguments.length, nodes = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- nodes[_key3] = arguments[_key3];
- }
-
- // TODO: Fix this for when one of `nodes` is a DocumentFragment!
- var connectedBefore = /** @type {!Array<!Node>} */nodes.filter(function (node) {
- // DocumentFragments are not connected and will not be added to the list.
- return node instanceof Node && isConnected(node);
- });
-
- var wasConnected = isConnected(this);
-
- builtIn.replaceWith.apply(this, nodes);
-
- for (var i = 0; i < connectedBefore.length; i++) {
- internals.disconnectTree(connectedBefore[i]);
- }
-
- if (wasConnected) {
- internals.disconnectTree(this);
- for (var _i3 = 0; _i3 < nodes.length; _i3++) {
- var node = nodes[_i3];
- if (node instanceof Element) {
- internals.connectTree(node);
- }
- }
- }
- };
-
- destination['remove'] = function () {
- var wasConnected = isConnected(this);
-
- builtIn.remove.call(this);
-
- if (wasConnected) {
- internals.disconnectTree(this);
- }
- };
- };
-
- /**
- * @param {!CustomElementInternals} internals
- */
- var PatchElement = function (internals) {
- if (Native.Element_attachShadow) {
- setPropertyUnchecked(Element.prototype, 'attachShadow',
- /**
- * @this {Element}
- * @param {!{mode: string}} init
- * @return {ShadowRoot}
- */
- function (init) {
- var shadowRoot = Native.Element_attachShadow.call(this, init);
- this.__CE_shadowRoot = shadowRoot;
- return shadowRoot;
- });
- } else {
- console.warn('Custom Elements: `Element#attachShadow` was not patched.');
- }
-
- function patch_innerHTML(destination, baseDescriptor) {
- Object.defineProperty(destination, 'innerHTML', {
- enumerable: baseDescriptor.enumerable,
- configurable: true,
- get: baseDescriptor.get,
- set: /** @this {Element} */function set(htmlString) {
- var _this = this;
-
- var isConnected$$1 = isConnected(this);
-
- // NOTE: In IE11, when using the native `innerHTML` setter, all nodes
- // that were previously descendants of the context element have all of
- // their children removed as part of the set - the entire subtree is
- // 'disassembled'. This work around walks the subtree *before* using the
- // native setter.
- /** @type {!Array<!Element>|undefined} */
- var removedElements = undefined;
- if (isConnected$$1) {
- removedElements = [];
- walkDeepDescendantElements(this, function (element) {
- if (element !== _this) {
- removedElements.push(element);
- }
- });
- }
-
- baseDescriptor.set.call(this, htmlString);
-
- if (removedElements) {
- for (var i = 0; i < removedElements.length; i++) {
- var element = removedElements[i];
- if (element.__CE_state === CustomElementState.custom) {
- internals.disconnectedCallback(element);
- }
- }
- }
-
- // Only create custom elements if this element's owner document is
- // associated with the registry.
- if (!this.ownerDocument.__CE_hasRegistry) {
- internals.patchTree(this);
- } else {
- internals.patchAndUpgradeTree(this);
- }
- return htmlString;
- }
- });
- }
-
- if (Native.Element_innerHTML && Native.Element_innerHTML.get) {
- patch_innerHTML(Element.prototype, Native.Element_innerHTML);
- } else if (Native.HTMLElement_innerHTML && Native.HTMLElement_innerHTML.get) {
- patch_innerHTML(HTMLElement.prototype, Native.HTMLElement_innerHTML);
- } else {
-
- /** @type {HTMLDivElement} */
- var rawDiv = Native.Document_createElement.call(document, 'div');
-
- internals.addPatch(function (element) {
- patch_innerHTML(element, {
- enumerable: true,
- configurable: true,
- // Implements getting `innerHTML` by performing an unpatched `cloneNode`
- // of the element and returning the resulting element's `innerHTML`.
- // TODO: Is this too expensive?
- get: /** @this {Element} */function get() {
- return Native.Node_cloneNode.call(this, true).innerHTML;
- },
- // Implements setting `innerHTML` by creating an unpatched element,
- // setting `innerHTML` of that element and replacing the target
- // element's children with those of the unpatched element.
- set: /** @this {Element} */function set(assignedValue) {
- // NOTE: re-route to `content` for `template` elements.
- // We need to do this because `template.appendChild` does not
- // route into `template.content`.
- /** @type {!Node} */
- var content = this.localName === 'template' ? /** @type {!HTMLTemplateElement} */this.content : this;
- rawDiv.innerHTML = assignedValue;
-
- while (content.childNodes.length > 0) {
- Native.Node_removeChild.call(content, content.childNodes[0]);
- }
- while (rawDiv.childNodes.length > 0) {
- Native.Node_appendChild.call(content, rawDiv.childNodes[0]);
- }
- }
- });
- });
- }
-
- setPropertyUnchecked(Element.prototype, 'setAttribute',
- /**
- * @this {Element}
- * @param {string} name
- * @param {string} newValue
- */
- function (name, newValue) {
- // Fast path for non-custom elements.
- if (this.__CE_state !== CustomElementState.custom) {
- return Native.Element_setAttribute.call(this, name, newValue);
- }
-
- var oldValue = Native.Element_getAttribute.call(this, name);
- Native.Element_setAttribute.call(this, name, newValue);
- newValue = Native.Element_getAttribute.call(this, name);
- internals.attributeChangedCallback(this, name, oldValue, newValue, null);
- });
-
- setPropertyUnchecked(Element.prototype, 'setAttributeNS',
- /**
- * @this {Element}
- * @param {?string} namespace
- * @param {string} name
- * @param {string} newValue
- */
- function (namespace, name, newValue) {
- // Fast path for non-custom elements.
- if (this.__CE_state !== CustomElementState.custom) {
- return Native.Element_setAttributeNS.call(this, namespace, name, newValue);
- }
-
- var oldValue = Native.Element_getAttributeNS.call(this, namespace, name);
- Native.Element_setAttributeNS.call(this, namespace, name, newValue);
- newValue = Native.Element_getAttributeNS.call(this, namespace, name);
- internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);
- });
-
- setPropertyUnchecked(Element.prototype, 'removeAttribute',
- /**
- * @this {Element}
- * @param {string} name
- */
- function (name) {
- // Fast path for non-custom elements.
- if (this.__CE_state !== CustomElementState.custom) {
- return Native.Element_removeAttribute.call(this, name);
- }
-
- var oldValue = Native.Element_getAttribute.call(this, name);
- Native.Element_removeAttribute.call(this, name);
- if (oldValue !== null) {
- internals.attributeChangedCallback(this, name, oldValue, null, null);
- }
- });
-
- setPropertyUnchecked(Element.prototype, 'removeAttributeNS',
- /**
- * @this {Element}
- * @param {?string} namespace
- * @param {string} name
- */
- function (namespace, name) {
- // Fast path for non-custom elements.
- if (this.__CE_state !== CustomElementState.custom) {
- return Native.Element_removeAttributeNS.call(this, namespace, name);
- }
-
- var oldValue = Native.Element_getAttributeNS.call(this, namespace, name);
- Native.Element_removeAttributeNS.call(this, namespace, name);
- // In older browsers, `Element#getAttributeNS` may return the empty string
- // instead of null if the attribute does not exist. For details, see;
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNS#Notes
- var newValue = Native.Element_getAttributeNS.call(this, namespace, name);
- if (oldValue !== newValue) {
- internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);
- }
- });
-
- function patch_insertAdjacentElement(destination, baseMethod) {
- setPropertyUnchecked(destination, 'insertAdjacentElement',
- /**
- * @this {Element}
- * @param {string} where
- * @param {!Element} element
- * @return {?Element}
- */
- function (where, element) {
- var wasConnected = isConnected(element);
- var insertedElement = /** @type {!Element} */
- baseMethod.call(this, where, element);
-
- if (wasConnected) {
- internals.disconnectTree(element);
- }
-
- if (isConnected(insertedElement)) {
- internals.connectTree(element);
- }
- return insertedElement;
- });
- }
-
- if (Native.HTMLElement_insertAdjacentElement) {
- patch_insertAdjacentElement(HTMLElement.prototype, Native.HTMLElement_insertAdjacentElement);
- } else if (Native.Element_insertAdjacentElement) {
- patch_insertAdjacentElement(Element.prototype, Native.Element_insertAdjacentElement);
- } else {
- console.warn('Custom Elements: `Element#insertAdjacentElement` was not patched.');
- }
-
- PatchParentNode(internals, Element.prototype, {
- prepend: Native.Element_prepend,
- append: Native.Element_append
- });
-
- PatchChildNode(internals, Element.prototype, {
- before: Native.Element_before,
- after: Native.Element_after,
- replaceWith: Native.Element_replaceWith,
- remove: Native.Element_remove
- });
- };
-
- /**
- * @license
- * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
- * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
- * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
- * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
- * Code distributed by Google as part of the polymer project is also
- * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
- */
-
- var priorCustomElements = window['customElements'];
-
- if (!priorCustomElements || priorCustomElements['forcePolyfill'] || typeof priorCustomElements['define'] != 'function' || typeof priorCustomElements['get'] != 'function') {
- /** @type {!CustomElementInternals} */
- var internals = new CustomElementInternals();
-
- PatchHTMLElement(internals);
- PatchDocument(internals);
- PatchNode(internals);
- PatchElement(internals);
-
- // The main document is always associated with the registry.
- document.__CE_hasRegistry = true;
-
- /** @type {!CustomElementRegistry} */
- var customElements = new CustomElementRegistry(internals);
-
- Object.defineProperty(window, 'customElements', {
- configurable: true,
- enumerable: true,
- value: customElements
- });
- }
-
- /**
- * @license
- * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
- * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
- * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
- * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
- * Code distributed by Google as part of the polymer project is also
- * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
- */
- // @version 0.7.22
-
- (function (global) {
- if (global.JsMutationObserver) {
- return;
- }
- var registrationsTable = new WeakMap();
- var setImmediate;
- if (/Trident|Edge/.test(navigator.userAgent)) {
- setImmediate = setTimeout;
- } else if (window.setImmediate) {
- setImmediate = window.setImmediate;
- } else {
- var setImmediateQueue = [];
- var sentinel = String(Math.random());
- window.addEventListener("message", function (e) {
- if (e.data === sentinel) {
- var queue = setImmediateQueue;
- setImmediateQueue = [];
- queue.forEach(function (func) {
- func();
- });
- }
- });
- setImmediate = function setImmediate(func) {
- setImmediateQueue.push(func);
- window.postMessage(sentinel, "*");
- };
- }
- var isScheduled = false;
- var scheduledObservers = [];
- function scheduleCallback(observer) {
- scheduledObservers.push(observer);
- if (!isScheduled) {
- isScheduled = true;
- setImmediate(dispatchCallbacks);
- }
- }
- function wrapIfNeeded(node) {
- return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
- }
- function dispatchCallbacks() {
- isScheduled = false;
- var observers = scheduledObservers;
- scheduledObservers = [];
- observers.sort(function (o1, o2) {
- return o1.uid_ - o2.uid_;
- });
- var anyNonEmpty = false;
- observers.forEach(function (observer) {
- var queue = observer.takeRecords();
- removeTransientObserversFor(observer);
- if (queue.length) {
- observer.callback_(queue, observer);
- anyNonEmpty = true;
- }
- });
- if (anyNonEmpty) dispatchCallbacks();
- }
- function removeTransientObserversFor(observer) {
- observer.nodes_.forEach(function (node) {
- var registrations = registrationsTable.get(node);
- if (!registrations) return;
- registrations.forEach(function (registration) {
- if (registration.observer === observer) registration.removeTransientObservers();
- });
- });
- }
- function forEachAncestorAndObserverEnqueueRecord(target, callback) {
- for (var node = target; node; node = node.parentNode) {
- var registrations = registrationsTable.get(node);
- if (registrations) {
- for (var j = 0; j < registrations.length; j++) {
- var registration = registrations[j];
- var options = registration.options;
- if (node !== target && !options.subtree) continue;
- var record = callback(options);
- if (record) registration.enqueue(record);
- }
- }
- }
- }
- var uidCounter = 0;
- function JsMutationObserver(callback) {
- this.callback_ = callback;
- this.nodes_ = [];
- this.records_ = [];
- this.uid_ = ++uidCounter;
- }
- JsMutationObserver.prototype = {
- observe: function observe(target, options) {
- target = wrapIfNeeded(target);
- if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
- throw new SyntaxError();
- }
- var registrations = registrationsTable.get(target);
- if (!registrations) registrationsTable.set(target, registrations = []);
- var registration;
- for (var i = 0; i < registrations.length; i++) {
- if (registrations[i].observer === this) {
- registration = registrations[i];
- registration.removeListeners();
- registration.options = options;
- break;
- }
- }
- if (!registration) {
- registration = new Registration(this, target, options);
- registrations.push(registration);
- this.nodes_.push(target);
- }
- registration.addListeners();
- },
- disconnect: function disconnect() {
- this.nodes_.forEach(function (node) {
- var registrations = registrationsTable.get(node);
- for (var i = 0; i < registrations.length; i++) {
- var registration = registrations[i];
- if (registration.observer === this) {
- registration.removeListeners();
- registrations.splice(i, 1);
- break;
- }
- }
- }, this);
- this.records_ = [];
- },
- takeRecords: function takeRecords() {
- var copyOfRecords = this.records_;
- this.records_ = [];
- return copyOfRecords;
- }
- };
- function MutationRecord(type, target) {
- this.type = type;
- this.target = target;
- this.addedNodes = [];
- this.removedNodes = [];
- this.previousSibling = null;
- this.nextSibling = null;
- this.attributeName = null;
- this.attributeNamespace = null;
- this.oldValue = null;
- }
- function copyMutationRecord(original) {
- var record = new MutationRecord(original.type, original.target);
- record.addedNodes = original.addedNodes.slice();
- record.removedNodes = original.removedNodes.slice();
- record.previousSibling = original.previousSibling;
- record.nextSibling = original.nextSibling;
- record.attributeName = original.attributeName;
- record.attributeNamespace = original.attributeNamespace;
- record.oldValue = original.oldValue;
- return record;
- }
- var currentRecord, recordWithOldValue;
- function getRecord(type, target) {
- return currentRecord = new MutationRecord(type, target);
- }
- function getRecordWithOldValue(oldValue) {
- if (recordWithOldValue) return recordWithOldValue;
- recordWithOldValue = copyMutationRecord(currentRecord);
- recordWithOldValue.oldValue = oldValue;
- return recordWithOldValue;
- }
- function clearRecords() {
- currentRecord = recordWithOldValue = undefined;
- }
- function recordRepresentsCurrentMutation(record) {
- return record === recordWithOldValue || record === currentRecord;
- }
- function selectRecord(lastRecord, newRecord) {
- if (lastRecord === newRecord) return lastRecord;
- if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
- return null;
- }
- function Registration(observer, target, options) {
- this.observer = observer;
- this.target = target;
- this.options = options;
- this.transientObservedNodes = [];
- }
- Registration.prototype = {
- enqueue: function enqueue(record) {
- var records = this.observer.records_;
- var length = records.length;
- if (records.length > 0) {
- var lastRecord = records[length - 1];
- var recordToReplaceLast = selectRecord(lastRecord, record);
- if (recordToReplaceLast) {
- records[length - 1] = recordToReplaceLast;
- return;
- }
- } else {
- scheduleCallback(this.observer);
- }
- records[length] = record;
- },
- addListeners: function addListeners() {
- this.addListeners_(this.target);
- },
- addListeners_: function addListeners_(node) {
- var options = this.options;
- if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
- if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
- if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
- if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
- },
- removeListeners: function removeListeners() {
- this.removeListeners_(this.target);
- },
- removeListeners_: function removeListeners_(node) {
- var options = this.options;
- if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
- if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
- if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
- if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
- },
- addTransientObserver: function addTransientObserver(node) {
- if (node === this.target) return;
- this.addListeners_(node);
- this.transientObservedNodes.push(node);
- var registrations = registrationsTable.get(node);
- if (!registrations) registrationsTable.set(node, registrations = []);
- registrations.push(this);
- },
- removeTransientObservers: function removeTransientObservers() {
- var transientObservedNodes = this.transientObservedNodes;
- this.transientObservedNodes = [];
- transientObservedNodes.forEach(function (node) {
- this.removeListeners_(node);
- var registrations = registrationsTable.get(node);
- for (var i = 0; i < registrations.length; i++) {
- if (registrations[i] === this) {
- registrations.splice(i, 1);
- break;
- }
- }
- }, this);
- },
- handleEvent: function handleEvent(e) {
- e.stopImmediatePropagation();
- switch (e.type) {
- case "DOMAttrModified":
- var name = e.attrName;
- var namespace = e.relatedNode.namespaceURI;
- var target = e.target;
- var record = new getRecord("attributes", target);
- record.attributeName = name;
- record.attributeNamespace = namespace;
- var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
- forEachAncestorAndObserverEnqueueRecord(target, function (options) {
- if (!options.attributes) return;
- if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
- return;
- }
- if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
- return record;
- });
- break;
-
- case "DOMCharacterDataModified":
- var target = e.target;
- var record = getRecord("characterData", target);
- var oldValue = e.prevValue;
- forEachAncestorAndObserverEnqueueRecord(target, function (options) {
- if (!options.characterData) return;
- if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
- return record;
- });
- break;
-
- case "DOMNodeRemoved":
- this.addTransientObserver(e.target);
-
- case "DOMNodeInserted":
- var changedNode = e.target;
- var addedNodes, removedNodes;
- if (e.type === "DOMNodeInserted") {
- addedNodes = [changedNode];
- removedNodes = [];
- } else {
- addedNodes = [];
- removedNodes = [changedNode];
- }
- var previousSibling = changedNode.previousSibling;
- var nextSibling = changedNode.nextSibling;
- var record = getRecord("childList", e.target.parentNode);
- record.addedNodes = addedNodes;
- record.removedNodes = removedNodes;
- record.previousSibling = previousSibling;
- record.nextSibling = nextSibling;
- forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function (options) {
- if (!options.childList) return;
- return record;
- });
- }
- clearRecords();
- }
- };
- global.JsMutationObserver = JsMutationObserver;
- if (!global.MutationObserver) {
- global.MutationObserver = JsMutationObserver;
- JsMutationObserver._isPolyfilled = true;
- }
- })(self);
-
- /*
- Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- */
- (function (global, undefined) {
- if (global.setImmediate) {
- return;
- }
-
- var nextHandle = 1; // Spec says greater than zero
- var tasksByHandle = {};
- var currentlyRunningATask = false;
- var doc = global.document;
- var setImmediate;
-
- function addFromSetImmediateArguments(args) {
- tasksByHandle[nextHandle] = partiallyApplied.apply(undefined, args);
- return nextHandle++;
- }
-
- // This function accepts the same arguments as setImmediate, but
- // returns a function that requires no arguments.
- function partiallyApplied(handler) {
- var args = [].slice.call(arguments, 1);
- return function () {
- if (typeof handler === "function") {
- handler.apply(undefined, args);
- } else {
- new Function("" + handler)();
- }
- };
- }
-
- function runIfPresent(handle) {
-
-
- if (currentlyRunningATask) {
-
-
- setTimeout(partiallyApplied(runIfPresent, handle), 0);
- } else {
- var task = tasksByHandle[handle];
- if (task) {
- currentlyRunningATask = true;
- try {
- task();
- } finally {
- clearImmediate(handle);
- currentlyRunningATask = false;
- }
- }
- }
- }
-
- function clearImmediate(handle) {
- delete tasksByHandle[handle];
- }
-
- function installNextTickImplementation() {
- setImmediate = function setImmediate() {
- var handle = addFromSetImmediateArguments(arguments);
- process.nextTick(partiallyApplied(runIfPresent, handle));
- return handle;
- };
- }
-
- function canUsePostMessage() {
-
-
- if (global.postMessage && !global.importScripts) {
- var postMessageIsAsynchronous = true;
- var oldOnMessage = global.onmessage;
- global.onmessage = function () {
- postMessageIsAsynchronous = false;
- };
- global.postMessage("", "*");
- global.onmessage = oldOnMessage;
- return postMessageIsAsynchronous;
- }
- }
-
- function installPostMessageImplementation() {
-
-
-
-
- var messagePrefix = "setImmediate$" + Math.random() + "$";
- var onGlobalMessage = function onGlobalMessage(event) {
- if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
- runIfPresent(+event.data.slice(messagePrefix.length));
- }
- };
-
- if (global.addEventListener) {
- global.addEventListener("message", onGlobalMessage, false);
- } else {
- global.attachEvent("onmessage", onGlobalMessage);
- }
-
- setImmediate = function setImmediate() {
- var handle = addFromSetImmediateArguments(arguments);
- global.postMessage(messagePrefix + handle, "*");
- return handle;
- };
- }
-
- function installMessageChannelImplementation() {
- var channel = new MessageChannel();
- channel.port1.onmessage = function (event) {
- var handle = event.data;
- runIfPresent(handle);
- };
-
- setImmediate = function setImmediate() {
- var handle = addFromSetImmediateArguments(arguments);
- channel.port2.postMessage(handle);
- return handle;
- };
- }
-
- function installReadyStateChangeImplementation() {
- var html = doc.documentElement;
- setImmediate = function setImmediate() {
- var handle = addFromSetImmediateArguments(arguments);
-
-
- var script = doc.createElement("script");
- script.onreadystatechange = function () {
- runIfPresent(handle);
- script.onreadystatechange = null;
- html.removeChild(script);
- script = null;
- };
- html.appendChild(script);
- return handle;
- };
- }
-
- function installSetTimeoutImplementation() {
- setImmediate = function setImmediate() {
- var handle = addFromSetImmediateArguments(arguments);
- setTimeout(partiallyApplied(runIfPresent, handle), 0);
- return handle;
- };
- }
-
-
- var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
- attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
-
-
- if ({}.toString.call(global.process) === "[object process]") {
-
- installNextTickImplementation();
- } else if (canUsePostMessage()) {
-
- installPostMessageImplementation();
- } else if (global.MessageChannel) {
-
- installMessageChannelImplementation();
- } else if (doc && "onreadystatechange" in doc.createElement("script")) {
-
- installReadyStateChangeImplementation();
- } else {
-
- installSetTimeoutImplementation();
- }
-
- attachTo.setImmediate = setImmediate;
- attachTo.clearImmediate = clearImmediate;
- })(self);
-
-
-
-
-
-
-
-
-
-
-
-
- (function () {
- var DEFAULT_VIEWPORT = 'width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no';
-
- var Viewport = {
- ensureViewportElement: function ensureViewportElement() {
- var viewportElement = document.querySelector('meta[name=viewport]');
-
- if (!viewportElement) {
- viewportElement = document.createElement('meta');
- viewportElement.name = 'viewport';
- document.head.appendChild(viewportElement);
- }
-
- return viewportElement;
- },
-
- setup: function setup() {
- var viewportElement = Viewport.ensureViewportElement();
-
- if (!viewportElement) {
- return;
- }
-
- if (!viewportElement.hasAttribute('content')) {
- viewportElement.setAttribute('content', DEFAULT_VIEWPORT);
- }
- }
- };
-
- window.Viewport = Viewport;
- })();
-
- function setup(ons$$1) {
- if (window._onsLoaded) {
- ons$$1._util.warn('Onsen UI is loaded more than once.');
- }
- window._onsLoaded = true;
-
-
- window.addEventListener('load', function () {
- ons$$1.fastClick = fastclick_1.attach(document.body);
-
- var supportTouchAction = 'touch-action' in document.body.style;
-
- ons$$1.platform._runOnActualPlatform(function () {
- if (ons$$1.platform.isAndroid()) {
-
-
- ons$$1.fastClick.destroy();
- } else if (ons$$1.platform.isIOS()) {
- if (supportTouchAction && (ons$$1.platform.isIOSSafari() || ons$$1.platform.isWKWebView())) {
-
- ons$$1.fastClick.destroy();
- } else {
-
- }
- }
- });
- }, false);
-
- ons$$1.ready(function () {
- ons$$1.enableDeviceBackButtonHandler();
- ons$$1._defaultDeviceBackButtonHandler = ons$$1._internal.dbbDispatcher.createHandler(window.document.body, function () {
- if (Object.hasOwnProperty.call(navigator, 'app')) {
- navigator.app.exitApp();
- } else {
- console.warn('Could not close the app. Is \'cordova.js\' included?\nError: \'window.navigator.app\' is undefined.');
- }
- });
- document.body._gestureDetector = new ons$$1.GestureDetector(document.body, { passive: true });
-
-
- if (!ons$$1.platform.isWebView()) {
- document.body.addEventListener('keydown', function (event) {
- if (event.keyCode === 27) {
- ons$$1.fireDeviceBackButtonEvent();
- }
- });
- }
-
-
- ons$$1._setupLoadingPlaceHolders();
- });
-
-
- Viewport.setup();
- }
-
- setup(ons);
-
- export default ons;
|