/* Resolver
=============================================================================
17594
function(opts) {
    var self = this
    
    this.opts = opts || {}
    
    this.debug = this.opts.debug || debug
    
    this.providers = this.opts.providers || {}
    this.dns = this.opts.dns || {}

    self.init.apply(self, arguments)
}
613562
function resolve (manager, resolveReducer, accumulator, reducer) {
  const entity = manager.entities.get(reducer.id)
  return BaseEntity.resolve(
    manager,
    resolveReducer,
    accumulator,
    reducer,
    entity
  )
}
716625
static Object[] toArguments(List<AnnotatedValueResolver> resolvers,
                                ResolverContext resolverContext) {
        requireNonNull(resolvers, "resolvers");
        requireNonNull(resolverContext, "resolverContext");
        if (resolvers.isEmpty()) {
            return emptyArguments;
        }
        return resolvers.stream().map(resolver -> resolver.resolve(resolverContext)).toArray();
    }
859966
function resolve() {
    if (l.search) {
      var q = {};
      l.search.slice(1).split('&').forEach(function(v) {
        var a = v.split('=');
        q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&')
      });
      if (q.p !== undefined) {
        window.history.replaceState(null, null,
          repo + (q.p || '') +
          (q.q ? ('?' + q.q) : '') +
          l.hash
        )
      }
    }
  }
428141
function(resolve) {
    var resolvesPromises = {};

    angular.forEach(resolve, function(value, key) {
      var resolution = angular.isString(value) ? $injector.get(value) : $injector.invoke(value, null, null, key);
      resolvesPromises[key] = $q.when(resolution);
    });

    return $q.all(resolvesPromises);
  }
1067948
private function resolve($definition)
    {
        return !is_null($this->resolver) ? $this->resolver->resolve($definition) : $definition;
    }
767147
function resolveRef(subobj, parent, parentKey) {
                    if (!subobj.resolved) {
                        Object.keys(subobj).forEach(function (key) {
                            var Ref, value = subobj[key];
                            if (key === "$ref") {
                                logger.debug("Resolving $ref: " + value);
                                Ref = refResolver(value);
                                value = typeof Ref === 'function' ? new Ref() : Ref;
                                if (!util.isUndefined(value) && !value.resolved) {
                                    subobj.resolved = true;
                                    resolveRef(value, subobj, key);
                                }
                                parent[parentKey] = value;
                            } else if (typeof value === "object") {
                                resolveRef(value, subobj, key);
                            }
                        });
                    }
                }
304734
function resolveReducer (manager, accumulator, reducer) {
  // this conditional is here because BaseEntity#resolve
  // does not check that lifecycle methods are defined
  // before trying to resolve them
  if (!reducer) {
    return Promise.resolve(accumulator)
  }

  const isTracing = accumulator.trace

  const acc = isTracing
    ? trace.augmentAccumulatorTrace(accumulator, reducer)
    : accumulator

  const traceNode = acc.traceNode

  const resolve = getResolveFunction(reducer)

  // NOTE: recursive call
  let result = resolve(manager, resolveReducer, acc, reducer)

  if (hasDefault(reducer)) {
    const _default = reducer[DEFAULT_VALUE].value
    const resolveDefault = reducers.ReducerDefault.resolve
    result = result.then(acc => resolveDefault(acc, _default))
  }

  if (isTracing) {
    result = result.then(trace.augmentTraceNodeDuration(traceNode))
  }

  return result
}
953417
@Override
    public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {

        // Pass non-OBJECT values through the superclass so it can reject weird values and, in the odd chance
        // that's how this object is set up, turn undefined into a default list value.
        ModelNode superResult = value.getType() == ModelType.OBJECT ? value : super.resolveValue(resolver, value);

        // If it's not an OBJECT (almost certainly UNDEFINED), then nothing more we can do
        if (superResult.getType() != ModelType.OBJECT) {
            return superResult;
        }

        // Resolve each field.
        // Don't mess with the original value
        ModelNode clone = superResult == value ? value.clone() : superResult;
        ModelNode result = new ModelNode();
        for (AttributeDefinition field : valueTypes) {
            String fieldName = field.getName();
            if (clone.has(fieldName)) {
                result.get(fieldName).set(field.resolveValue(resolver, clone.get(fieldName)));
            } else {
                // Input doesn't have a child for this field.
                // Don't create one in the output unless the AD produces a default value.
                // TBH this doesn't make a ton of sense, since any object should have
                // all of its fields, just some may be undefined. But doing it this
                // way may avoid breaking some code that is incorrectly checking node.has("xxx")
                // instead of node.hasDefined("xxx")
                ModelNode val = field.resolveValue(resolver, new ModelNode());
                if (val.isDefined()) {
                    result.get(fieldName).set(val);
                }
            }
        }
        // Validate the entire object
        getValidator().validateParameter(getName(), result);
        return result;
    }
877508
function resolver (remainingTry, interval) {
      var result = Q.fcall(action);
      if (remainingTry <= 0) {
        return result;
      }
      // In case of failure, wait the interval, retry the action
      return result.fail(function (e) {
        return Q.delay(interval).then(function () {
          return resolver(remainingTry-1, interval*options.intervalMultiplicator);
        });
      });
    }
1001859
function structureResolve(resolve, sPathStartWith) {
    var aToResolve = [];
    var aResolved = [];

    if (typeof resolve === 'object' && resolve instanceof Array) {
        aToResolve = resolve;
    } else if (typeof resolve === 'string') {
        aToResolve.push(resolve);
    } else {
        return null;
    }

    // resolve
    aToResolve.forEach(function (item) {
        var aSplit = item.split('/');

        for (var i = 0; i < aSplit.length; i++) {
            var aConc = aSplit.slice(0, i + 1);
            var sConc = (aConc.length > 1) ? aConc.join('/') : aConc[0];

            if (sConc.length > 0) {
                aResolved.push({
                    type: (i < (aSplit.length - 1)) ? OBJECT_TYPE.folder : OBJECT_TYPE.file,
                    id: (sConc.charAt(0) !== sPathStartWith) ? sPathStartWith + sConc : sConc
                });
            }
        }
    });

    // remove dups
    aResolved = aResolved.sort(function (sVal1, sVal2) {
        var sA = JSON.stringify(sVal1);
        var sB = JSON.stringify(sVal2);

        if (sA === sB) {
            return 0;
        } else if (sA <= sB) {
            return -1;
        } else {
            return 1;
        }
    })
        .filter(function (oItem, iPos) {
            if (iPos > 0) {
                return JSON.stringify(aResolved[iPos - 1]) !== JSON.stringify(oItem);
            } else {
                return true;
            }
        });

    return aResolved;
}
1357452
function resolveResolution (
  ref,
  resolver,
  bootedServices
) {
  const refParts = ref.split(':')
  return resolver(refParts, bootedServices)
}
699087
function doResolve(fn, self) {
  var done = false;
  try {
    fn(
      function(value) {
        if (done) { return; }
        done = true;
        resolve(self, value);
      },
      function(reason) {
        if (done) { return; }
        done = true;
        reject(self, reason);
      }
    );
  } catch (ex) {
    if (done) { return; }
    done = true;
    reject(self, ex);
  }
}
180406
function resolveHandler(_ref4) {
  var action = _ref4.action;
  var type = _ref4.type;
  var payload = _ref4.payload;
  var error = _ref4.error;
  return _extends({}, action, { type: type, payload: payload, error: error });
}
264313
function resolve_(element, resolve) {
    // if element is a fragment, it will load everything
    // up to child element
    if (element.MaterialFragment) {
      element.MaterialFragment.loaded.then(() => {
        slice.call(element.querySelectorAll(selClass))
          .forEach(element => componentHandler.upgradeElement(element));
        resolve();
      });
    } else {
      element.addEventListener('load', resolve, { once: true });
    }
  }
911859
function resolver(filePath, callback) {
    var fullPath = path.join(this.config.publicPath, filePath);
    var options = {
      resourceURL: filePath,
      contents: fs.readFileSync(fullPath).toString()
    };

    // If we defined a custom browser-side message system, use it.
    if (this.update) {
      options.update = this.update;
    }
    // If we specified a `match` option for fb-flo notifications, use it.
    if (this.config.resolverMatch) {
      options.match = this.config.resolverMatch;
    }
    // If we defined an advanced reload mechanism (fb-flo only has true/false,
    // we also allow anymatch sets), use it.
    if (this.config.resolverReload) {
      options.reload = this.config.resolverReload(filePath);
    }

    // Hand the notification over to the fb-flo server.
    callback(options);
  }
162847
function resolveUse (appendList, increment, options, resolver) {
    return function resolveUseClosure (value) {
      // TODO This should state.options('update..
      // TODO look at all of options.xxxx
      if (resolver.settled && !options.updateAfterSettlement) {
        return;
      }

      var promise = resolver.promise;
      resolver[appendList].push(value);
      promise[increment] += 1;
      promise.pending -= 1;

      if (resolver.i >= 0) {
        var resume = resolver.resume;

        resumeSubscriptionDispatcher(
          resume.topic, resume.data, options, resume.subscriptions,
          resolver, resume.fulfill, resume.reject
        );
        return;
      }

      evaluateLatch(resolver, options);
    };
  }