{"version":3,"sources":["jsdelivr-header.js","/npm/angular-video@0.0.2/js/anguvideo.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACFA,QAAQ,OAAO,YAAa,IACvB,UAAU,YAAa,CAAC,OAAQ,SAAU,GACvC,MAAO,CACH,SAAU,KACV,MAAO,CACH,OAAQ,WACR,MAAO,IACP,OAAQ,KAEZ,SAAS,EACT,SAAU,4KAGV,KAAM,SAAU,EAAO,EAAS,GAC5B,IACI,EACA,EAFA,EAAmB,GAInB,EAAiB,EAAM,aAAe,oCAAsC,GAEhF,EAAM,OAAO,UAAU,SAAU,GACzB,IAOI,EAAO,QAAQ,UAAY,EACvB,EAAO,QAAQ,iBAAmB,EAClC,EAAmB,GAEnB,EAAmB,EAAO,QAAQ,QAAS,UAC3C,EAAc,EAAiB,MAAM,SAErC,GADA,EAAmB,EAAiB,QAAQ,QAAS,iBACjB,QAAQ,IAAM,EAAY,EAAY,OAAS,GAAI,UAAY,EAAY,EAAY,OAAS,KAEjI,EAAO,QAAQ,aAAe,GAErC,EAAQ,EAAO,QAAQ,QAGvB,EAAmB,kCADnB,EAAmB,EAAO,MAAM,EAAQ,EAAG,EAAO,SACuB,GAClE,EAAO,QAAQ,gBAAkB,IACpC,EAAO,QAAQ,UAAY,EAC3B,EAAmB,EAAS,GAGsB,IADlD,EAAmB,EAAO,QAAQ,YAAa,WAAa,GACvC,QAAQ,mBACzB,EAAmB,EAAiB,QAAQ,gBAAiB,iBAKzE,EAAM,IAAM,EAAK,mBAAmB,GAE5C,GACJ,EAER","file":"/npm/angular-video@0.0.2/js/anguvideo.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/angular-video@0.0.2/js/anguvideo.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Created by Mariandi on 11/03/2014.\n */\n/*global angular*/\nangular.module('anguvideo', [])\n    .directive(\"anguvideo\", ['$sce', function ($sce) {\n        return {\n            restrict: 'EA',\n            scope: {\n                source: '=ngModel',\n                width: '@',\n                height: '@'\n            },\n            replace: true,\n            template: '<div class=\"anguvideo\">' +\n            '<iframe class=\"videoClass\" type=\"text/html\" width=\"{{width}}\" height=\"{{height}}\" ng-src=\"{{url}}\" allowfullscreen frameborder=\"0\"></iframe>' +\n            '</div>',\n            link: function (scope, element, attrs) {\n                var embedFriendlyUrl = \"\",\n                    urlSections,\n                    index;\n\n                var youtubeParams = (attrs.hideControls ? '?autoplay=0&showinfo=0&controls=0' : '');\n\n                scope.$watch('source', function (newVal) {\n                    if (newVal) {\n                        /*\n                         * Need to convert the urls into a friendly url that can be embedded and be used in the available online players the services have provided\n                         * for youtube: src=\"//www.youtube.com/embed/{{video_id}}\"\n                         * for vimeo: src=\"http://player.vimeo.com/video/{{video_id}}\n                         */\n\n                        if (newVal.indexOf(\"vimeo\") >= 0) { // Displaying a vimeo video\n                            if (newVal.indexOf(\"player.vimeo\") >= 0) {\n                                embedFriendlyUrl = newVal;\n                            } else {\n                                embedFriendlyUrl = newVal.replace(\"http:\", \"https:\");\n                                urlSections = embedFriendlyUrl.split(\".com/\");\n                                embedFriendlyUrl = embedFriendlyUrl.replace(\"vimeo\", \"player.vimeo\");\n                                embedFriendlyUrl = embedFriendlyUrl.replace(\"/\" + urlSections[urlSections.length - 1], \"/video/\" + urlSections[urlSections.length - 1] + \"\");\n                            }\n                        } else if (newVal.indexOf(\"youtu.be\") >= 0) {\n\n                            index = newVal.indexOf(\".be/\");\n\n                            embedFriendlyUrl = newVal.slice(index + 4, newVal.length);\n                            embedFriendlyUrl = \"https://www.youtube.com/embed/\" + embedFriendlyUrl + youtubeParams;\n                        } else if (newVal.indexOf(\"youtube.com\") >= 0) { // displaying a youtube video\n                            if (newVal.indexOf(\"embed\") >= 0) {\n                                embedFriendlyUrl = newVal + youtubeParams;\n                            } else {\n                                embedFriendlyUrl = newVal.replace(\"/watch?v=\", \"/embed/\") + youtubeParams;\n                                if (embedFriendlyUrl.indexOf('m.youtube.com') != -1) {\n                                    embedFriendlyUrl = embedFriendlyUrl.replace(\"m.youtube.com\", \"youtube.com\");\n                                }\n                            }\n                        }\n\n                        scope.url = $sce.trustAsResourceUrl(embedFriendlyUrl);\n                    }\n                });\n            }\n        };\n    }]);\n"]}