/*
Modified version of the function onsapUiSupportTechInfoData from core.support.plugins.TechInfo.js
763471
function getTechnicalInformation(technicalInfo) {
		var content = '';

		if (!technicalInfo) {
			return new Handlebars.SafeString(content);
		}

		try {
			technicalInfo.modules.sort();
			var html = ["<div class='sapUiSupportToolbar'>",
						"<div><div class='sapUiSupportTechInfoCntnt'>",
						"<table border='0' cellpadding='3'>"];
			techInfoRenderer.subheader(html, "Support Assistant Information");
			techInfoRenderer.line(html, true, true, "Location", technicalInfo.supportAssistant.location);
			techInfoRenderer.line(html, true, true, "Version", technicalInfo.supportAssistant.versionAsString);
			techInfoRenderer.subheader(html, "Application Information");
			techInfoRenderer.line(html, true, true, "SAPUI5 Version", function(buffer){
				var sapUI5Version = technicalInfo.sapUi5Version;
				if (sapUI5Version && sapUI5Version.version) {
					var oVersionInfo = sapUI5Version.version;
					var sVersion = jQuery.sap.escapeHTML(oVersionInfo.version || "");
					buffer.push(sVersion, " (built at ", jQuery.sap.escapeHTML(oVersionInfo.buildTimestamp || ""), ", last change ", jQuery.sap.escapeHTML(oVersionInfo.scmRevision || ""), ")");
				} else {
					buffer.push("not available");
				}
			});
			techInfoRenderer.line(html, true, true, "Core Version", function(buffer){
				return technicalInfo.version + " (built at " + technicalInfo.build + ", last change " + technicalInfo.change + ")";
			});
			techInfoRenderer.line(html, true, true, "Loaded jQuery Version", function(buffer){
				return technicalInfo.jquery;
			});
			techInfoRenderer.line(html, true, true, "User Agent", function(buffer){
				return technicalInfo.useragent + (technicalInfo.docmode ? ", Document Mode '" + technicalInfo.docmode + "'" : "");
			});
			techInfoRenderer.line(html, true, true, "Application", technicalInfo.appurl);
			techInfoRenderer.multiline(html, true, true, "Configuration (bootstrap)", technicalInfo.bootconfig);
			techInfoRenderer.multiline(html, true, true, "Configuration (computed)", technicalInfo.config);
			if (!jQuery.isEmptyObject(technicalInfo.libraries)) {
				techInfoRenderer.multiline(html, true, true, "Libraries", technicalInfo.libraries);
			}
			techInfoRenderer.multiline(html, true, true, "Loaded Libraries", technicalInfo.loadedLibraries);
			techInfoRenderer.line(html, true, true, "Loaded Modules", function(buffer){
				jQuery.each(technicalInfo.modules, function(i,v){
					if (v.indexOf("sap.ui.core.support") < 0) {
						buffer.push("<span>", jQuery.sap.escapeHTML(v || ""), "</span>");
						if (i < technicalInfo.modules.length - 1) {
							buffer.push(", ");
						}
					}
				});
			});
			techInfoRenderer.multiline(html, true, true, "URI Parameters", technicalInfo.uriparams);

			html.push("</table></div>");
			content = html.join('');
		} catch (ex) {
			jQuery.sap.log.warning('There was a problem extracting technical info.');
		}

		return new Handlebars.SafeString(content);
	}
495933
function ()
	{
		var out = [];
		var data=this.s.dt.aoData;
		var i, iLen;

		for ( i=0, iLen=data.length ; i<iLen ; i++ )
		{
			if ( data[i]._DTTT_selected )
			{
				out.push( this.s.dt.oInstance.fnGetData(i) );
			}
		}

		return out;
	}
1246989
function report (info) {
  if (!info) {
    return null
  }

  const { name, current, latest } = info

  if (!name || !current || !latest) {
    return null
  }

  const messages = [
    `update available ${chalk.dim(current)} → ${chalk.green(latest)}`,
    `Run ${chalk.cyan('npm i ' + name + ' -D')} to update`
  ]

  const boxenOptions = {
    padding: 1,
    margin: 1,
    align: 'center',
    borderColor: 'yellow',
    borderStyle: 'round'
  }

  return boxen(messages.join('\n'), boxenOptions)
}
155206
function getTechnicalContent(oFrameworkInformation) {
				oData = {
					version: oFrameworkInformation.commonInformation.version,
					build: oFrameworkInformation.commonInformation.buildTime,
					change: oFrameworkInformation.commonInformation.lastChange,
					useragent: oFrameworkInformation.commonInformation.userAgent,
					docmode: oFrameworkInformation.commonInformation.documentMode,
					debug: oFrameworkInformation.commonInformation.debugMode,
					bootconfig: oFrameworkInformation.configurationBootstrap,
					config: oFrameworkInformation.configurationComputed,
					loadedlibs: oFrameworkInformation.loadedLibraries,
					modules: oFrameworkInformation.loadedModules,
					uriparams: oFrameworkInformation.URLParameters,
					appurl: oFrameworkInformation.commonInformation.applicationHREF
				};

				var html = ["<table class='sapUiSelectable' border='0' cellspacing='5' cellpadding='5' width='100%'><tbody class='sapUiSelectable'>"];
				line(html, true, true, "SAPUI5 Version", function (buffer) {
					buffer.push(oData.version, " (built at ", oData.build, ", last change ", oData.change, ")");
				});
				line(html, true, true, "User Agent", function (buffer) {
					buffer.push(oData.useragent, (oData.docmode ? ", Document Mode '" + oData.docmode + "'" : ""));
				});
				line(html, true, true, "Debug Sources", function (buffer) {
					buffer.push((oData.debug ? "ON" : "OFF"));
				});
				line(html, true, true, "Application", oData.appurl);
				multiline(html, true, true, "Configuration (bootstrap)", oData.bootconfig);
				multiline(html, true, true, "Configuration (computed)", oData.config);
				multiline(html, true, true, "URI Parameters", oData.uriparams);
				// e2e trace section
				line(html, true, true, "End-to-End Trace", function (buffer) {
					buffer.push("<label class='sapUiSupportLabel'>Trace Level:</label>",
						"<select id='" + buildControlId(e2eTraceConst.selLevel) + "' class='sapUiSupportTxtFld' >",
						"<option value='low'>LOW</option>",
						"<option value='medium' selected>MEDIUM</option>",
						"<option value='high'>HIGH</option>",
						"</select>"
					);
					buffer.push("<button id='" + buildControlId(e2eTraceConst.btnStart) + "' class='sapUiSupportBtn'>Start</button>");
					buffer.push("<div class='sapUiSupportDiv'>");
					buffer.push("<label class='sapUiSupportLabel'>XML Output:</label>");
					buffer.push("<textarea id='" + buildControlId(e2eTraceConst.taContent) + "' class='sapUiSupportTxtArea sapUiSelectable' readonly ></textarea>");
					buffer.push("</div>");
				});

				line(html, true, true, "Loaded Libraries", function (buffer) {
					buffer.push("<ul class='sapUiSelectable'>");
					jQuery.each(oData.loadedlibs, function (i, v) {
						if (v && (typeof (v) === "string" || typeof (v) === "boolean")) {
							buffer.push("<li class='sapUiSelectable'>", i + " " + v, "</li>");
						}
					});
					buffer.push("</ul>");
				});

				line(html, true, true, "Loaded Modules", function (buffer) {
					buffer.push("<div class='sapUiSupportDiv sapUiSelectable' id='" + buildControlId(controlIDs.dvLoadedModules) + "'></div>");
				});

				html.push("</tbody></table>");

				return new sap.ui.core.HTML({
					content: html.join("").replace(/\{/g, "&#123;").replace(/\}/g, "&#125;")
				});
			}
165587
function rdpInfos(extendedInfoConditional) {
	var self = {
		codePage : new type.UInt32Le(),
        flag : new type.UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS | InfoFlag.INFO_DISABLECTRLALTDEL | InfoFlag.INFO_ENABLEWINDOWSKEY),
        cbDomain : new type.UInt16Le(function() {
        	return self.domain.size() - 2;
        }),
        cbUserName : new type.UInt16Le(function() {
        	return self.userName.size() - 2;
        }),
        cbPassword : new type.UInt16Le(function() {
        	return self.password.size() - 2;
        }),
        cbAlternateShell : new type.UInt16Le(function() {
        	return self.alternateShell.size() - 2;
        }),
        cbWorkingDir : new type.UInt16Le(function() {
        	return self.workingDir.size() - 2;
        }),
        domain : new type.BinaryString(new Buffer('\x00', 'ucs2'),{ readLength : new type.CallableValue(function() {
        	return self.cbDomain.value + 2;
        })}),
        userName : new type.BinaryString(new Buffer('\x00', 'ucs2'), { readLength : new type.CallableValue(function() {
        	return self.cbUserName.value + 2;
        })}),
        password : new type.BinaryString(new Buffer('\x00', 'ucs2'), { readLength : new type.CallableValue(function () {
        	return self.cbPassword.value + 2;
        })}),
        alternateShell : new type.BinaryString(new Buffer('\x00', 'ucs2'), { readLength : new type.CallableValue(function() {
        	return self.cbAlternateShell.value + 2;
        })}),
        workingDir : new type.BinaryString(new Buffer('\x00', 'ucs2'), { readLength : new type.CallableValue(function() {
        	return self.cbWorkingDir.value + 2;
        })}),
        extendedInfo : rdpExtendedInfos({ conditional : extendedInfoConditional })
	};
	
	return new type.Component(self);
}
520249
function handleNameUpdate(newFilenameInputEl, fileId) {
        var newName = newFilenameInputEl.value,
            origExtension;

        if (newName !== undefined && qq.trimStr(newName).length > 0) {
            origExtension = getOriginalExtension(fileId);

            if (origExtension !== undefined) {
                newName = newName + "." + origExtension;
            }

            spec.onSetName(fileId, newName);
        }

        spec.onEditingStatusChange(fileId, false);
    }
526719
function __fetchTicketInfo(server, ticketid, callback) {

    assert(server.cache_folder);

    var filename = server._ticket_cache_file(ticketid);
    //xx console.log("filename " , filename.red);

    assert(_.isFunction(callback));

    var command = 'issues/' + ticketid.toString() + '.json?include=relations,journals';

    perform_http_get_transaction(server,command, function (err, txt) {

        txt = fixUnicode(txt);

        var ticket = null;
        try {
            var o = JSON.parse(txt);

            fs.writeFileSync(filename, JSON.stringify(o, null, " "));
            console.warn(" writing ", filename);
            ticket= o.issue;
        } catch (err) {
            console.log("error !".red, err.message);
            fs.writeFileSync("toto.txt", txt);
            callback(err);
            return;
            // the ticket may have been deleted
        }
        callback(null,ticket);

    });

}
242674
function getStaticData(callback) {

  return new Promise((resolve) => {
    process.nextTick(() => {

      let data = {};

      data.version = version();

      Promise.all([
        system.system(),
        system.bios(),
        system.baseboard(),
        system.chassis(),
        osInfo.osInfo(),
        osInfo.uuid(),
        osInfo.versions(),
        cpu.cpu(),
        cpu.cpuFlags(),
        graphics.graphics(),
        network.networkInterfaces(),
        memory.memLayout(),
        filesystem.diskLayout()
      ]).then(res => {
        data.system = res[0];
        data.bios = res[1];
        data.baseboard = res[2];
        data.chassis = res[3];
        data.os = res[4];
        data.uuid = res[5];
        data.versions = res[6];
        data.cpu = res[7];
        data.cpu.flags = res[8];
        data.graphics = res[9];
        data.net = res[10];
        data.memLayout = res[11];
        data.diskLayout = res[12];
        if (callback) { callback(data); }
        resolve(data);
      });
    });
  });
}
1277610
function writeSupportCells(supportData, compatNotes, browserPlatformType) {
  let output = '';

  for (let browserNameKey of Object.keys(browsers[browserPlatformType])) {
    let support = supportData[browserNameKey];
    let supportInfo = '';
    // if supportData is an array, there are multiple support statements
    if (Array.isArray(support)) {
      for (let entry of support) {
        supportInfo += `<p>${writeSupportInfo(entry, browserNameKey, compatNotes)}</p>`;
      }
    } else if (support) { // there is just one support statement
      supportInfo = writeSupportInfo(support, browserNameKey, compatNotes);
    } else { // this browser has no info, it's unknown
    supportInfo = writeSupportInfo(null);
  }
  output += `<td class="${getSupportClass(supportData[browserNameKey])}">${supportInfo}</td>`;
}
return output;
}
300632
function uagent_info()
   { 
	 $this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):'';
	 $this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):'';
		
	 //Let's initialize some values to save cycles later.
	 $this->InitDeviceScan();
   }
1338391
function onDialogUpdate() {
    var pushOccupants = [],
        newDialogName = $('#dialog-name-input').val().trim(),
        toUpdate = {};

    $('#add_new_occupant .users_form.active').each(function(index) {
        pushOccupants[index] = $(this).attr('id').slice(0, -4);
    });

    if (currentDialog.name != newDialogName) {
        toUpdate.name = newDialogName;
    }

    if (pushOccupants.length > 0) {
        toUpdate.push_all = {
            occupants_ids: pushOccupants
        }
    }

    if (Object.keys(toUpdate).length == 0) {
        console.log("Nothing to update");
    } else {
        console.log("Updating the dialog with params: " + JSON.stringify(toUpdate));

        QB.chat.dialog.update(currentDialog._id, toUpdate, function(err, res) {
            if (err) {
                console.log(err);
                bootbox.alert("Error while updating chat dialog: " + JSON.stringify(err));

            } else {
                console.log("Dialog updated");

                var dialogId = res._id;
                dialogs[dialogId] = res;

                currentDialog = res;

                $('#' + res._id).remove();

                showOrUpdateDialogInUI(res, true);

                // notify new users about current video call

                if (callIsInProgress && pushOccupants.length) {
                    var newOccupants = pushOccupants.map(function(id) {
                        return Number(id);
                    });

                    notifyOccupants(res.occupants_ids, dialogId, 2, newOccupants);
                } else {
                    notifyOccupants(res.occupants_ids, dialogId, 2);
                }

                $('#' + res._id).removeClass('inactive').addClass('active');
            }
        });
    }

    $("#update_dialog").modal("hide");
    $('#dialog-name-input').val('');
    $('.users_form').removeClass("active");
}
170006
function addPluginName(data) {
	var loader = data.loader;
	var bundles = data.bundles;

	var promises = bundles.map(function(bundle) {
		if (!isJavaScriptBundle(bundle)) {
			return loader.normalize(bundle.name).then(function(name) {
				bundle.pluginName = name.substring(name.indexOf("!") + 1);
			});
		}
	});

	return Promise.all(promises).then(function() {
		return data;
	});
}
1257422
async function updateInfoPlist (version) {
  const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'mac', 'Info.plist')
  const file = plist.parse(await readFile(filePath, { encoding: 'utf8' }))

  file.CFBundleVersion = version
  file.CFBundleShortVersionString = version

  await writeFile(filePath, plist.build(file))
}
1020827
function getSupportClass(supportInfo) {
  let cssClass = 'unknown-support';

  if (Array.isArray(supportInfo)) {
    // the first entry should be the most relevant/recent and will be treated as "the truth"
    checkSupport(supportInfo[0].version_added, supportInfo[0].version_removed);
  } else if (supportInfo) { // there is just one support statement
    checkSupport(supportInfo.version_added, supportInfo.version_removed);
  } else { // this browser has no info, it's unknown
  return 'unknown-support';
}

function checkSupport(added, removed) {
  if (added === null) {
    cssClass = 'unknown-support';
  } else if (added) {
    cssClass = 'full-support';
    if (removed) {
      cssClass = 'no-support';
    }
  } else {
    cssClass = 'no-support';
  }
}

return cssClass;
}
391505
function(newCallFrames, details, asyncStackTrace)
    {
        // FIXME: declare this property in protocol and in JavaScript.
        if (details && details["stack_update_needs_step_in"])
            this.stepInto();
        else if (newCallFrames && newCallFrames.length)
            this._pausedScript(newCallFrames, this._debuggerPausedDetails.reason, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds, asyncStackTrace);
    }
577988
private void presistPostInformation(Context appContext, JsonObject postData) {
        preferenceProvider.get(appContext).edit()
                .putString(String.format(REGISTRAR_PREFERENCE_TEMPLATE, senderId), postData.toString())
                .commit();
    }
453329
function(content, info) {
    var infos = {
      version: this.version,
      timestamp: this.timestamp,
      deps: this.deps,
      mDeps: this.mDeps,
      info: info
    };
    fis.util.write(this.cacheInfo, JSON.stringify(infos));
    fis.util.write(this.cacheFile, content);
  }