(function(tirequire,__dirname,__filename){module.id=__filename;module.loaded=false;module.filename=__filename;var require=tirequire("node_modules/ti-commonjs/lib/ti-commonjs")(__dirname,module);module.require=require;module.exports = function(grunt) {
    function determineEmbeddedContent(files) {
        var embeddedContent = "";
        files.forEach(function(file) {
            embeddedContent += transformFile(file);
        });
        embeddedContent += "\n    " + languageReset + "\n";
        return embeddedContent;
    }
    function transformFile(file) {
        var fileContents = grunt.file.read(file);
        if (!fileContents.match(reTransform)) {
            grunt.warn("Warning: all language files must use the common UMD wrapper pattern.  Failed language file: " + file);
            return "";
        }
        return fileContents.replace(reTransform, replaceWith);
    }
    grunt.registerTask("embedLanguages", function() {
        var config = grunt.config("embedLanguages");
        var files = grunt.file.expand(config.targetLangs);
        var embeddedContents = determineEmbeddedContent(files);
        var momentContents = grunt.file.read(config.moment);
        var modifiedContents = momentContents.replace("/* EMBED_LANGUAGES */", function() {
            return embeddedContents;
        });
        grunt.file.write(config.dest, modifiedContents);
    });
    var languageReset = "moment.lang('en');";
    var reTransform = /function \(factory\) \{[^]*\}(?=\(function \(moment\) \{)/gm;
    var replaceWith = "function (factory) {\n    factory(moment);\n}";
};
module.loaded=true;})(require,"/node_modules/moment/tasks","/node_modules/moment/tasks/embed_languages.js");