///////////////////////////////////////////////////////////////////// exports methods: get sourceNode from inline-source-map file
184719
function getNodeFromScriptFile(scriptfile) {
    if (fs.existsSync(scriptfile)) {
        try {
            return SourceNode.fromStringWithSourceMap(
                getScriptFromFile(scriptfile),
                new SourceMapConsumer(getMapFromScriptFile(scriptfile))
            );
        } catch (error) {
            console.error('getNodeFromScriptFile() error: ' + error);
            return new SourceNode();
        }
    } else {
        return new SourceNode();
    }
}
1283778
function (output) {
              // Manually convert paths to relative, because LESS
              // can make tose absolute for complex cases.
              var map = JSON.parse(output);
              var dir = path.dirname(context.pathname);
              map.sources.forEach(function (file, idx) {
                var rel = path.relative(dir, file);
                if (path.sep === '\\') { rel = rel.replace('\\', '/'); }
                map.sources[idx] = rel;
              });

              self.map = JSON.stringify(map);
            }
5035
function getCodeMap(node) {
    const code_map = node.toStringWithSourceMap();

    // patch
    node.walkSourceContents(function (sourceFile, sourceContent) {
        if (!code_map.map._sources.has(sourceFile)) {
            code_map.map._sources.add(sourceFile);
        }
    });

    return code_map;
}
145292
function addSourceInstanceName(
  { node, getNode, loadNodeContent, actions, createNodeId, reporter },
  pluginOptions
) {
  const { createNodeField } = actions;

  const parent = getNode(node.parent);

  const sourceInstanceName =
    parent && parent.sourceInstanceName ? parent.sourceInstanceName : 'unknown';

  // Add node field
  createNodeField({
    node,
    name: 'sourceName',
    value: sourceInstanceName
  });

  // console.error('adding', sourceInstanceName, node.fields.sourceInstanceName)

  // if (!parent) {
  //   // Node has already been processed.
  //   console.error('Ocular markdown node has no parent', JSON.stringify(node.parent), JSON.stringify(node.sourceInstanceName), node.relativePath);
  //   return;
  // }

  if (parent) {
    addMissingFrontmatter(node, sourceInstanceName);
  }
}
923558
function getSourceMappingURL() {
	if (path.extname(argv.output) === '.css') {
		return `\n/*# sourceMappingURL=${path.basename(argv.output)}.map */`;
	}
	return `\n//# sourceMappingURL=${path.basename(argv.output)}.map`;
}
73094
function() {
      var node = this.startNode();
      this.expect('export');

      if (this.value === 'default') {
        return this.parseExportDefaultDeclaration(node);
      }

      if (this.value === '*') {
        return this.parseExportAllDeclaration(node);
      }

      return this.parseExportNamedDeclaration(node);
    }
