PageSourceSearch

https://dorsetcountymuseum.org/packages/meteor.js?hash=efab427f990044cd5eda0dccf88cdcc5b07b7197

js dorsetcountymuseum.org collected 2026-10-01 12:18:36 UTC 54,550 bytes, 1,579 lines download raw bytes

1//////////////////////////////////////////////////////////////////////////
2//                                                                      //
3// This is a generated file. You can view the original                  //
4// source in your browser if your browser supports source maps.         //
5// Source maps are supported by all recent versions of Chrome, Safari,  //
6// and Firefox, and by Internet Explorer 11.                            //
7//                                                                      //
8//////////////////////////////////////////////////////////////////////////
9
10
11Package["core-runtime"].queue("meteor",function () {/* Package-scope variables */
12var global, meteorEnv, Meteor;
13
14(function(){
15
16/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
17//                                                                                                                     //
18// packages/meteor/global.js                                                                                           //
19//                                                                                                                     //
20/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
21                                                                                                                       //
22// Export a reliable global object for all Meteor code.
23global = this;
24
25/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
26
27}).call(this);
28
29
30
31
32
33
34(function(){
35
36/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
37//                                                                                                                     //
38// packages/meteor/client_environment.js                                                                               //
39//                                                                                                                     //
40/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
41                                                                                                                       //
42var config = __meteor_runtime_config__;
43meteorEnv = config.meteorEnv;
44
45/**
46 * @summary The Meteor namespace
47 * @namespace Meteor
48 */
49Meteor = {
50  /**
51   * @summary Boolean variable.  True if running in production environment.
52   * @locus Anywhere
53   * @static
54   * @type {Boolean}
55   */
56  isProduction: meteorEnv.NODE_ENV === "production",
57
58  /**
59   * @summary Boolean variable.  True if running in development environment.
60   * @locus Anywhere
61   * @static
62   * @type {Boolean}
63   */
64  isDevelopment: meteorEnv.NODE_ENV !== "production",
65
66  /**
67   * @summary Boolean variable.  True if running in client environment.
68   * @locus Anywhere
69   * @static
70   * @type {Boolean}
71   */
72  isClient: true,
73
74  /**
75   * @summary Boolean variable.  True if running in server environment.
76   * @locus Anywhere
77   * @static
78   * @type {Boolean}
79   */
80  isServer: false,
81
82  /**
83   * @summary Boolean variable.  True if running in Cordova environment.
84   * @locus Anywhere
85   * @static
86   * @type {Boolean}
87   */
88  isCordova: false,
89
90  /**
91   * @summary Boolean variable. True if running in a "modern" JS
92   *          environment, as determined by the `modern` package.
93   * @locus Anywhere
94   * @static
95   * @type {Boolean}
96   */
97  isModern: config.isModern
98};
99
100if (config.gitCommitHash) {
101  /**
102   * @summary Hexadecimal Git commit hash, if the application is using Git
103   *          for version control. Undefined otherwise.
104   * @locus Anywhere
105   * @static
106   * @type {String}
107   */
108  Meteor.gitCommitHash = config.gitCommitHash;
109}
110
111if (config.PUBLIC_SETTINGS) {
112  /**
113   * @summary `Meteor.settings` contains deployment-specific configuration options. You can initialize settings by passing the `--settings` option (which takes the name of a file containing JSON data) to `meteor run` or `meteor deploy`. When running your server directly (e.g. from a bundle), you instead specify settings by putting the JSON directly into the `METEOR_SETTINGS` environment variable. If the settings object c
113ontains a key named `public`, then `Meteor.settings.public` will be available on the client as well as the server.  All other properties of `Meteor.settings` are only defined on the server.  You can rely on `Meteor.settings` and `Meteor.settings.public` being defined objects (not undefined) on both client and server even if there are no settings specified.  Changes to `Meteor.settings.public` at runtime will be picked up by new client connections.
114   * @locus Anywhere
115   * @type {Object}
116   */
117  Meteor.settings = {
118    "public": config.PUBLIC_SETTINGS
119  };
120}
121
122/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
123
124}).call(this);
125
126
127
128
129
130
131(function(){
132
133/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
134//                                                                                                                     //
135// packages/meteor/helpers.js                                                                                          //
136//                                                                                                                     //
137/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
138                                                                                                                       //
139if (typeof __meteor_runtime_config__ === 'object' &&
140    __meteor_runtime_config__.meteorRelease) {
141  /**
142   * @summary `Meteor.release` is a string containing the name of the [release](#meteorupdate) with which the project was built (for example, `"1.2.3"`). It is `undefined` if the project was built using a git checkout of Meteor.
143   * @locus Anywhere
144   * @type {String}
145   */
146  Meteor.release = __meteor_runtime_config__.meteorRelease;
147}
148
149// XXX find a better home for these? Ideally they would be _.get,
150// _.ensure, _.delete..
151
152// _get(a,b,c,d) returns a[b][c][d], or else undefined if a[b] or
153// a[b][c] doesn't exist.
154//
155Meteor._get = function (obj /*, arguments */) {
156  for (var i = 1; i < arguments.length; i++) {
157    if (!(arguments[i] in obj))
158      return undefined;
159    obj = obj[arguments[i]];
160  }
161  return obj;
162};
163
164// _ensure(a,b,c,d) ensures that a[b][c][d] exists. If it does not,
165// it is created and set to {}. Either way, it is returned.
166//
167Meteor._ensure = function (obj /*, arguments */) {
168  for (var i = 1; i < arguments.length; i++) {
169    var key = arguments[i];
170    if (!(key in obj))
171      obj[key] = {};
172    obj = obj[key];
173  }
174
175  return obj;
176};
177
178// _delete(a, b, c, d) deletes a[b][c][d], then a[b][c] unless it
179// isn't empty, then a[b] unless it isn't empty.
180//
181Meteor._delete = function (obj /*, arguments */) {
182  var stack = [obj];
183  var leaf = true;
184  for (var i = 1; i < arguments.length - 1; i++) {
185    var key = arguments[i];
186    if (!(key in obj)) {
187      leaf = false;
188      break;
189    }
190    obj = obj[key];
191    if (typeof obj !== "object")
192      break;
193    stack.push(obj);
194  }
195
196  for (var i = stack.length - 1; i >= 0; i--) {
197    var key = arguments[i+1];
198
199    if (leaf)
200      leaf = false;
201    else
202      for (var other in stack[i][key])
203        return;
203 // not empty -- we're done
204
205    delete stack[i][key];
206  }
207};
208
209
210/**
211 * @memberOf Meteor
212 * @locus Anywhere
213 * @summary Takes a function that has a callback argument as the last one and promissify it.
214 * One option would be to use node utils.promisify, but it won't work on the browser.
215 * @param {Function} fn
216 * @param {Object} [context]
217 * @param {Boolean} [errorFirst] - If the callback follows the errorFirst style, default to true
218 * @returns {function(...[*]): Promise<unknown>}
219 */
220Meteor.promisify = function (fn, context, errorFirst) {
221  if (errorFirst === undefined) {
222    errorFirst = true;
223  }
224
225  return function () {
226    var self = this;
227    var filteredArgs = Array.prototype.slice.call(arguments)
228      .filter(function (i) { return i !== undefined; });
229
230    return new Promise(function (resolve, reject) {
231      var callback = Meteor.bindEnvironment(function (error, result) {
232        var _error = error, _result = result;
233        if (!errorFirst) {
234          _error = result;
235          _result = error;
236        }
237
238        if (_error) {
239          return reject(_error);
240        }
241
242        resolve(_result);
243      });
244
245      filteredArgs.push(callback);
246
247      return fn.apply(context || self, filteredArgs);
248    });
249  };
250};
251
252// wrapAsync can wrap any function that takes some number of arguments that
253// can't be undefined, followed by some optional arguments, where the callback
254// is the last optional argument.
255// e.g. fs.readFile(pathname, [callback]),
256// fs.open(pathname, flags, [mode], [callback])
257// For maximum effectiveness and least confusion, wrapAsync should be used on
258// functions where the callback is the only argument of type Function.
259
260/**
261 * @memberOf Meteor
262 * @summary Wrap a function that takes a callback function as its final parameter.
263 * The signature of the callback of the wrapped function should be `function(error, result){}`.
264 * On the server, the wrapped function can be used either synchronously (without passing a callback) or asynchronously
265 * (when a callback is passed). On the client, a callback is always required; errors will be logged if there is no callback.
266 * If a callback is provided, the environment captured when the original function was called will be restored in the callback.
267 * The parameters of the wrapped function must not contain any optional parameters or be undefined, as the callback function is expected to be the final, non-undefined parameter.
268 * @locus Anywhere
269 * @param {Function} func A function that takes a callback as its final parameter
270 * @param {Object} [context] Optional `this` object against which the original function will be invoked
271 */
272Meteor.wrapAsync = function (fn, context) {
273  return function (/* arguments */) {
274    var self = context || this;
275    var newArgs = Array.prototype.slice.call(arguments);
276    var callback;
277
278    for (var i = newArgs.length - 1; i >= 0; --i) {
279      var arg = newArgs[i];
280      var type = typeof arg;
281      if (type !== "undefined") {
282        if (type === "function") {
283          callback = arg;
284        }
285        break;
286      }
287    }
288
289    if (! callback) {
290      callback = logErr;
291      ++i; // Insert the callback just after arg.
292    }
293
294    newArgs[i] = Meteor.bindEnvironment(callback);
295    return fn.apply(self, newArgs);
296  };
297};
298
299Meteor.wrapFn = function (fn) {
300  return fn;
301};
302
303// Sets child's prototype to a new object whose prototype is parent's
304// prototype. Used as:
305//   Meteor._inherits(ClassB, ClassA).
306//   _.extend(ClassB.prototype, { ... })
307// Inspired by CoffeeScript's `extend` and Google Closure's `goog.inherits`.
308var hasOwn = Object.prototype.hasOwnProperty;
309Meteor._inherits = function (Child, Parent) {
310  // copy Parent static properties
311  for (var key in Parent) {
312    // make sure we only copy hasOwnProperty properties vs. prototype
313    // properties
314    if (hasOwn.call(Parent, key)) {
315      Child[key] = Parent[key];
316    }
317  }
318
319  // a middle member of prototype chain: takes the prototype from the Parent
320  var Middle = function () {
321    this.constructor = Child;
322  };
323  Middle.prototype = Parent.prototype;
324  Child.prototype = new Middle();
325  Child.__super__ = Parent.prototype;
326  return Child;
327};
328
329var warnedAboutWrapAsync = false;
330
331/**
332 * @deprecated in 0.9.3
333 */
334Meteor._wrapAsync = function(fn, context) {
335  if (! warnedAboutWrapAsync) {
336    Meteor._debug("Meteor._wrapAsync has been renamed to Meteor.wrapAsync");
337    warnedAboutWrapAsync = true;
338  }
339  return Meteor.wrapAsync.apply(Meteor, arguments);
340};
341
342function logErr(err) {
343  if (err) {
344    return Meteor._debug(
345      "Exception in callback of async function",
346      err
347    );
348  }
349}
350
351/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
352
353}).call(this);
354
355
356
357
358
359
360(function(){
361
362/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
363//                                                                                                                     //
364// packages/meteor/setimmediate.js                                                                                     //
365//                                                                                                                     //
366/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
367                                                                                                                       //
368// Chooses one of three setImmediate implementations:
369//
370// * Native setImmediate (IE 10, Node 0.9+)
371//
372// * postMessage (many browsers)
373//
374// * setTimeout  (fallback)
375//
376// The postMessage implementation is based on
377// https://github.com/NobleJS/setImmediate/tree/1.0.1
378//
379// Don't use `nextTick` for Node since it runs its callbacks before
380// I/O, which is stricter than we're looking for.
381//
382// Not installed as a polyfill, as our public API is `Meteor.defer`.
383// Since we're not trying to be a polyfill, we have some
384// simplifications:
385//
386// If one invocation of a setImmediate callback pauses itself by a
387// call to alert/prompt/showModelDialog, the NobleJS polyfill
388// implementation ensured that no setImmedate callback would run until
389// the first invocation completed.  While correct per the spec, what it
390// would mean for us in practice is that any reactive updates relying
391// on Meteor.defer would be hung in the main window until the modal
392// dialog was dismissed.  Thus we only ensure that a setImmediate
393// function is called in a later event loop.
394//
395// We don't need to support using a string to be eval'ed for the
396// callback, arguments to the function, or clearImmediate.
397
398"use strict";
399
400var global = this;
401
402
403// IE 10, Node >= 9.1
404
405function useSetImmediate() {
406  if (! global.setImmediate)
407    return null;
408  else {
409    var setImmediate = function (fn) {
410      global.setImmediate(fn);
411    };
412    setImmediate.implementation = 'setImmediate';
413    return setImmediate;
414  }
415}
416
417
418// Android 2.3.6, Chrome 26, Firefox 20, IE 8-9, iOS 5.1.1 Safari
419
420function usePostMessage() {
421  // The test against `importScripts` prevents this implementation
422  // from being installed inside a web worker, where
423  // `global.postMessage` means something completely different and
424  // can't be used for this purpose.
425
426  if (!global.postMessage || global.importScripts) {
427    return null;
428  }
429
430  // Avoid synchronous post message implementations.
431
432  var postMessageIsAsynchronous = true;
433  var oldOnMessage = global.onmessage;
434  global.onmessage = function () {
435      postMessageIsAsynchronous = false;
436  };
437  global.postMessage("", "*");
438  global.onmessage = oldOnMessage;
439
440  if (! postMessageIsAsynchronous)
441    return null;
442
443  var funcIndex = 0;
444  var funcs = {};
445
446  // Installs an event handler on `global` for the `message` event: see
447  // * https://developer.mozilla.org/en/DOM/window.postMessage
448  // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
449
450  // XXX use Random.id() here?
451  var MESSAGE_PREFIX = "Meteor._setImmediate." + Math.random() + '.';
452
453  function isStringAndStartsWith(string, putativeStart) {
454    return (typeof string === "string" &&
455            string.substring(0, putativeStart.length) === putativeStart);
456  }
457
458  function onGlobalMessage(event) {
459    // This will catch all incoming messages (even from other
460    // windows!), so we need to try reasonably hard to avoid letting
461    // anyone else trick us into firing off. We test the origin 
461is
462    // still this window, and that a (randomly generated)
463    // unpredictable identifying prefix is present.
464    if (event.source === global &&
465        isStringAndStartsWith(event.data, MESSAGE_PREFIX)) {
466      var index = event.data.substring(MESSAGE_PREFIX.length);
467      try {
468        if (funcs[index])
469          funcs[index]();
470      }
471      finally {
472        delete funcs[index];
473      }
474    }
475  }
476
477  if (global.addEventListener) {
478    global.addEventListener("message", onGlobalMessage, false);
479  } else {
480    global.attachEvent("onmessage", onGlobalMessage);
481  }
482
483  var setImmediate = function (fn) {
484    // Make `global` post a message to itself with the handle and
485    // identifying prefix, thus asynchronously invoking our
486    // onGlobalMessage listener above.
487    ++funcIndex;
488    funcs[funcIndex] = fn;
489    global.postMessage(MESSAGE_PREFIX + funcIndex, "*");
490  };
491  setImmediate.implementation = 'postMessage';
492  return setImmediate;
493}
494
495
496function useTimeout() {
497  var setImmediate = function (fn) {
498    global.setTimeout(fn, 0);
499  };
500  setImmediate.implementation = 'setTimeout';
501  return setImmediate;
502}
503
504
505Meteor._setImmediate =
506  useSetImmediate() ||
507  usePostMessage() ||
508  useTimeout();
509
510/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
511
512}).call(this);
513
514
515
516
517
518
519(function(){
520
521/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
522//                                                                                                                     //
523// packages/meteor/timers.js                                                                                           //
524//                                                                                                                     //
525/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
526                                                                                                                       //
527function withoutInvocation(f) {
528  if (Package.ddp) {
529    var DDP = Package.ddp.DDP;
530    var CurrentInvocation =
531      DDP._CurrentMethodInvocation ||
532      // For backwards compatibility, as explained in this issue:
533      // https://github.com/meteor/meteor/issues/8947
534      DDP._CurrentInvocation;
535
536    var invocation = CurrentInvocation.get();
537    if (invocation && invocation.isSimulation) {
538      throw new Error("Can't set timers inside simulations");
539    }
540
541    return function () {
542      CurrentInvocation.withValue(null, f);
543    };
544  } else {
545    return f;
546  }
547}
548
549function bindAndCatch(context, f) {
550  return Meteor.bindEnvironment(withoutInvocation(f), context);
551}
552
553// Meteor.setTimeout and Meteor.setInterval callbacks scheduled
554// inside a server method are not part of the method invocation and
555// should clear out the CurrentMethodInvocation environment variable.
556
557/**
558 * @memberOf Meteor
559 * @summary Call a function in the future after waiting for a specified delay.
560 * @locus Anywhere
561 * @param {Function} func The function to run
562 * @param {Number} delay Number of milliseconds to wait before calling function
563 */
564Meteor.setTimeout = function (f, duration) {
565  return setTimeout(bindAndCatch("setTimeout callback", f), duration);
566};
567
568/**
569 * @memberOf Meteor
570 * @summary Call a function repeatedly, with a time delay between calls.
571 * @locus Anywhere
572 * @param {Function} func The function to run
573 * @param {Number} delay Number of milliseconds to wait between each function call.
574 */
575Meteor.setInterval = function (f, duration) {
576  return setInterval(bindAndCatch("setInterval callback", f), duration);
577};
578
579/**
580 * @memberOf Meteor
581 * @summary Cancel a repeating function call scheduled by `Meteor.setInterval`.
582 * @locus Anywhere
583 * @param {Object} id The handle returned by `Meteor.setInterval`
584 */
585Meteor.clearInterval = function(x) {
586  return clearInterval(x);
587};
588
589/**
590 * @memberOf Meteor
591 * @summary Cancel a function call scheduled by `Meteor.setTimeout`.
592 * @locus Anywhere
593 * @param {Object} id The handle returned by `Meteor.setTimeout`
594 */
595Meteor.clearTimeout = function(x) {
596  return clearTimeout(x);
597};
598
599// XXX consider making this guarantee ordering of defer'd callbacks, like
600// Tracker.afterFlush or Node's nextTick (in practice). Then tests can do:
601//    callSomethingThatDefersSomeWork();
602//    Meteor.defer(expect(somethingThatValidatesThatTheWorkHappened));
603
604/**
605 * @memberOf Meteor
606 * @summary Defer execution of a function to run asynchronously in the background (similar to `Meteor.setTimeout(func, 0)`.
607 * @locus Anywhere
608 * @param {Function} func The function to run
609 */
610Meteor.defer = function (f) {
611  Meteor._setImmediate(bindAndCatch("defer callback", f));
612};
613
614/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
615
616}).call(this);
617
618
619
620
621
622
623(function(){
624
625/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
626//                                                                                                                     //
627// packages/meteor/errors.js                                                                                           //
628//                                                                                                                     //
629/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
630                                                                                                                       //
631// Makes an error subclass which properly contains a stack trace in most
632// environments. constructor can set fields on `this` (and should probably set
633// `message`, which is what gets displayed at the top of a stack trace).
634//
635Meteor.makeErrorType = function (name, constructor) {
636  var errorClass = function (/*arguments*/) {
637    // Ensure we get a proper stack trace in most Javascript environments
638    if (Error.captureStackTrace) {
639      // V8 environments (Chrome and Node.js)
640      Error.captureStackTrace(this, errorClass);
641    } else {
642      // Borrow the .stack property of a native Error object.
643      this.stack = new Error().stack;
644    }
645    // Safari magically works.
646
647    constructor.apply(this, arguments);
648
649    this.errorType = name;
650  };
651
652  Meteor._inherits(errorClass, Error);
653
654  return errorClass;
655};
656
657// This should probably be in the livedata package, but we don't want
658// to require you to use the livedata package to get it. Eventually we
659// should probably rename it to DDP.Error and put it back in the
660// 'livedata' package (which we should rename to 'ddp' also.)
661//
662// Note: The DDP server assumes that Meteor.Error EJSON-serializes as an object
663// containing 'error' and optionally 'reason' and 'details'.
664// The DDP client manually puts these into Meteor.Error objects. (We don't use
665// EJSON.addType here because the type is determined by location in the
666// protocol, not text on the wire.)
667
668/**
669 * @summary This class represents a symbolic error thrown by a method.
670 * @locus Anywhere
671 * @class
672 * @param {String} error A string code uniquely identifying this kind of error.
673 * This string should be used by callers of the method to determine the
674 * appropriate action to take, instead of attempting to parse the reason
675 * or details fields.
676 *
677 * For legacy reasons, some built-in Meteor functions such as `check` throw
678 * errors with a number in this field.
679 *
680 * @param {String} [reason] Optional.  A short human-readable summary of the
681 * error, like 'Not Found'.
682 * @param {String} [details] Optional.  Additional information about the error,
683 * like a textual stack trace.
684 */
685Meteor.Error = Meteor.makeErrorType(
686  "Meteor.Error",
687  function (error, reason, details) {
688    var self = this;
689
690    // Newer versions of DDP use this property to signify that an error
691    // can be sent back and reconstructed on the calling client.
692    self.isClientSafe = true;
693
694    // String code uniquely identifying this kind of error.
695    self.error = error;
696
697    // Optional: A short human-readable summary of the error. Not
698    // intended to be shown to end users, just developers. ("Not Found",
699    // "Internal Server Error")
700    self.reason = reason;
701
702    // Optional: Additional information about the error, say for
703    // debugging. It might be a (textual) stack trace if the server is
704    // willing to provide one. The corresponding thing in HTTP would be
705    // the body of a 404 or 500 response. (The difference is that we
706    // never expect this to be shown to end users, only developers, so
707    // it doesn't need to be pretty.)
708    self.details = details;
709
710    // This is what gets displayed at the top of a stack trace. Current
711    // format is "[404]" (if no reason is set) or "File not found [404]"
712    if (self.reason)
713      self.message = self.reason + ' [' + self.error + ']';
714    else
715      self.message = '[' + self.error + ']';
716  });
717
718// Meteor.Error is basically data and is sent over DDP, so you should be able to
719// properly EJSON-clone it. This is especially important because if a
720// Meteor.Error is thrown through a Future, the error, reason, and details
721// properties become non-enumerable so a standard Object clone won't preserve
722// them and they will be lost from DDP.
723Meteor.Error.prototype.clone = function () {
724  var self = this;
725  return new Meteor.Error(self.error, self.reason, self.details);
726};
727
728/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
729
730}).call(this);
731
732
733
734
735
736
737(function(){
738
739/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
740//                                                                                                                     //
741// packages/meteor/async_helpers.js                                                                                    //
742//                                                                                                                     //
743/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
744                                                                                                                       //
745Meteor._noYieldsAllowed = function (f) {
746  var result = f();
747  if (Meteor._isPromise(result)) {
748    throw new Error("function is a promise when calling Meteor._noYieldsAllowed");
749  }
750  return result
751};
752
753function FakeDoubleEndedQueue () {
754  this.queue = [];
755}
756
757FakeDoubleEndedQueue.prototype.push = function (task) {
758  this.queue.push(task);
759};
760
761FakeDoubleEndedQueue.prototype.shift = function () {
762  return this.queue.shift();
763};
764
765FakeDoubleEndedQueue.prototype.isEmpty = function () {
766  return this.queue.length === 0;
767};
768
769Meteor._DoubleEndedQueue = Meteor.isServer ? Npm.require('denque') : FakeDoubleEndedQueue;
770
771
772// Sleep. Mostly used for debugging (eg, inserting latency into server
773// methods).
774//
775const _sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
776Meteor._sleepForMs = function (ms) {
777  return _sleep(ms);
778};
779
780Meteor.sleep = _sleep;
781/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
782
783}).call(this);
784
785
786
787
788
789
790(function(){
791
792/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
793//                                                                                                                     //
794// packages/meteor/fiber_stubs_client.js                                                                               //
795//                                                                                                                     //
796/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
797                                                                                                                       //
798// This file is a partial analogue to fiber_helpers.js, which allows the client
799// to use a queue too, and also to call noYieldsAllowed.
800
801// The client has no ability to yield, so noYieldsAllowed is a noop.
802//
803Meteor._noYieldsAllowed = function (f) {
804  return f();
805};
806
807// An even simpler queue of tasks than the fiber-enabled one.  This one just
808// runs all the tasks when you call runTask or flush, synchronously.
809//
810Meteor._SynchronousQueue = function () {
811  var self = this;
812  self._tasks = [];
813  self._running = false;
814  self._runTimeout = null;
815};
816
817var SQp = Meteor._SynchronousQueue.prototype;
818
819SQp.runTask = function (task) {
820  var self = this;
821  if (!self.safeToRunTask())
822    throw new Error("Could not synchronously run a task from a running task");
823  self._tasks.push(task);
824  var tasks = self._tasks;
825  self._tasks = [];
826  self._running = true;
827
828  if (self._runTimeout) {
829    // Since we're going to drain the queue, we can forget about the timeout
830    // which tries to run it.  (But if one of our tasks queues something else,
831    // the timeout will be correctly re-created.)
832    clearTimeout(self._runTimeout);
833    self._runTimeout = null;
834  }
835
836  try {
837    while (tasks.length > 0) {
838      var t = tasks.shift();
839      try {
840        t();
841      } catch (e) {
842        if (tasks.length === 0) {
843          // this was the last task, that is, the one we're calling runTask
844          // for.
845          throw e;
846        }
847        Meteor._debug("Exception in queued task", e);
848      }
849    }
850  } finally {
851    self._running = false;
852  }
853};
854
855SQp.queueTask = function (task) {
856  var self = this;
857  self._tasks.push(task);
858  // Intentionally not using Meteor.setTimeout, because it doesn't like runing
859  // in stubs for now.
860  if (!self._runTimeout) {
861    self._runTimeout = setTimeout(function () {
862      return self.flush.apply(self, arguments);
863    }, 0);
864  }
865};
866
867SQp.flush = function () {
868  var self = this;
869  self.runTask(function () {});
870};
871
872SQp.drain = function () {
873  var self = this;
874  if (!self.safeToRunTask()) {
875    return;
876  }
877  while (self._tasks.length > 0) {
878    self.flush();
879  }
880};
881
882SQp.safeToRunTask = function () {
883  var self = this;
884  return !self._running;
885};
886
887/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
888
889}).call(this);
890
891
892
893
894
895
896(function(){
897
898/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
899//                                                                                                                     //
900// packages/meteor/asl-helpers-client.js                                                                               //
901//                                                                                                                     //
902/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
903                                                                                                                       //
904/**
905 * @memberof Meteor
906 * @summary Boolean variable. True when running in Meteor 3.0. Useful to packages
907 * in order to maintain compatibility with Meteor 2.x.
908 * @locus Anywhere
909 * @static
910 * @type {Boolean}
911 */
912Meteor.isFibersDisabled = true;
913
914Meteor._isPromise = function (r) {
915  return r && typeof r.then === "function";
916};
917
918Meteor._runFresh = function (fn) {
919  return fn();
920};
921
922/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
923
924}).call(this);
925
926
927
928
929
930
931(function(){
932
933/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
934//                                                                                                                     //
935// packages/meteor/startup_client.js                                                                                   //
936//                                                                                                                     //
937/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
938                                                                                                                       //
939var callbackQueue = [];
940var isLoadingCompleted = false;
941var eagerCodeRan = false;
942var isReady = false;
943
944// Keeps track of how many events to wait for in addition to loading completing,
945// before we're considered ready.
946var readyHoldsCount = 0;
947
948var holdReady =  function () {
949  readyHoldsCount++;
950}
951
952var releaseReadyHold = function () {
953  readyHoldsCount--;
954  maybeReady();
955}
956
957var maybeReady = function () {
958  if (isReady || !eagerCodeRan || readyHoldsCount > 0)
959    return;
960
961  isReady = true;
962
963  // Run startup callbacks
964  while (callbackQueue.length)
965    (callbackQueue.shift())();
966
967  if (Meteor.isCordova) {
968    // Notify the WebAppLocalServer plugin that startup was completed successfully,
969    // so we can roll back faulty versions if this doesn't happen
970    WebAppLocalServer.startupDidComplete();
971  }
972};
973
974function waitForEagerAsyncModules () {
975  function finish() {
976    eagerCodeRan = true;
977    maybeReady();
978  }
979
980  var potentialPromise = Package['core-runtime'].waitUntilAllLoaded();
981
982  if (potentialPromise === null) {
983    finish();
984  } else {
985    potentialPromise.then(function () {
986      finish();
987    });
988  }
989}
990
991var loadingCompleted = function () {
992  if (isLoadingCompleted) {
993    return;
994  }
995
996  isLoadingCompleted = true;
997  waitForEagerAsyncModules();
998}
999
1000if (Meteor.isCordova) {
1001  holdReady();
1002  document.addEventListener('deviceready', releaseReadyHold, false);
1003}
1004
1005if (document.readyState === 'complete' || document.readyState === 'loaded') {
1006  // Loading has completed,
1007  // but allow other scripts the opportunity to hold ready
1008  window.setTimeout(loadingCompleted);
1009} else { // Attach event listeners to wait for loading to complete
1010  if (document.addEventListener) {
1011    document.addEventListener('DOMContentLoaded', loadingCompleted, false);
1012    window.addEventListener('load', loadingCompleted, false);
1013  } else { // Use IE event model for < IE9
1014    document.attachEvent('onreadystatechange', function () {
1015      if (document.readyState === "complete") {
1016        loadingCompleted();
1017      }
1018    });
1019    window.attachEvent('load', loadingCompleted);
1020  }
1021}
1022
1023/**
1024 * @summary Run code when a client or a server starts.
1025 * @locus Anywhere
1026 * @param {Function} func A function to run on startup.
1027 */
1028Meteor.startup = function (callback) {
1029  // Fix for < IE9, see http://javascript.nwbox.com/IEContentLoaded/
1030  var doScroll = !document.addEventListener &&
1031    document.documentElement.doScroll;
1032
1033  if (!doScroll || window !== top) {
1034    if (isReady)
1035      callback();
1036    else
1037      callbackQueue.push(callback);
1038  } else {
1039    try { doScroll('left'); }
1040    catch (error) {
1041      setTimeout(function () { Meteor.startup(callback); }, 50);
1042      return;
1043    };
1044    callback();
1045  }
1046};
1047
1048/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1049
1050}).call(this);
1051
1052
1053
1054
1055
1056
1057(function(){
1058
1059/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1060//                                                                                                                     //
1061// packages/meteor/debug.js                                                                                            //
1062//                                                                                                                     //
1063/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1064                                                                                                                       //
1065if (Meteor.isServer) {
1066  if (typeof __meteor_runtime_config__ === 'object') {
1067    __meteor_runtime_config__.debug =
1068      !!process.env.NODE_INSPECTOR_IPC ||
1069      !!process.env.VSCODE_INSPECTOR_OPTIONS ||
1070      process.execArgv.some(function(_arg) {
1071        return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(_arg);
1072      });
1073  }
1074}
1075
1076Meteor.isDebug = Meteor.isClient
1077  ? typeof window === 'object' && !!window.__meteor_runtime_config__.debug
1078  : typeof __meteor_runtime_config__ === 'object' &&
1079  !!__meteor_runtime_config__.debug;
1080
1081var suppress = 0;
1082
1083// replacement for console.log. This is a temporary API. We should
1084// provide a real logging API soon (possibly just a polyfill for
1085// console?)
1086//
1087// NOTE: this is used on the server to print the warning about
1088// having autopublish enabled when you probably meant to turn it
1089// off. it's not really the proper use of something called
1090// _debug. the intent is for this message to go to the terminal and
1091// be very visible. if you change _debug to go someplace else, etc,
1092// please fix the autopublish code to do something reasonable.
1093//
1094Meteor._debug = function (/* arguments */) {
1095  if (suppress) {
1096    suppress--;
1097    return;
1098  }
1099  if (typeof console !== 'undefined' &&
1100      typeof console.log !== 'undefined') {
1101    if (arguments.length == 0) { // IE Companion breaks otherwise
1102      // IE10 PP4 requires at least one argument
1103      console.log('');
1104    } else {
1105      // IE doesn't have console.log.apply, it's not a real Object.
1106      // http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9
1107      // http://patik.com/blog/complete-cross-browser-console-log/
1108      if (typeof console.log.apply === "function") {
1109        // Most browsers
1110
1111        // Chrome and Safari only hyperlink URLs to source files in first argument of
1112        // console.log, so try to call it with one argument if possible.
1113        // Approach taken here: If all arguments are strings, join them on space.
1114        // See https://github.com/meteor/meteor/pull/732#issuecomment-13975991
1115        var allArgumentsOfTypeString = true;
1116        for (var i = 0; i < arguments.length; i++)
1117          if (typeof arguments[i] !== "string")
1118            allArgumentsOfTypeString = false;
1119
1120        if (allArgumentsOfTypeString)
1121          console.log.apply(console, [Array.prototype.join.call(arguments, " ")]);
1122        else
1123          console.log.apply(console, arguments);
1124
1125      } else if (typeof Function.prototype.bind === "function") {
1126        // IE9
1127        var log = Function.prototype.bind.call(console.log, console);
1128        log.apply(console, arguments);
1129      }
1130    }
1131  }
1132};
1133
1134// Suppress the next 'count' Meteor._debug messsages. Use this to
1135// stop tests from spamming the console.
1136//
1137Meteor._suppress_log = function (count) {
1138  suppress += count;
1139};
1140
1141Meteor._suppressed_log_expected = function () {
1142  return suppress !== 0;
1143};
1144
1145/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1146
1147}).call(this);
1148
1149
1150
1151
1152
1153
1154(function(){
1155
1156/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1157//                                                                                                                     //
1158// packages/meteor/deprecate.js                                                                                        //
1159//                                                                                                                     //
1160/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1161                                                                                                                       //
1162if (Meteor.isServer && Meteor.isDevelopment) {
1163  if (typeof __meteor_runtime_config__ === 'object') {
1164    var noDeprecation = process.env.METEOR_NO_DEPRECATION || process.noDeprecation;
1165    if (noDeprecation === 'true' || noDeprecation === 'false') {
1166      noDeprecation = noDeprecation === 'true';
1167    }
1168    __meteor_runtime_config__.noDeprecation = noDeprecation;
1169  }
1170}
1171
1172function oncePerArgument(func) {
1173  var cache = new Map();
1174
1175  return function _oncePerArgument() {
1176    var key = JSON.stringify(arguments);
1177    if (!cache.has(key)) {
1178      var result = func.apply(this, arguments);
1179      cache.set(key, result);
1180    }
1181    return cache.get(key);
1182  };
1183}
1184
1185function cleanStackTrace(stackTrace) {
1186  if (!stackTrace || typeof stackTrace !== 'string') return [];
1187  var lines = stackTrace.split('\n');
1188  var trace = [];
1189  try {
1190    for (var i = 0; i < lines.length; i++) {
1191      var _line = lines[i].trim();
1192      if (_line.indexOf('Meteor.deprecate') !== -1) continue;
1193      if (_line.indexOf('packages/') !== -1) {
1194        trace.push(_line);
1195      } else if (_line && _line.indexOf('/') !== -1) {
1196        // Stop processing if a valid path that does not start with 'packages/**' is found
1197        trace.push(_line);
1198        break;
1199      }
1200    }
1201  } catch (e) {
1202    console.error('Error cleaning stack trace: ', e);
1203  }
1204  return trace.join('\n');
1205}
1206
1207var onceWarning = oncePerArgument(function _onceWarning(message) {
1208  console.warn.apply(console, message);
1209});
1210
1211function onceFixDeprecation() {
1212  onceWarning(['Deprecation warnings are hidden but crucial to address for future Meteor updates.', '\n', 'Remove the `METEOR_NO_DEPRECATION` env var to reveal them, then report or fix the issues.']);
1213}
1214
1215Meteor.deprecate = function () {
1216  if (!Meteor.isDevelopment) {
1217    return;
1218  }
1219  if (typeof console !== 'undefined' && typeof console.warn !== 'undefined') {
1220    var stackStrace = cleanStackTrace(new Error().stack || '');
1221    var messages = Array.prototype.slice.call(arguments); // Convert arguments to array
1222
1223    if (typeof __meteor_runtime_config__.noDeprecation === 'string') {
1224      var noDeprecationPattern = new RegExp(__meteor_runtime_config__.noDeprecation);
1225      if (noDeprecationPattern.test(stackStrace)) {
1226        onceFixDeprecation();
1227        return;
1228      }
1229    } else if (typeof __meteor_runtime_config__.noDeprecation === 'boolean' && __meteor_runtime_config__.noDeprecation) {
1230      onceFixDeprecation();
1231      return;
1232    }
1233    if (stackStrace.length > 0) {
1234      messages.push('\n\n', 'Trace:', '\n', stackStrace);
1235    }
1236    messages.push('\n\n', 'To disable warnings, set the `METEOR_NO_DEPRECATION` to `true` or a regex pattern.', '\n');
1237
1238    onceWarning(['[DEPRECATION]'].concat(messages));
1239  }
1240};
1241
1242/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1243
1244}).call(this);
1245
1246
1247
1248
1249
1250
1251(function(){
1252
1253/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1254//                                                                                                                     //
1255// packages/meteor/string_utils.js                                                                                     //
1256//                                                                                                                     //
1257/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1258                                                                                                                       //
1259// Like Perl's quotemeta: quotes all regexp metacharacters.
1260// Code taken from
1261// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
1262Meteor._escapeRegExp = function (string) {
1263    return String(string).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1264};
1265
1266/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1267
1268}).call(this);
1269
1270
1271
1272
1273
1274
1275(function(){
1276
1277/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1278//                                                                                                                     //
1279// packages/meteor/test_environment.js                                                                                 //
1280//                                                                                                                     //
1281/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1282                                                                                                                       //
1283
1284
1285var TEST_METADATA_STR;
1286if (Meteor.isClient) {
1287  TEST_METADATA_STR = meteorEnv.TEST_METADATA;
1288} else {
1289  TEST_METADATA_STR = process.env.TEST_METADATA;
1290}
1291
1292var TEST_METADATA = JSON.parse(TEST_METADATA_STR || "{}");
1293var testDriverPackageName = TEST_METADATA.driverPackage;
1294
1295// Note that if we are in test-packages mode neither of these will be set,
1296// but we will have a test driver package
1297/** 
1298 *@memberof Meteor
1299 * @summary Boolean variable. True when running unit tests (false if running
1300 * tests in full app mode).
1301 * @locus Anywhere
1302 * @static
1303 * @type {Boolean}
1304 */
1305Meteor.isTest = !!TEST_METADATA.isTest;
1306
1307/** 
1308 *@memberof Meteor
1309 * @summary Boolean variable.  True if running tests against your application i.e `meteor test --full-app`.
1310 * @locus Anywhere
1311 * @static
1312 * @type {Boolean}
1313 */
1314Meteor.isAppTest = !!TEST_METADATA.isAppTest;
1315
1316/** 
1317 *@memberof Meteor
1318 * @summary Boolean variable.  True if running tests against a Meteor package.
1319 * @locus Anywhere
1320 * @static
1321 * @type {Boolean}
1322 */
1323Meteor.isPackageTest = !!testDriverPackageName && !Meteor.isTest && !Meteor.isAppTest; 
1324
1325if (typeof testDriverPackageName === "string") {
1326  Meteor.startup(function() {
1327    var testDriverPackage = Package[testDriverPackageName];
1328    if (! testDriverPackage) {
1329      throw new Error("Can't find test driver package: " + testDriverPackageName);
1330    }
1331
1332    // On the client, the test driver *must* define `runTests`
1333    if (Meteor.isClient) {
1334      if (typeof testDriverPackage.runTests !== "function") {
1335        throw new Error("Test driver package " + testDriverPackageName
1336          + " missing `runTests` export");
1337      }
1338      testDriverPackage.runTests();
1339    } else {
1340      // The server can optionally define `start`
1341      if (typeof testDriverPackage.start === "function") {
1342        testDriverPackage.start();
1343      }
1344    }
1345  });
1346}
1347
1348/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1349
1350}).call(this);
1351
1352
1353
1354
1355
1356
1357(function(){
1358
1359/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1360//                                                                                                                     //
1361// packages/meteor/dynamics_browser.js                                                                                 //
1362//                                                                                                                     //
1363/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1364                                                                                                                       //
1365// Simple implementation of dynamic scoping, for use in browsers
1366
1367var nextSlot = 0;
1368var currentValues = [];
1369var callAsyncMethodRunning = false;
1370
1371Meteor.EnvironmentVariable = function () {
1372  this.slot = nextSlot++;
1373};
1374
1375var EVp = Meteor.EnvironmentVariable.prototype;
1376
1377EVp.getCurrentValues = function () {
1378  return currentValues;
1379};
1380/**
1381 * @memberof Meteor.EnvironmentVariable
1382 * @method get
1383 * @returns {any} The current value of the variable, or its default value if
1384 */
1385EVp.get = function () {
1386  return currentValues[this.slot];
1387};
1388
1389EVp.getOrNullIfOutsideFiber = function () {
1390  return this.get();
1391};
1392
1393
1394/**
1395 * @memberof Meteor.EnvironmentVariable
1396 * @method withValue
1397 * @param {any} value The value to set for the duration of the function call
1398 * @param {Function} func The function to call with the new value of the
1399 * @returns {any} The return value of the function
1400 */
1401EVp.withValue = function (value, func) {
1402  // WARNING: Do not change the behavior of this function.
1403  // If you compare this function to it's version in the server-side, you'll see that there we handle async results.
1404  // In the client we don't need to do this. If we try to, it can lead to problems like this:
1405  // https://github.com/meteor/meteor/pull/13198#issuecomment-2181254734/.
1406  var saved = currentValues[this.slot];
1407
1408  try {
1409    currentValues[this.slot] = value;
1410
1411    return func();
1412  } finally {
1413    currentValues[this.slot] = saved;
1414  }
1415};
1416
1417EVp._set = function (context) {
1418  currentValues[this.slot] = context;
1419};
1420
1421EVp._setNewContextAndGetCurrent = function (value) {
1422  var saved = currentValues[this.slot];
1423  this._set(value);
1424  return saved;
1425};
1426
1427EVp._isCallAsyncMethodRunning = function () {
1428  return callAsyncMethodRunning;
1429};
1430
1431EVp._setCallAsyncMethodRunning = function (value) {
1432  callAsyncMethodRunning = value;
1433};
1434
1435
1436Meteor.bindEnvironment = function (func, onException, _this) {
1437  // needed in order to be able to create closures inside func and
1438  // have the closed variables not change back to their original
1439  // values
1440  var boundValues = currentValues.slice();
1441
1442  if (!onException || typeof(onException) === 'string') {
1443    var description = onException || "callback of async function";
1444    onException = function (error) {
1445      Meteor._debug(
1446        "Exception in " + description + ":",
1447        error
1448      );
1449    };
1450  }
1451
1452  return function (/* arguments */) {
1453    var savedValues = currentValues;
1454    try {
1455      currentValues = boundValues;
1456      var ret = func.apply(_this, arguments);
1457    } catch (e) {
1458      // note: callback-hook currently relies on the fact that if onException
1459      // throws in the browser, the wrapped call throws.
1460      onException(e);
1461    } finally {
1462      currentValues = savedValues;
1463    }
1464    return ret;
1465  };
1466};
1467
1468/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1469
1470}).call(this);
1471
1472
1473
1474
1475
1476
1477(function(){
1478
1479/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1480//                                                                                                                     //
1481// packages/meteor/url_common.js                                                                                       //
1482//                                                                                                                     //
1483/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1484                                                                                                                       //
1485/**
1486 * @summary Generate an absolute URL pointing to the application. The server reads from the `ROOT_URL` environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using `meteor build`.
1487 * @locus Anywhere
1488 * @param {String} [path] A path to append to the root URL. Do not include a leading "`/`".
1489 * @param {Object} [options]
1490 * @param {Boolean} options.secure Create an HTTPS URL.
1491 * @param {Boolean} options.replaceLocalhost Replace localhost with 127.0.0.1. Useful for services that don't recognize localhost as a domain name.
1492 * @param {String} options.rootUrl Override the default ROOT_URL from the server environment. For example: "`http://foo.example.com`"
1493 */
1494Meteor.absoluteUrl = function (path, options) {
1495  // path is optional
1496  if (!options && typeof path === 'object') {
1497    options = path;
1498    path = undefined;
1499  }
1500  // merge options with defaults
1501  options = Object.assign({}, Meteor.absoluteUrl.defaultOptions, options || {});
1502
1503  var url = options.rootUrl;
1504  if (!url)
1505    throw new Error("Must pass options.rootUrl or set ROOT_URL in the server environment");
1506
1507  if (!/^http[s]?:\/\//i.test(url)) // url starts with 'http://' or 'https://'
1508    url = 'http://' + url; // we will later fix to https if options.secure is set
1509
1510  if (! url.endsWith("/")) {
1511    url += "/";
1512  }
1513
1514  if (path) {
1515    // join url and path with a / separator
1516    while (path.startsWith("/")) {
1517      path = path.slice(1);
1518    }
1519    url += path;
1520  }
1521
1522  // turn http to https if secure option is set, and we're not talking
1523  // to localhost.
1524  if (options.secure &&
1525      /^http:/.test(url) && // url starts with 'http:'
1526      !/http:\/\/localhost[:\/]/.test(url) && // doesn't match localhost
1527      !/http:\/\/127\.0\.0\.1[:\/]/.test(url)) // or 127.0.0.1
1528    url = url.replace(/^http:/, 'https:');
1529
1530  if (options.replaceLocalhost)
1531  {
1532    url = url.replace( /^http:\/\/localhost([:\/].*)/, 'http://127.0.0.1$1');
1533  }
1534  return url;
1535};
1536
1537// allow later packages to override default options
1538var defaultOptions = Meteor.absoluteUrl.defaultOptions = {};
1539
1540// available only in a browser environment
1541var location = typeof window === "object" && window.location;
1542
1543if (typeof __meteor_runtime_config__ === "object" &&
1544    __meteor_runtime_config__.ROOT_URL) {
1545  defaultOptions.rootUrl = __meteor_runtime_config__.ROOT_URL;
1546} else if (location &&
1547           location.protocol &&
1548           location.host) {
1549  defaultOptions.rootUrl = location.protocol + "//" + location.host;
1550}
1551
1552// Make absolute URLs use HTTPS by default if the current window.location
1553// uses HTTPS. Since this is just a default, it can be overridden by
1554// passing { secure: false } if necessary.
1555if (location &&
1556    location.protocol === "https:") {
1557  defaultOptions.secure = true;
1558}
1559
1560Meteor._relativeToSiteRootUrl = function (link) {
1561  if (typeof __meteor_runtime_config__ === "object" &&
1562      link.substr(0, 1) === "/")
1563    link = (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX || "") + link;
1564  return link;
1565};
1566
1567/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1568
1569}).call(this);
1570
1571
1572/* Exports */
1573return {
1574  export: function () { return {
1575      Meteor: Meteor,
1576      global: global,
1577      meteorEnv: meteorEnv
1578    };}
1579}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.