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AAM,EAAQ,EAAK,MAAM,KACnB,EAAW,EAAM,EAAM,OAAS,GACtC,KAAK,IAAI,0BACJ,KAAK,OAAO,IACZ,KAAK,KAAK,KAAK,EAAM,MAAM,EAAG,EAAM,OAAS,GAAG,KAAK,MAAM,GAClE,GACJ,IAGN,KAAK,KAAK,QAAS,CAAC,gBAAgB,KAChC,KAAK,MAAM,WAAW,IAAM,KAAK,MAAM,YACvC,KAAK,MAAM,aAAa,KACpB,MAAM,EAAO,GACb,YAAY,OAAO,MAAK,IACpB,EAAE,SAAS,IACP,MAAM,EAAM,EAAK,MAAM,4BAA4B,IACxB,IAAvB,EAAK,QAAQ,KACb,EAAK,KAAK,GACV,QAAQ,IAAI,WAAa,EAAM,4BAC/B,KAAK,IAAI,uBACJ,KAAK,KAAK,KAAK,EAAM,6BAC9B,GACF,GACL,GACH,IAGN,MAAM,YAAc,CAChB,IAAK,KACL,OAAQ,KACR,MAAO,KACP,cAAgB,GACL,IAAI,SAAQ,CAAC,EAAS,KACzB,QAAQ,IAAI,kBAAkB,GAC9B,KAAK,GAAM,CAAC,EAAK,KACT,EACA,EAAO,GAEP,EAAQ,EACZ,GACH,IAGT,GAAI,KACK,YAAY,MACb,YAAY,IAAM,YAAY,cAAc,gBAAkB,sCAE3D,YAAY,KAEvB,MAAO,KACE,YAAY,SACb,YAAY,OAAS,YAAY,cAAc,gBAAkB,0CAE9D,YAAY,QAEvB,KAAM,KACG,YAAY,QACb,YAAY,MAAQ,YAAY,cAAc,gBAAkB,4CAE7D,YAAY","file":"/npm/entcore@3.4.4-dev.0/gulpfile.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/entcore@3.4.4-dev.0/gulpfile.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var gulp = require('gulp');\nvar webpack = require('webpack-stream');\nvar glob = require('glob');\nvar rename = require('gulp-rename');\nvar argv = require('yargs').argv;\nvar rimraf = require(\"rimraf\");\nvar gap = require('gulp-append-prepend');\n\nlet springboardPath = '../springboard-open-ent';\nif (argv.springboard) {\n    springboardPath = argv.springboard;\n    console.log('Using springboard at ' + springboardPath);\n}\ngulp.task('clean:types', function (cb) {\n    rimraf('./types/src', cb);\n});\ngulp.task(\"do-build\", [\"clean:types\"], function () {\n    return gulp.src('./')\n        .pipe(webpack(require('./webpack.config.js')))\n        .on('error', function handleError() {\n            this.emit('end');\n        })\n        .pipe(gulp.dest('./'));\n});\ngulp.task(\"build\", [\"do-build\"], function () {\n    return gulp.src('./bundle/ng-app.js')\n    .pipe(gap.prependText('window.springboardBuildDate=\"'+new Date().toISOString()+'\";\\n'))\n    .pipe(gulp.dest(\"./bundle/\"));\n});\n\ngulp.task(\"build-dev\", [\"clean:types\"], () => {\n    webpack.plugins = [];\n    return gulp.src('./')\n        .pipe(webpack(require('./webpack-dev.config.js')))\n        .on('error', function handleError() {\n            this.emit('end');\n        })\n        .pipe(gulp.dest('./'));\n});\n\ngulp.task('update', ['build-dev'], () => {\n    GlobManager.js().then(f => {\n        //console.log(\"founded js: \",f.length,f.join(\",\"))\n        f.forEach((file) => {\n            const split = file.split('/');\n            const fileName = split[split.length - 1];\n            console.log('Copying js to ' + split.slice(0, split.length - 1).join('/'));\n            gulp.src('./bundle/ng-app.js')\n                .pipe(rename(fileName))\n                .pipe(gulp.dest(split.slice(0, split.length - 1).join('/')));\n        });\n    });\n    GlobManager.jsMap().then(f => {\n        f.forEach((file) => {\n            const split = file.split('/');\n            const fileName = split[split.length - 1];\n            gulp.src('./bundle/ng-app.js.map')\n                .pipe(rename(fileName))\n                .pipe(gulp.dest(split.slice(0, split.length - 1).join('/')));\n        });\n    });\n})\n\ngulp.task(\"watch\", [\"clean:types\"], () => {\n    gulp.watch('**/*.ts', () => gulp.start('update'));\n    gulp.watch('**/*.html', () => {\n        const apps = [];\n        GlobManager.html().then(f => {\n            f.forEach((file) => {\n                const app = file.split('/public/template/entcore')[0];\n                if (apps.indexOf(app) === -1) {\n                    apps.push(app);\n                    console.log('copy to ' + app + '/public/template/entcore')\n                    gulp.src('./src/template/**/*')\n                        .pipe(gulp.dest(app + '/public/template/entcore'));\n                }\n            });\n        })\n    });\n});\n\nconst GlobManager = {\n    _js: null,\n    _jsMap: null,\n    _html: null,\n    _buildPromise: (path) => {\n        return new Promise((resolve, reject) => {\n            console.log(\"init glob for: \",path)\n            glob(path, (err, f) => {\n                if (err) {\n                    reject(err); \n                } else {\n                    resolve(f);\n                }\n            })\n        })\n    },\n    js: () => {\n        if (!GlobManager._js) {\n            GlobManager._js = GlobManager._buildPromise(springboardPath + '/mods/**/public/dist/entcore/*.js')\n        }\n        return GlobManager._js;\n    },\n    jsMap: () => {\n        if (!GlobManager._jsMap) {\n            GlobManager._jsMap = GlobManager._buildPromise(springboardPath + '/mods/**/public/dist/entcore/*.js.map')\n        }\n        return GlobManager._jsMap;\n    },\n    html: () => {\n        if (!GlobManager._html) {\n            GlobManager._html = GlobManager._buildPromise(springboardPath + '/mods/**/public/template/entcore/*.html')\n        }\n        return GlobManager._html;\n    }\n}\n"]}