825434
function getSourceMap(options) {
  var sourceMap = options.sourceMap;

  if (sourceMap && typeof sourceMap !== 'string' && options.outFile) {
    sourceMap = options.outFile + '.map';
  }

  return sourceMap && typeof sourceMap === 'string' ? path.resolve(sourceMap) : null;
}
1203567
function parseBrowserPackOutput(buf) {
  const m = /\n\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,([^\s]+)\n?$/.exec(buf)
  if (!m) throw new Error('browser-pack did not insert source-map data URL in output: ' + buf.toString('utf-8'))
  const javascript = buf.slice(0, m.index)
  const sourceMap = JSON.parse(Buffer.from(m[1], 'base64'))
  return {
    javascript: javascript,
    sourceMap: sourceMap
  }
}
954974
function FilesNode(src, raw, config) {
  utils.define(this, 'isFilesNode', true);
  this.options = utils.omit(raw.options, ['mapDest', 'flatten', 'rename', 'filter']);
  this.src = utils.arrayify(src);

  if (this.options.resolve) {
    var cwd = path.resolve(this.options.cwd || process.cwd());
    this.src = this.src.map(function(fp) {
      return path.resolve(cwd, fp);
    });
  }

  if (raw.options.mapDest) {
    this.dest = mapDest(raw.dest, src, raw);
  } else {
    this.dest = rewriteDest(raw.dest, src, raw.options);
  }

  // copy properties to the new node
  for (var key in raw) {
    if (key !== 'src' && key !== 'dest' && key !== 'options') {
      this[key] = raw[key];
    }
  }
  util.run(config, 'filesNode', this);
}
605970
function getContentFromNode(options, node) {
	return new Promise(function (resolve, reject) {
		if (node.tag === 'link') {
			return fs.readFile(normalizePath(node.attrs.href, options.root, options.from), 'utf8', function (err, res) {
				return err ? reject(err) : resolve(res);
			});
		}

		return resolve(node.content);
	});
}
779982
function _getNode(nodePath, extendedConfiguration) {
    checkIsString('nodePath', nodePath);
    if (!entitiesMap.hasIn(nodePath.split(SEPARATOR))) {
        console.warn(`
            It seems the definition your are trying to use does not exists in the entity definitions of your project.
            The definition you want is ${nodePath} and the definition map is:
            `, entitiesMap.toJS()
        );
        throw new Error('Wrong definition path given, see waning for more details');
    }
    let conf = entitiesMap.getIn(nodePath.split(SEPARATOR));
    if (extendedConfiguration) {
        checkIsObject(extendedConfiguration);
        conf = conf.mergeDeep(extendedConfiguration);
    }
    return conf;
}
767150
static SourceFile extractSourceMap(
      SourceFile jsFile, String sourceMapURL, boolean parseInlineSourceMaps) {
    // Javascript version of the compiler can only deal with inline sources.
    if (sourceMapURL.startsWith(BASE64_URL_PREFIX)) {
      byte[] data =
          BaseEncoding.base64().decode(sourceMapURL.substring(BASE64_URL_PREFIX.length()));
      String source = new String(data, StandardCharsets.UTF_8);
      return SourceFile.fromCode(jsFile.getName() + ".inline.map", source);
    }
    return null;
  }
1237692
private void preprocessExportDeclaration(Node n) {
    if (!n.getString().equals("exports")
        || !isAssignTarget(n)
        || !n.getGrandparent().isExprResult()) {
      return;
    }

    checkState(currentScript.defaultExportRhs == null);
    Node exportRhs = n.getNext();
    if (isNamedExportsLiteral(exportRhs)) {
      Node insertionPoint = n.getGrandparent();
      for (Node key = exportRhs.getFirstChild(); key != null; key = key.getNext()) {
        String exportName = key.getString();
        JSDocInfo jsdoc = key.getJSDocInfo();
        Node rhs = key.hasChildren() ? key.removeFirstChild() : IR.name(exportName).srcref(key);
        Node lhs = IR.getprop(IR.name("exports"), IR.string(exportName)).srcrefTree(key);
        Node newExport =
            IR.exprResult(IR.assign(lhs, rhs).srcref(key).setJSDocInfo(jsdoc)).srcref(key);
        insertionPoint.getParent().addChildAfter(newExport, insertionPoint);
        insertionPoint = newExport;
      }
      n.getGrandparent().detach();
    }
  }
473055
function _generateLineMap (res, file) {
    if (res.errors && res.errors.length) {
        return;
    }
    var syntaxTree = res.syntaxTree, templates = [];
    // identify the templates in the syntax tree
    for (var i = 0; i < syntaxTree.length; i++) {
        if (syntaxTree[i].type === 'template') {
            templates.push(syntaxTree[i]);
        }
    }

    var nbrOfLinesInCompiledTemplate = 5; //all generated templates got fixed no of LOC
    var lineMap = [], pos = HEADER_SZ, template;
    var pos1 = -1; // position of the next template start
    var pos2 = -1; // position of the next template end
    var tplIdx = -1; // position of the current template

    for (var i = 0; i < (file.split(/\n/g).length + 1); i++) {
        if (i === 0 || i === pos2) {
            // end of current template: let's determine next pos1 and pos2
            tplIdx = (i === 0) ? 0 : tplIdx + 1;
            if (tplIdx < templates.length) {
                // there is another template
                template = templates[tplIdx];
                pos1 = template.startLine;
                pos2 = Math.max(template.endLine, pos1);
            } else {
                // last template has been found
                tplIdx = pos1 = pos2 = -1;
            }
            if (i === 0) {
                lineMap[0] = 0;
            }
            i++;
        }
        if (i === pos1) {
            for (var j = pos1; j < (pos2 + 1); j++) {
                // all lines are set to the template start
                lineMap[i] = pos;
                i++;
            }
            pos += nbrOfLinesInCompiledTemplate;
            i -= 2; // to enter the i===pos2 clause at next step
        } else {
            lineMap[i] = pos;
            pos++;
        }
    }
    return lineMap;
}
378712
function getImports(moduleTree) {
      var imports = [];

      function addImport(name) {
        if (indexOf.call(imports, name) == -1)
          imports.push(name);
      }

      // tree traversal, NB should use visitor pattern here
      function traverse(object, iterator, parent, parentProperty) {
        var key, child;
        if (iterator(object, parent, parentProperty) === false)
          return;
        for (key in object) {
          if (!object.hasOwnProperty(key))
            continue;
          if (key == 'location' || key == 'type')
            continue;
          child = object[key];
          if (typeof child == 'object' && child !== null)
            traverse(child, iterator, object, key);
        }
      }

      traverse(moduleTree, function(node) {
        // import {} from 'foo';
        // export * from 'foo';
        // export { ... } from 'foo';
        // import * as x from 'foo';
        if (node.type == 'EXPORT_DECLARATION') {
          if (node.declaration.moduleSpecifier)
            addImport(node.declaration.moduleSpecifier.token.processedValue);
        }
        else if (node.type == 'IMPORT_DECLARATION')
          addImport(node.moduleSpecifier.token.processedValue);
        else if (node.type == 'MODULE_DECLARATION')
          addImport(node.expression.token.processedValue);
      });
      return imports;
    }
