var gulp=require("gulp"),concat=require("gulp-concat"),uglify=require("gulp-uglify"),rename=require("gulp-rename"),cssnano=require("gulp-cssnano"),autoprefixer=require("gulp-autoprefixer"),header=require("gulp-header"),replace=require("gulp-replace"),pkg=require("./package.json"),banner=["// ==================================================","// fancyBox v${pkg.version}","//","// Licensed GPLv3 for open source use","// or fancyBox Commercial License for commercial use","//","// http://fancyapps.com/fancybox/","// Copyright ${new Date().getFullYear()} fancyApps","//","// ==================================================",""].join("\n");gulp.task("scripts",(function(){return gulp.src(["src/js/core.js","src/js/media.js","src/js/guestures.js","src/js/slideshow.js","src/js/fullscreen.js","src/js/thumbs.js","src/js/hash.js","src/js/wheel.js"]).pipe(concat("jquery.fancybox.js")).pipe(replace(/({fancybox-version})/g,pkg.version)).pipe(header(banner,{pkg:pkg})).pipe(gulp.dest("dist")).pipe(rename({suffix:".min"})).pipe(uglify()).pipe(header(banner,{pkg:pkg})).pipe(gulp.dest("dist"))})),gulp.task("css",(function(){return gulp.src("src/css/*.css").pipe(autoprefixer({browsers:["last 5 versions"],cascade:!1})).pipe(concat("jquery.fancybox.css")).pipe(gulp.dest("dist")).pipe(rename({suffix:".min"})).pipe(cssnano({zindex:!1})).pipe(gulp.dest("dist"))})),gulp.task("default",["scripts","css"]);