<commit_before>define(function(require, module, exports) {
    main.consumes = ["Dialog", "util"];
    main.provides = ["dialog.upsell"];
    return main;
    
    function main(options, imports, register) {
        var Dialog = imports.Dialog;
        var util = imports.util;
        
        /***** Initialization *****/
        
        var plugin = new Dialog("Ajax.org", main.consumes, {
            name: "dialog.upsell",
            allowClose: true,
            modal: true,
            elements: [
                { type: "filler" },
                { type: "button", id: "no", caption: "Cancel", hotkey: "ESC", skin: "c9-simple-btn", margin: "7 10 0 0" },
                { type: "button", id: "yes", caption: "Go Premium!", color: "green", "default": true, hotkey: "Y" }
            ]
        });
        
        /***** Methods *****/
        
        function show(onYes, onNo, title, header, msg, options) {
            if (!options)
                options = {isHTML: true};
                
            return plugin.queue(function(){
                var cancel = options.cancel;
                var metadata = options.metadata;
                
                title = title || "This is a Premium feature";
                header = header || "Upgrade to Premium Now!";
                msg = msg || 'A better, faster, more versatile Cloud9 is just a click away. Check out our <a href="https://c9.io/pricing" target="_blank">amazing premium plans</a>.'
                
                plugin.title = title;
                plugin.heading = options && options.isHTML ? header : util.escapeXml(header);
                plugin.body = options && options.isHTML ? msg : util.escapeXml(msg).replace(/\n/g, "<br>");
                
                plugin.getElement("yes").setCaption(options.yes || "Go Premium!");
                plugin.getElement("no").setCaption(options.no || "Cancel");

                plugin.allowClose = cancel;
                
                var gotYesNo = false;
                plugin.once("hide", function(){
                    !gotYesNo && cancel && onNo(false, true, metadata);
                });
                
                plugin.update([
                    { id: "yes", onclick: function(){ 
                        gotYesNo = true; 
                        plugin.hide(); 
                        onYes(false, metadata); 
                    }},
                    { id: "no", onclick: function(){ 
                        gotYesNo = true;
                        plugin.hide(); 
                        onNo(false, false, metadata); 
                    }}
                ]);<commit_msg>Fix property access of undefined<commit_after>define(function(require, module, exports) {
    main.consumes = ["Dialog", "util"];
    main.provides = ["dialog.upsell"];
    return main;
    
    function main(options, imports, register) {
        var Dialog = imports.Dialog;
        var util = imports.util;
        
        /***** Initialization *****/
        
        var plugin = new Dialog("Ajax.org", main.consumes, {
            name: "dialog.upsell",
            allowClose: true,
            modal: true,
            elements: [
                { type: "filler" },
                { type: "button", id: "no", caption: "Cancel", hotkey: "ESC", skin: "c9-simple-btn", margin: "7 10 0 0" },
                { type: "button", id: "yes", caption: "Go Premium!", color: "green", "default": true, hotkey: "Y" }
            ]
        });
        
        /***** Methods *****/
        
        function show(onYes, onNo, title, header, msg, options) {
            if (!options)
                options = {isHTML: true};
                
            return plugin.queue(function(){
                var cancel = options.cancel;
                var metadata = options.metadata;
                
                title = title || "This is a Premium feature";
                header = header || "Upgrade to Premium Now!";
                onYes = onYes || function() {};
                onNo = onNo || function() {};
                msg = msg || 'A better, faster, more versatile Cloud9 is just a click away. Check out our <a href="https://c9.io/pricing" target="_blank">amazing premium plans</a>.';
                
                plugin.title = title;
                plugin.heading = options && options.isHTML ? header : util.escapeXml(header);
                plugin.body = options && options.isHTML ? msg : util.escapeXml(msg).replace(/\n/g, "<br>");
                
                plugin.getElement("yes").setCaption(options.yes || "Go Premium!");
                plugin.getElement("no").setCaption(options.no || "Cancel");

                plugin.allowClose = cancel;
                
                var gotYesNo = false;
                plugin.once("hide", function(){
                    !gotYesNo && cancel && onNo(false, true, metadata);
                });
                
                plugin.update([
                    { id: "yes", onclick: function(){ 
                        gotYesNo = true; 
                        plugin.hide(); 
                        onYes(false, metadata); 
                    }},
                    { id: "no", onclick: function(){ 
                        gotYesNo = true;
                        plugin.hide(); 
                        onNo(false, false, metadata); 
                    }}
                ]);
{'fraction_non_alphanumeric': 0.13378978534418948, 'fraction_numerical': 0.0029607698001480384, 'mean_word_length': 1.324731182795699, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4425698', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1307, 'n_words': 346}