121754
function getResolvedSymbol(node) {
            var links = getNodeLinks(node);
            if (!links.resolvedSymbol) {
                links.resolvedSymbol = !ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol;
            }
            return links.resolvedSymbol;
        }
605715
function jsTreeCtrl() {
        /*jshint validthis:true */
        var nodeSerialId = 1;
        var vm = this;

        vm.nodesFingerprint = function (e) {
            if (!e.__uiNodeId) {
                e.__uiNodeId = nodeSerialId++;
            }
            return '' + e.__uiNodeId + (e.id || '') + (e.text || '') + (e.type || '');
        };

        vm.changeWatcher = function (arraySource, tokenFn) {
            var self;
            var getTokens = function () {
                var result = [], token, el;
                if (arraySource) {
                    var array = angular.isFunction(arraySource) ? arraySource() : arraySource;
                    for (var i = 0, n = array.length; i < n; i++) {
                        el = array[i];
                        token = tokenFn(el);
                        map[token] = el;
                        result.push(token);
                    }
                }
                return result;
            };
            // returns elements in that are in a but not in b
            // subtractAsSets([4, 5, 6], [4, 5, 7]) => [6]
            var subtractAsSets = function (a, b) {
                var result = [], inB = {}, i, n;
                for (i = 0, n = b.length; i < n; i++) {
                    inB[b[i]] = true;
                }
                for (i = 0, n = a.length; i < n; i++) {
                    if (!inB[a[i]]) {
                        result.push(a[i]);
                    }
                }
                return result;
            };

            // Map objects to tokens and vice-versa
            var map = {};

            var applyChanges = function (newTokens, oldTokens) {
                var i, n, el, token;
                var replacedTokens = {};
                var removedTokens = subtractAsSets(oldTokens, newTokens);
                for (i = 0, n = removedTokens.length; i < n; i++) {
                    var removedToken = removedTokens[i];
                    el = map[removedToken];
                    delete map[removedToken];
                    var newToken = tokenFn(el);
                    // if the element wasn't removed but simply got a new token, its old token will be different from the current one
                    if (newToken === removedToken) {
                        self.onRemoved(el);
                    } else {
                        replacedTokens[newToken] = removedToken;
                        self.onChanged(el);
                    }
                }

                var addedTokens = subtractAsSets(newTokens, oldTokens);
                for (i = 0, n = addedTokens.length; i < n; i++) {
                    token = addedTokens[i];
                    el = map[token];
                    if (!replacedTokens[token]) {
                        self.onAdded(el);
                    }
                }

            };
            self = {
                subscribe: function (scope, onChanged) {
                    scope.$watch(getTokens, function (newTokens, oldTokens) {
                        if (!onChanged || onChanged(newTokens, oldTokens) !== false) {
                            applyChanges(newTokens, oldTokens);
                        }
                    }, true);
                },
                onAdded: angular.noop,
                onChanged: angular.noop,
                onRemoved: angular.noop
            };
            return self;
        };
    }