2017-04-20 16:51:03 +08:00
( function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; var f = new Error ( "Cannot find module '" + o + "'" ) ; throw f . code = "MODULE_NOT_FOUND" , f } var l = n [ o ] = { exports : { } } ; t [ o ] [ 0 ] . call ( l . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ? n : e ) } , l , l . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ) ( { 1 : [ function ( require , module , exports ) {
var templater = require ( "handlebars/runtime" ) [ "default" ] . template ; module . exports = templater ( { "1" : function ( container , depth0 , helpers , partials , data ) {
var stack1 , helper ;
return " <small>By: "
+ ( ( stack1 = ( ( helper = ( helper = helpers . name || ( depth0 != null ? depth0 . name : depth0 ) ) != null ? helper : helpers . helperMissing ) , ( typeof helper === "function" ? helper . call ( depth0 != null ? depth0 : { } , { "name" : "name" , "hash" : { } , "data" : data } ) : helper ) ) ) != null ? stack1 : "" )
+ "</small>\n" ;
} , "compiler" : [ 7 , ">= 4.0.0" ] , "main" : function ( container , depth0 , helpers , partials , data ) {
var stack1 , helper , alias1 = depth0 != null ? depth0 : { } , alias2 = helpers . helperMissing , alias3 = "function" , alias4 = container . escapeExpression ;
2014-12-10 09:30:02 +03:00
return "<div class=\"entry\" data-name=\""
2017-04-20 16:51:03 +08:00
+ alias4 ( ( ( helper = ( helper = helpers . name || ( depth0 != null ? depth0 . name : depth0 ) ) != null ? helper : alias2 ) , ( typeof helper === alias3 ? helper . call ( alias1 , { "name" : "name" , "hash" : { } , "data" : data } ) : helper ) ) )
2014-12-10 09:30:02 +03:00
+ "\" data-version=\""
2017-04-20 16:51:03 +08:00
+ alias4 ( ( ( helper = ( helper = helpers . version || ( depth0 != null ? depth0 . version : depth0 ) ) != null ? helper : alias2 ) , ( typeof helper === alias3 ? helper . call ( alias1 , { "name" : "version" , "hash" : { } , "data" : data } ) : helper ) ) )
2014-12-10 09:30:02 +03:00
+ "\">\n <div class=\"row\">\n <div class=\"col-md-8 col-sm-8\">\n <h4 class=\"title\">\n <a class='name icon-angle-right red' href='javascript:void(0)'>"
2017-04-20 16:51:03 +08:00
+ alias4 ( ( ( helper = ( helper = helpers . name || ( depth0 != null ? depth0 . name : depth0 ) ) != null ? helper : alias2 ) , ( typeof helper === alias3 ? helper . call ( alias1 , { "name" : "name" , "hash" : { } , "data" : data } ) : helper ) ) )
2014-12-10 09:30:02 +03:00
+ "</a>\n <small class='version'>v"
2017-04-20 16:51:03 +08:00
+ alias4 ( ( ( helper = ( helper = helpers . version || ( depth0 != null ? depth0 . version : depth0 ) ) != null ? helper : alias2 ) , ( typeof helper === alias3 ? helper . call ( alias1 , { "name" : "version" , "hash" : { } , "data" : data } ) : helper ) ) )
+ "</small>\n </h4>\n </div>\n <div class=\"col-md-4 col-sm-4\">\n <div class=\"author pull-right\">\n"
+ ( ( stack1 = helpers [ "with" ] . call ( alias1 , ( depth0 != null ? depth0 . author : depth0 ) , { "name" : "with" , "hash" : { } , "fn" : container . program ( 1 , data , 0 ) , "inverse" : container . noop , "data" : data } ) ) != null ? stack1 : "" )
+ " </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <p class=\"description\">"
+ alias4 ( ( ( helper = ( helper = helpers . description || ( depth0 != null ? depth0 . description : depth0 ) ) != null ? helper : alias2 ) , ( typeof helper === alias3 ? helper . call ( alias1 , { "name" : "description" , "hash" : { } , "data" : data } ) : helper ) ) )
2014-11-17 21:18:07 +03:00
+ "</p>\n </div>\n </div>\n</div>\n" ;
2014-12-10 09:30:02 +03:00
} , "useData" : true } ) ;
2017-04-20 16:51:03 +08:00
} , { "handlebars/runtime" : 24 } ] , 2 : [ function ( require , module , exports ) {
2014-11-04 17:47:03 +03:00
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Bootstrap : modal . js v3 . 3.0
* http : //getbootstrap.com/javascript/#modals
* === === === === === === === === === === === === === === === === === === === === === === === ===
* Copyright 2011 - 2014 Twitter , Inc .
* Licensed under MIT ( https : //github.com/twbs/bootstrap/blob/master/LICENSE)
* === === === === === === === === === === === === === === === === === === === === === === === === * /
+ function ( $ ) {
'use strict' ;
// MODAL CLASS DEFINITION
// ======================
var Modal = function ( element , options ) {
this . options = options
this . $body = $ ( document . body )
this . $element = $ ( element )
this . $backdrop =
this . isShown = null
this . scrollbarWidth = 0
if ( this . options . remote ) {
this . $element
. find ( '.modal-content' )
. load ( this . options . remote , $ . proxy ( function ( ) {
this . $element . trigger ( 'loaded.bs.modal' )
} , this ) )
}
}
Modal . VERSION = '3.3.0'
Modal . TRANSITION _DURATION = 300
Modal . BACKDROP _TRANSITION _DURATION = 150
Modal . DEFAULTS = {
backdrop : true ,
keyboard : true ,
show : true
}
Modal . prototype . toggle = function ( _relatedTarget ) {
return this . isShown ? this . hide ( ) : this . show ( _relatedTarget )
}
Modal . prototype . show = function ( _relatedTarget ) {
var that = this
var e = $ . Event ( 'show.bs.modal' , { relatedTarget : _relatedTarget } )
this . $element . trigger ( e )
if ( this . isShown || e . isDefaultPrevented ( ) ) return
this . isShown = true
this . checkScrollbar ( )
this . $body . addClass ( 'modal-open' )
this . setScrollbar ( )
this . escape ( )
this . $element . on ( 'click.dismiss.bs.modal' , '[data-dismiss="modal"]' , $ . proxy ( this . hide , this ) )
this . backdrop ( function ( ) {
var transition = $ . support . transition && that . $element . hasClass ( 'fade' )
if ( ! that . $element . parent ( ) . length ) {
that . $element . appendTo ( that . $body ) // don't move modals dom position
}
that . $element
. show ( )
. scrollTop ( 0 )
if ( transition ) {
that . $element [ 0 ] . offsetWidth // force reflow
}
that . $element
. addClass ( 'in' )
. attr ( 'aria-hidden' , false )
that . enforceFocus ( )
var e = $ . Event ( 'shown.bs.modal' , { relatedTarget : _relatedTarget } )
transition ?
that . $element . find ( '.modal-dialog' ) // wait for modal to slide in
. one ( 'bsTransitionEnd' , function ( ) {
that . $element . trigger ( 'focus' ) . trigger ( e )
} )
. emulateTransitionEnd ( Modal . TRANSITION _DURATION ) :
that . $element . trigger ( 'focus' ) . trigger ( e )
} )
}
Modal . prototype . hide = function ( e ) {
if ( e ) e . preventDefault ( )
e = $ . Event ( 'hide.bs.modal' )
this . $element . trigger ( e )
if ( ! this . isShown || e . isDefaultPrevented ( ) ) return
this . isShown = false
this . escape ( )
$ ( document ) . off ( 'focusin.bs.modal' )
this . $element
. removeClass ( 'in' )
. attr ( 'aria-hidden' , true )
. off ( 'click.dismiss.bs.modal' )
$ . support . transition && this . $element . hasClass ( 'fade' ) ?
this . $element
. one ( 'bsTransitionEnd' , $ . proxy ( this . hideModal , this ) )
. emulateTransitionEnd ( Modal . TRANSITION _DURATION ) :
this . hideModal ( )
}
Modal . prototype . enforceFocus = function ( ) {
$ ( document )
. off ( 'focusin.bs.modal' ) // guard against infinite focus loop
. on ( 'focusin.bs.modal' , $ . proxy ( function ( e ) {
if ( this . $element [ 0 ] !== e . target && ! this . $element . has ( e . target ) . length ) {
this . $element . trigger ( 'focus' )
}
} , this ) )
}
Modal . prototype . escape = function ( ) {
if ( this . isShown && this . options . keyboard ) {
this . $element . on ( 'keydown.dismiss.bs.modal' , $ . proxy ( function ( e ) {
e . which == 27 && this . hide ( )
} , this ) )
} else if ( ! this . isShown ) {
this . $element . off ( 'keydown.dismiss.bs.modal' )
}
}
Modal . prototype . hideModal = function ( ) {
var that = this
this . $element . hide ( )
this . backdrop ( function ( ) {
that . $body . removeClass ( 'modal-open' )
that . resetScrollbar ( )
that . $element . trigger ( 'hidden.bs.modal' )
} )
}
Modal . prototype . removeBackdrop = function ( ) {
this . $backdrop && this . $backdrop . remove ( )
this . $backdrop = null
}
Modal . prototype . backdrop = function ( callback ) {
var that = this
var animate = this . $element . hasClass ( 'fade' ) ? 'fade' : ''
if ( this . isShown && this . options . backdrop ) {
var doAnimate = $ . support . transition && animate
this . $backdrop = $ ( '<div class="modal-backdrop ' + animate + '" />' )
. prependTo ( this . $element )
. on ( 'click.dismiss.bs.modal' , $ . proxy ( function ( e ) {
if ( e . target !== e . currentTarget ) return
this . options . backdrop == 'static'
? this . $element [ 0 ] . focus . call ( this . $element [ 0 ] )
: this . hide . call ( this )
} , this ) )
if ( doAnimate ) this . $backdrop [ 0 ] . offsetWidth // force reflow
this . $backdrop . addClass ( 'in' )
if ( ! callback ) return
doAnimate ?
this . $backdrop
. one ( 'bsTransitionEnd' , callback )
. emulateTransitionEnd ( Modal . BACKDROP _TRANSITION _DURATION ) :
callback ( )
} else if ( ! this . isShown && this . $backdrop ) {
this . $backdrop . removeClass ( 'in' )
var callbackRemove = function ( ) {
that . removeBackdrop ( )
callback && callback ( )
}
$ . support . transition && this . $element . hasClass ( 'fade' ) ?
this . $backdrop
. one ( 'bsTransitionEnd' , callbackRemove )
. emulateTransitionEnd ( Modal . BACKDROP _TRANSITION _DURATION ) :
callbackRemove ( )
} else if ( callback ) {
callback ( )
}
}
Modal . prototype . checkScrollbar = function ( ) {
this . scrollbarWidth = this . measureScrollbar ( )
}
Modal . prototype . setScrollbar = function ( ) {
var bodyPad = parseInt ( ( this . $body . css ( 'padding-right' ) || 0 ) , 10 )
if ( this . scrollbarWidth ) this . $body . css ( 'padding-right' , bodyPad + this . scrollbarWidth )
}
Modal . prototype . resetScrollbar = function ( ) {
this . $body . css ( 'padding-right' , '' )
}
Modal . prototype . measureScrollbar = function ( ) { // thx walsh
if ( document . body . clientWidth >= window . innerWidth ) return 0
var scrollDiv = document . createElement ( 'div' )
scrollDiv . className = 'modal-scrollbar-measure'
this . $body . append ( scrollDiv )
var scrollbarWidth = scrollDiv . offsetWidth - scrollDiv . clientWidth
this . $body [ 0 ] . removeChild ( scrollDiv )
return scrollbarWidth
}
// MODAL PLUGIN DEFINITION
// =======================
function Plugin ( option , _relatedTarget ) {
return this . each ( function ( ) {
var $this = $ ( this )
var data = $this . data ( 'bs.modal' )
var options = $ . extend ( { } , Modal . DEFAULTS , $this . data ( ) , typeof option == 'object' && option )
if ( ! data ) $this . data ( 'bs.modal' , ( data = new Modal ( this , options ) ) )
if ( typeof option == 'string' ) data [ option ] ( _relatedTarget )
else if ( options . show ) data . show ( _relatedTarget )
} )
}
var old = $ . fn . modal
$ . fn . modal = Plugin
$ . fn . modal . Constructor = Modal
// MODAL NO CONFLICT
// =================
$ . fn . modal . noConflict = function ( ) {
$ . fn . modal = old
return this
}
// MODAL DATA-API
// ==============
$ ( document ) . on ( 'click.bs.modal.data-api' , '[data-toggle="modal"]' , function ( e ) {
var $this = $ ( this )
var href = $this . attr ( 'href' )
var $target = $ ( $this . attr ( 'data-target' ) || ( href && href . replace ( /.*(?=#[^\s]+$)/ , '' ) ) ) // strip for ie7
var option = $target . data ( 'bs.modal' ) ? 'toggle' : $ . extend ( { remote : ! /#/ . test ( href ) && href } , $target . data ( ) , $this . data ( ) )
if ( $this . is ( 'a' ) ) e . preventDefault ( )
$target . one ( 'show.bs.modal' , function ( showEvent ) {
if ( showEvent . isDefaultPrevented ( ) ) return // only register focus restorer if modal will actually get shown
$target . one ( 'hidden.bs.modal' , function ( ) {
$this . is ( ':visible' ) && $this . trigger ( 'focus' )
} )
} )
Plugin . call ( $target , option , this )
} )
} ( jQuery ) ;
} , { } ] , 3 : [ function ( require , module , exports ) {
2014-11-17 21:18:07 +03:00
var $ = require ( 'unopinionate' ) . selector
var onClick = require ( 'onclick' )
var transitionComplete = require ( 'transition-complete' )
2014-05-07 14:28:10 -05:00
2014-05-07 14:56:48 -05:00
$ ( function ( ) {
2014-11-17 21:18:07 +03:00
onClick ( '.entry .name' , function ( ) {
var $this = $ ( this )
var $entry = $this . closest ( '.entry' )
if ( $entry . hasClass ( 'open' ) ) {
// Close entry
$entry
. height ( $entry . outerHeight ( ) )
. removeClass ( 'open' )
setTimeout ( function ( ) {
$entry . css ( 'height' , $entry . attr ( 'data-height' ) + 'px' )
} , 0 )
transitionComplete ( function ( ) {
$entry . find ( '.readme' ) . remove ( )
$entry . css ( 'height' , 'auto' )
} )
} else {
// Open entry
$ ( '.entry.open' ) . each ( function ( ) {
// Close open entries
var $entry = $ ( this )
$entry
. height ( $entry . outerHeight ( ) )
. removeClass ( 'open' )
setTimeout ( function ( ) {
$entry . css ( 'height' , $entry . attr ( 'data-height' ) + 'px' )
} , 0 )
transitionComplete ( function ( ) {
$entry . find ( '.readme' ) . remove ( )
$entry . css ( 'height' , 'auto' )
} )
} )
// Add the open class
$entry . addClass ( 'open' )
// Explicitly set heights for transitions
var height = $entry . outerHeight ( )
$entry
. attr ( 'data-height' , height )
. css ( 'height' , height )
// Get the data
$ . ajax ( {
url : '-/readme/'
+ encodeURIComponent ( $entry . attr ( 'data-name' ) ) + '/'
+ encodeURIComponent ( $entry . attr ( 'data-version' ) ) ,
dataType : 'text' ,
success : function ( html ) {
var $readme = $ ( "<div class='readme'>" )
. html ( html )
. appendTo ( $entry )
$entry . height ( height + $readme . outerHeight ( ) )
transitionComplete ( function ( ) {
$entry . css ( 'height' , 'auto' )
} )
}
} )
}
} )
} )
2014-05-08 15:41:59 -05:00
2017-04-20 16:51:03 +08:00
} , { "onclick" : 25 , "transition-complete" : 26 , "unopinionate" : 27 } ] , 4 : [ function ( require , module , exports ) {
2014-11-04 17:47:03 +03:00
// twitter bootstrap stuff;
// not in static 'cause I want it to be bundled with the rest of javascripts
require ( './bootstrap-modal' )
// our own files
require ( './search' )
require ( './entry' )
2014-11-17 21:18:07 +03:00
var $ = require ( 'unopinionate' ) . selector
2014-11-05 14:02:21 +00:00
$ ( document ) . on ( 'click' , '.js-userLogoutBtn' , function ( ) {
2014-11-17 21:18:07 +03:00
$ ( '#userLogoutForm' ) . submit ( )
return false
2014-11-04 17:47:03 +03:00
} )
2014-10-06 17:37:23 -04:00
2017-04-20 16:51:03 +08:00
} , { "./bootstrap-modal" : 2 , "./entry" : 3 , "./search" : 5 , "unopinionate" : 27 } ] , 5 : [ function ( require , module , exports ) {
2014-11-17 21:18:07 +03:00
var $ = require ( 'unopinionate' ) . selector
var template = require ( '../entry.hbs' )
2014-05-07 13:08:29 -05:00
$ ( function ( ) {
2014-11-17 21:18:07 +03:00
; ( function ( window , document ) {
var $form = $ ( '#search-form' )
var $input = $form . find ( 'input' )
var $searchResults = $ ( '#search-results' )
var $pkgListing = $ ( '#all-packages' )
var $searchBtn = $ ( '.js-search-btn' )
var request
var currentResults
var toggle = function ( validQuery ) {
$searchResults . toggleClass ( 'show' , validQuery )
$pkgListing . toggleClass ( 'hide' , validQuery )
$searchBtn . find ( 'i' ) . toggleClass ( 'icon-cancel' , validQuery )
$searchBtn . find ( 'i' ) . toggleClass ( 'icon-search' , ! validQuery )
}
2014-05-07 16:51:03 -05:00
2014-11-17 21:18:07 +03:00
$form . bind ( 'submit keyup' , function ( e ) {
var q , qBool
2014-10-06 17:44:25 -04:00
2014-11-17 21:18:07 +03:00
e . preventDefault ( )
2014-10-06 17:44:25 -04:00
2014-11-17 21:18:07 +03:00
q = $input . val ( )
qBool = ( q !== '' )
2014-10-06 17:44:25 -04:00
2014-11-17 21:18:07 +03:00
toggle ( qBool )
2014-10-06 17:44:25 -04:00
2014-11-17 21:18:07 +03:00
if ( ! qBool ) {
if ( request && typeof request . abort === 'function' ) {
request . abort ( )
}
2014-10-06 17:44:25 -04:00
2014-11-17 21:18:07 +03:00
currentResults = null
$searchResults . html ( '' )
return
}
2014-10-06 17:44:25 -04:00
2014-11-17 21:18:07 +03:00
if ( request && typeof request . abort === 'function' ) {
request . abort ( )
}
2014-05-07 13:08:29 -05:00
2014-11-17 21:18:07 +03:00
if ( ! currentResults ) {
$searchResults . html (
"<img class='search-ajax' src='-/static/ajax.gif' alt='Spinner'/>" )
}
2014-05-08 14:47:24 -05:00
2014-11-17 21:18:07 +03:00
request = $ . getJSON ( '-/search/' + q , function ( results ) {
currentResults = results
2014-05-08 14:47:24 -05:00
2014-11-17 21:18:07 +03:00
if ( results . length > 0 ) {
var html = ''
2014-05-07 13:08:29 -05:00
2014-11-17 21:18:07 +03:00
$ . each ( results , function ( i , entry ) {
html += template ( entry )
} )
2014-05-07 13:08:29 -05:00
2014-11-17 21:18:07 +03:00
$searchResults . html ( html )
} else {
$searchResults . html (
"<div class='no-results'><big>No Results</big></div>" )
}
} )
} )
2014-05-07 13:26:44 -05:00
2014-11-17 21:18:07 +03:00
$ ( document ) . on ( 'click' , '.icon-cancel' , function ( e ) {
e . preventDefault ( )
$input . val ( '' )
$form . keyup ( )
} )
2014-05-08 16:34:16 -05:00
2014-11-17 21:18:07 +03:00
} ) ( window , window . document )
} )
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
} , { "../entry.hbs" : 1 , "unopinionate" : 27 } ] , 6 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
// istanbul ignore next
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
// istanbul ignore next
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj [ 'default' ] = obj ; return newObj ; } }
var _handlebarsBase = require ( './handlebars/base' ) ;
var base = _interopRequireWildcard ( _handlebarsBase ) ;
2014-05-07 13:08:29 -05:00
// Each of these augment the Handlebars object. No need to setup here.
// (This is done to easily share code between commonjs and browse envs)
2017-04-20 16:51:03 +08:00
var _handlebarsSafeString = require ( './handlebars/safe-string' ) ;
var _handlebarsSafeString2 = _interopRequireDefault ( _handlebarsSafeString ) ;
var _handlebarsException = require ( './handlebars/exception' ) ;
var _handlebarsException2 = _interopRequireDefault ( _handlebarsException ) ;
var _handlebarsUtils = require ( './handlebars/utils' ) ;
var Utils = _interopRequireWildcard ( _handlebarsUtils ) ;
var _handlebarsRuntime = require ( './handlebars/runtime' ) ;
var runtime = _interopRequireWildcard ( _handlebarsRuntime ) ;
var _handlebarsNoConflict = require ( './handlebars/no-conflict' ) ;
var _handlebarsNoConflict2 = _interopRequireDefault ( _handlebarsNoConflict ) ;
2014-05-07 13:08:29 -05:00
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
2017-04-20 16:51:03 +08:00
function create ( ) {
2014-05-07 13:08:29 -05:00
var hb = new base . HandlebarsEnvironment ( ) ;
Utils . extend ( hb , base ) ;
2017-04-20 16:51:03 +08:00
hb . SafeString = _handlebarsSafeString2 [ 'default' ] ;
hb . Exception = _handlebarsException2 [ 'default' ] ;
2014-05-07 13:08:29 -05:00
hb . Utils = Utils ;
2014-12-10 09:30:02 +03:00
hb . escapeExpression = Utils . escapeExpression ;
2014-05-07 13:08:29 -05:00
hb . VM = runtime ;
2017-04-20 16:51:03 +08:00
hb . template = function ( spec ) {
2014-05-07 13:08:29 -05:00
return runtime . template ( spec , hb ) ;
} ;
return hb ;
2017-04-20 16:51:03 +08:00
}
var inst = create ( ) ;
inst . create = create ;
_handlebarsNoConflict2 [ 'default' ] ( inst ) ;
inst [ 'default' ] = inst ;
exports [ 'default' ] = inst ;
module . exports = exports [ 'default' ] ;
} , { "./handlebars/base" : 7 , "./handlebars/exception" : 10 , "./handlebars/no-conflict" : 20 , "./handlebars/runtime" : 21 , "./handlebars/safe-string" : 22 , "./handlebars/utils" : 23 } ] , 7 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
exports . HandlebarsEnvironment = HandlebarsEnvironment ;
// istanbul ignore next
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
var _utils = require ( './utils' ) ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
var _exception = require ( './exception' ) ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
var _exception2 = _interopRequireDefault ( _exception ) ;
2014-12-10 09:30:02 +03:00
2017-04-20 16:51:03 +08:00
var _helpers = require ( './helpers' ) ;
var _decorators = require ( './decorators' ) ;
var _logger = require ( './logger' ) ;
var _logger2 = _interopRequireDefault ( _logger ) ;
var VERSION = '4.0.5' ;
exports . VERSION = VERSION ;
var COMPILER _REVISION = 7 ;
2014-05-07 13:08:29 -05:00
exports . COMPILER _REVISION = COMPILER _REVISION ;
var REVISION _CHANGES = {
1 : '<= 1.0.rc.2' , // 1.0.rc.2 is actually rev2 but doesn't report it
2 : '== 1.0.0-rc.3' ,
3 : '== 1.0.0-rc.4' ,
2014-12-10 09:30:02 +03:00
4 : '== 1.x.x' ,
5 : '== 2.0.0-alpha.x' ,
2017-04-20 16:51:03 +08:00
6 : '>= 2.0.0-beta.1' ,
7 : '>= 4.0.0'
2014-05-07 13:08:29 -05:00
} ;
2017-04-20 16:51:03 +08:00
2014-05-07 13:08:29 -05:00
exports . REVISION _CHANGES = REVISION _CHANGES ;
2017-04-20 16:51:03 +08:00
var objectType = '[object Object]' ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function HandlebarsEnvironment ( helpers , partials , decorators ) {
2014-05-07 13:08:29 -05:00
this . helpers = helpers || { } ;
this . partials = partials || { } ;
2017-04-20 16:51:03 +08:00
this . decorators = decorators || { } ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
_helpers . registerDefaultHelpers ( this ) ;
_decorators . registerDefaultDecorators ( this ) ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
HandlebarsEnvironment . prototype = {
2014-05-07 13:08:29 -05:00
constructor : HandlebarsEnvironment ,
2017-04-20 16:51:03 +08:00
logger : _logger2 [ 'default' ] ,
log : _logger2 [ 'default' ] . log ,
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
registerHelper : function registerHelper ( name , fn ) {
if ( _utils . toString . call ( name ) === objectType ) {
if ( fn ) {
throw new _exception2 [ 'default' ] ( 'Arg not supported with multiple helpers' ) ;
}
_utils . extend ( this . helpers , name ) ;
2014-05-07 13:08:29 -05:00
} else {
this . helpers [ name ] = fn ;
}
} ,
2017-04-20 16:51:03 +08:00
unregisterHelper : function unregisterHelper ( name ) {
2014-12-10 09:30:02 +03:00
delete this . helpers [ name ] ;
} ,
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
registerPartial : function registerPartial ( name , partial ) {
if ( _utils . toString . call ( name ) === objectType ) {
_utils . extend ( this . partials , name ) ;
2014-05-07 13:08:29 -05:00
} else {
2017-04-20 16:51:03 +08:00
if ( typeof partial === 'undefined' ) {
throw new _exception2 [ 'default' ] ( 'Attempting to register a partial called "' + name + '" as undefined' ) ;
}
2014-12-10 09:30:02 +03:00
this . partials [ name ] = partial ;
2014-05-07 13:08:29 -05:00
}
2014-12-10 09:30:02 +03:00
} ,
2017-04-20 16:51:03 +08:00
unregisterPartial : function unregisterPartial ( name ) {
2014-12-10 09:30:02 +03:00
delete this . partials [ name ] ;
2017-04-20 16:51:03 +08:00
} ,
registerDecorator : function registerDecorator ( name , fn ) {
if ( _utils . toString . call ( name ) === objectType ) {
if ( fn ) {
throw new _exception2 [ 'default' ] ( 'Arg not supported with multiple decorators' ) ;
}
_utils . extend ( this . decorators , name ) ;
} else {
this . decorators [ name ] = fn ;
}
} ,
unregisterDecorator : function unregisterDecorator ( name ) {
delete this . decorators [ name ] ;
2014-05-07 13:08:29 -05:00
}
} ;
2017-04-20 16:51:03 +08:00
var log = _logger2 [ 'default' ] . log ;
exports . log = log ;
exports . createFrame = _utils . createFrame ;
exports . logger = _logger2 [ 'default' ] ;
} , { "./decorators" : 8 , "./exception" : 10 , "./helpers" : 11 , "./logger" : 19 , "./utils" : 23 } ] , 8 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
exports . registerDefaultDecorators = registerDefaultDecorators ;
// istanbul ignore next
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
var _decoratorsInline = require ( './decorators/inline' ) ;
var _decoratorsInline2 = _interopRequireDefault ( _decoratorsInline ) ;
function registerDefaultDecorators ( instance ) {
_decoratorsInline2 [ 'default' ] ( instance ) ;
}
} , { "./decorators/inline" : 9 } ] , 9 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
var _utils = require ( '../utils' ) ;
exports [ 'default' ] = function ( instance ) {
instance . registerDecorator ( 'inline' , function ( fn , props , container , options ) {
var ret = fn ;
if ( ! props . partials ) {
props . partials = { } ;
ret = function ( context , options ) {
// Create a new partials stack frame prior to exec.
var original = container . partials ;
container . partials = _utils . extend ( { } , original , props . partials ) ;
var ret = fn ( context , options ) ;
container . partials = original ;
return ret ;
} ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
props . partials [ options . args [ 0 ] ] = options . fn ;
return ret ;
2014-05-07 13:08:29 -05:00
} ) ;
2017-04-20 16:51:03 +08:00
} ;
module . exports = exports [ 'default' ] ;
} , { "../utils" : 23 } ] , 10 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
var errorProps = [ 'description' , 'fileName' , 'lineNumber' , 'message' , 'name' , 'number' , 'stack' ] ;
function Exception ( message , node ) {
var loc = node && node . loc ,
line = undefined ,
column = undefined ;
if ( loc ) {
line = loc . start . line ;
column = loc . start . column ;
message += ' - ' + line + ':' + column ;
}
var tmp = Error . prototype . constructor . call ( this , message ) ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
for ( var idx = 0 ; idx < errorProps . length ; idx ++ ) {
this [ errorProps [ idx ] ] = tmp [ errorProps [ idx ] ] ;
}
/* istanbul ignore else */
if ( Error . captureStackTrace ) {
Error . captureStackTrace ( this , Exception ) ;
}
try {
if ( loc ) {
this . lineNumber = line ;
// Work around issue under safari where we can't directly set the column value
/* istanbul ignore next */
if ( Object . defineProperty ) {
Object . defineProperty ( this , 'column' , { value : column } ) ;
} else {
this . column = column ;
}
}
} catch ( nop ) {
/* Ignore if the browser is very particular */
}
}
Exception . prototype = new Error ( ) ;
exports [ 'default' ] = Exception ;
module . exports = exports [ 'default' ] ;
} , { } ] , 11 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
exports . registerDefaultHelpers = registerDefaultHelpers ;
// istanbul ignore next
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
var _helpersBlockHelperMissing = require ( './helpers/block-helper-missing' ) ;
var _helpersBlockHelperMissing2 = _interopRequireDefault ( _helpersBlockHelperMissing ) ;
var _helpersEach = require ( './helpers/each' ) ;
var _helpersEach2 = _interopRequireDefault ( _helpersEach ) ;
var _helpersHelperMissing = require ( './helpers/helper-missing' ) ;
var _helpersHelperMissing2 = _interopRequireDefault ( _helpersHelperMissing ) ;
var _helpersIf = require ( './helpers/if' ) ;
var _helpersIf2 = _interopRequireDefault ( _helpersIf ) ;
var _helpersLog = require ( './helpers/log' ) ;
var _helpersLog2 = _interopRequireDefault ( _helpersLog ) ;
var _helpersLookup = require ( './helpers/lookup' ) ;
var _helpersLookup2 = _interopRequireDefault ( _helpersLookup ) ;
var _helpersWith = require ( './helpers/with' ) ;
var _helpersWith2 = _interopRequireDefault ( _helpersWith ) ;
function registerDefaultHelpers ( instance ) {
_helpersBlockHelperMissing2 [ 'default' ] ( instance ) ;
_helpersEach2 [ 'default' ] ( instance ) ;
_helpersHelperMissing2 [ 'default' ] ( instance ) ;
_helpersIf2 [ 'default' ] ( instance ) ;
_helpersLog2 [ 'default' ] ( instance ) ;
_helpersLookup2 [ 'default' ] ( instance ) ;
_helpersWith2 [ 'default' ] ( instance ) ;
}
} , { "./helpers/block-helper-missing" : 12 , "./helpers/each" : 13 , "./helpers/helper-missing" : 14 , "./helpers/if" : 15 , "./helpers/log" : 16 , "./helpers/lookup" : 17 , "./helpers/with" : 18 } ] , 12 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
var _utils = require ( '../utils' ) ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'blockHelperMissing' , function ( context , options ) {
2014-12-10 09:30:02 +03:00
var inverse = options . inverse ,
fn = options . fn ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
if ( context === true ) {
2014-05-07 13:08:29 -05:00
return fn ( this ) ;
2017-04-20 16:51:03 +08:00
} else if ( context === false || context == null ) {
2014-05-07 13:08:29 -05:00
return inverse ( this ) ;
2017-04-20 16:51:03 +08:00
} else if ( _utils . isArray ( context ) ) {
if ( context . length > 0 ) {
2014-12-10 09:30:02 +03:00
if ( options . ids ) {
options . ids = [ options . name ] ;
}
2014-05-07 13:08:29 -05:00
return instance . helpers . each ( context , options ) ;
} else {
return inverse ( this ) ;
}
} else {
2014-12-10 09:30:02 +03:00
if ( options . data && options . ids ) {
2017-04-20 16:51:03 +08:00
var data = _utils . createFrame ( options . data ) ;
data . contextPath = _utils . appendContextPath ( options . data . contextPath , options . name ) ;
options = { data : data } ;
2014-12-10 09:30:02 +03:00
}
return fn ( context , options ) ;
2014-05-07 13:08:29 -05:00
}
} ) ;
2017-04-20 16:51:03 +08:00
} ;
module . exports = exports [ 'default' ] ;
} , { "../utils" : 23 } ] , 13 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
// istanbul ignore next
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
var _utils = require ( '../utils' ) ;
var _exception = require ( '../exception' ) ;
var _exception2 = _interopRequireDefault ( _exception ) ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'each' , function ( context , options ) {
2014-12-10 09:30:02 +03:00
if ( ! options ) {
2017-04-20 16:51:03 +08:00
throw new _exception2 [ 'default' ] ( 'Must pass iterator to #each' ) ;
2014-12-10 09:30:02 +03:00
}
2017-04-20 16:51:03 +08:00
var fn = options . fn ,
inverse = options . inverse ,
i = 0 ,
ret = '' ,
data = undefined ,
contextPath = undefined ;
2014-05-07 13:08:29 -05:00
2014-12-10 09:30:02 +03:00
if ( options . data && options . ids ) {
2017-04-20 16:51:03 +08:00
contextPath = _utils . appendContextPath ( options . data . contextPath , options . ids [ 0 ] ) + '.' ;
2014-12-10 09:30:02 +03:00
}
2017-04-20 16:51:03 +08:00
if ( _utils . isFunction ( context ) ) {
context = context . call ( this ) ;
}
2014-05-07 13:08:29 -05:00
if ( options . data ) {
2017-04-20 16:51:03 +08:00
data = _utils . createFrame ( options . data ) ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
function execIteration ( field , index , last ) {
if ( data ) {
data . key = field ;
data . index = index ;
data . first = index === 0 ;
data . last = ! ! last ;
2014-12-10 09:30:02 +03:00
2017-04-20 16:51:03 +08:00
if ( contextPath ) {
data . contextPath = contextPath + field ;
}
}
ret = ret + fn ( context [ field ] , {
data : data ,
blockParams : _utils . blockParams ( [ context [ field ] , field ] , [ contextPath + field , null ] )
} ) ;
}
if ( context && typeof context === 'object' ) {
if ( _utils . isArray ( context ) ) {
for ( var j = context . length ; i < j ; i ++ ) {
if ( i in context ) {
execIteration ( i , i , i === context . length - 1 ) ;
2014-05-07 13:08:29 -05:00
}
}
} else {
2017-04-20 16:51:03 +08:00
var priorKey = undefined ;
for ( var key in context ) {
if ( context . hasOwnProperty ( key ) ) {
// We're running the iterations one step out of sync so we can detect
// the last iteration without have to scan the object twice and create
// an itermediate keys array.
if ( priorKey !== undefined ) {
execIteration ( priorKey , i - 1 ) ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
priorKey = key ;
2014-05-07 13:08:29 -05:00
i ++ ;
}
}
2017-04-20 16:51:03 +08:00
if ( priorKey !== undefined ) {
execIteration ( priorKey , i - 1 , true ) ;
}
2014-05-07 13:08:29 -05:00
}
}
2017-04-20 16:51:03 +08:00
if ( i === 0 ) {
2014-05-07 13:08:29 -05:00
ret = inverse ( this ) ;
}
return ret ;
} ) ;
2017-04-20 16:51:03 +08:00
} ;
module . exports = exports [ 'default' ] ;
} , { "../exception" : 10 , "../utils" : 23 } ] , 14 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
// istanbul ignore next
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
var _exception = require ( '../exception' ) ;
var _exception2 = _interopRequireDefault ( _exception ) ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'helperMissing' , function ( ) /* [args, ]options */ {
if ( arguments . length === 1 ) {
// A missing field in a {{foo}} construct.
return undefined ;
} else {
// Someone is actually trying to call something, blow up.
throw new _exception2 [ 'default' ] ( 'Missing helper: "' + arguments [ arguments . length - 1 ] . name + '"' ) ;
}
} ) ;
} ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
module . exports = exports [ 'default' ] ;
} , { "../exception" : 10 } ] , 15 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
var _utils = require ( '../utils' ) ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'if' , function ( conditional , options ) {
if ( _utils . isFunction ( conditional ) ) {
conditional = conditional . call ( this ) ;
}
2014-05-07 13:08:29 -05:00
// Default behavior is to render the positive path if the value is truthy and not empty.
// The `includeZero` option may be set to treat the condtional as purely not empty based on the
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
2017-04-20 16:51:03 +08:00
if ( ! options . hash . includeZero && ! conditional || _utils . isEmpty ( conditional ) ) {
2014-05-07 13:08:29 -05:00
return options . inverse ( this ) ;
} else {
return options . fn ( this ) ;
}
} ) ;
2017-04-20 16:51:03 +08:00
instance . registerHelper ( 'unless' , function ( conditional , options ) {
return instance . helpers [ 'if' ] . call ( this , conditional , { fn : options . inverse , inverse : options . fn , hash : options . hash } ) ;
} ) ;
} ;
module . exports = exports [ 'default' ] ;
} , { "../utils" : 23 } ] , 16 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'log' , function ( ) /* message, options */ {
var args = [ undefined ] ,
options = arguments [ arguments . length - 1 ] ;
for ( var i = 0 ; i < arguments . length - 1 ; i ++ ) {
args . push ( arguments [ i ] ) ;
}
var level = 1 ;
if ( options . hash . level != null ) {
level = options . hash . level ;
} else if ( options . data && options . data . level != null ) {
level = options . data . level ;
}
args [ 0 ] = level ;
instance . log . apply ( instance , args ) ;
} ) ;
} ;
module . exports = exports [ 'default' ] ;
} , { } ] , 17 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'lookup' , function ( obj , field ) {
return obj && obj [ field ] ;
2014-05-07 13:08:29 -05:00
} ) ;
2017-04-20 16:51:03 +08:00
} ;
module . exports = exports [ 'default' ] ;
} , { } ] , 18 : [ function ( require , module , exports ) {
'use strict' ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
exports . _ _esModule = true ;
var _utils = require ( '../utils' ) ;
exports [ 'default' ] = function ( instance ) {
instance . registerHelper ( 'with' , function ( context , options ) {
if ( _utils . isFunction ( context ) ) {
context = context . call ( this ) ;
}
2014-05-07 13:08:29 -05:00
2014-12-10 09:30:02 +03:00
var fn = options . fn ;
2017-04-20 16:51:03 +08:00
if ( ! _utils . isEmpty ( context ) ) {
var data = options . data ;
2014-12-10 09:30:02 +03:00
if ( options . data && options . ids ) {
2017-04-20 16:51:03 +08:00
data = _utils . createFrame ( options . data ) ;
data . contextPath = _utils . appendContextPath ( options . data . contextPath , options . ids [ 0 ] ) ;
2014-12-10 09:30:02 +03:00
}
2017-04-20 16:51:03 +08:00
return fn ( context , {
data : data ,
blockParams : _utils . blockParams ( [ context ] , [ data && data . contextPath ] )
} ) ;
2014-12-10 09:30:02 +03:00
} else {
return options . inverse ( this ) ;
}
2014-05-07 13:08:29 -05:00
} ) ;
2017-04-20 16:51:03 +08:00
} ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
module . exports = exports [ 'default' ] ;
2014-12-10 09:30:02 +03:00
2017-04-20 16:51:03 +08:00
} , { "../utils" : 23 } ] , 19 : [ function ( require , module , exports ) {
'use strict' ;
exports . _ _esModule = true ;
var _utils = require ( './utils' ) ;
2014-05-07 13:08:29 -05:00
var logger = {
2017-04-20 16:51:03 +08:00
methodMap : [ 'debug' , 'info' , 'warn' , 'error' ] ,
level : 'info' ,
// Maps a given level value to the `methodMap` indexes above.
lookupLevel : function lookupLevel ( level ) {
if ( typeof level === 'string' ) {
var levelMap = _utils . indexOf ( logger . methodMap , level . toLowerCase ( ) ) ;
if ( levelMap >= 0 ) {
level = levelMap ;
} else {
level = parseInt ( level , 10 ) ;
}
}
return level ;
} ,
// Can be overridden in the host environment
log : function log ( level ) {
level = logger . lookupLevel ( level ) ;
if ( typeof console !== 'undefined' && logger . lookupLevel ( logger . level ) <= level ) {
2014-05-07 13:08:29 -05:00
var method = logger . methodMap [ level ] ;
2017-04-20 16:51:03 +08:00
if ( ! console [ method ] ) {
// eslint-disable-line no-console
method = 'log' ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
for ( var _len = arguments . length , message = Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
message [ _key - 1 ] = arguments [ _key ] ;
}
console [ method ] . apply ( console , message ) ; // eslint-disable-line no-console
2014-05-07 13:08:29 -05:00
}
}
} ;
2017-04-20 16:51:03 +08:00
exports [ 'default' ] = logger ;
module . exports = exports [ 'default' ] ;
} , { "./utils" : 23 } ] , 20 : [ function ( require , module , exports ) {
( function ( global ) {
/* global window */
'use strict' ;
exports . _ _esModule = true ;
exports [ 'default' ] = function ( Handlebars ) {
/* istanbul ignore next */
var root = typeof global !== 'undefined' ? global : window ,
$Handlebars = root . Handlebars ;
/* istanbul ignore next */
Handlebars . noConflict = function ( ) {
if ( root . Handlebars === Handlebars ) {
root . Handlebars = $Handlebars ;
}
return Handlebars ;
} ;
2014-05-07 13:08:29 -05:00
} ;
2017-04-20 16:51:03 +08:00
module . exports = exports [ 'default' ] ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
} ) . call ( this , typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : { } )
} , { } ] , 21 : [ function ( require , module , exports ) {
'use strict' ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
exports . _ _esModule = true ;
exports . checkRevision = checkRevision ;
exports . template = template ;
exports . wrapProgram = wrapProgram ;
exports . resolvePartial = resolvePartial ;
exports . invokePartial = invokePartial ;
exports . noop = noop ;
// istanbul ignore next
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { 'default' : obj } ; }
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
// istanbul ignore next
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj [ 'default' ] = obj ; return newObj ; } }
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
var _utils = require ( './utils' ) ;
var Utils = _interopRequireWildcard ( _utils ) ;
var _exception = require ( './exception' ) ;
var _exception2 = _interopRequireDefault ( _exception ) ;
var _base = require ( './base' ) ;
2014-05-07 13:08:29 -05:00
function checkRevision ( compilerInfo ) {
var compilerRevision = compilerInfo && compilerInfo [ 0 ] || 1 ,
2017-04-20 16:51:03 +08:00
currentRevision = _base . COMPILER _REVISION ;
2014-05-07 13:08:29 -05:00
if ( compilerRevision !== currentRevision ) {
if ( compilerRevision < currentRevision ) {
2017-04-20 16:51:03 +08:00
var runtimeVersions = _base . REVISION _CHANGES [ currentRevision ] ,
compilerVersions = _base . REVISION _CHANGES [ compilerRevision ] ;
throw new _exception2 [ 'default' ] ( 'Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').' ) ;
2014-05-07 13:08:29 -05:00
} else {
// Use the embedded version info since the runtime doesn't know about this revision yet
2017-04-20 16:51:03 +08:00
throw new _exception2 [ 'default' ] ( 'Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo [ 1 ] + ').' ) ;
2014-05-07 13:08:29 -05:00
}
}
}
function template ( templateSpec , env ) {
2014-12-10 09:30:02 +03:00
/* istanbul ignore next */
2014-05-07 13:08:29 -05:00
if ( ! env ) {
2017-04-20 16:51:03 +08:00
throw new _exception2 [ 'default' ] ( 'No environment passed to template' ) ;
2014-05-07 13:08:29 -05:00
}
2014-12-10 09:30:02 +03:00
if ( ! templateSpec || ! templateSpec . main ) {
2017-04-20 16:51:03 +08:00
throw new _exception2 [ 'default' ] ( 'Unknown template object: ' + typeof templateSpec ) ;
2014-12-10 09:30:02 +03:00
}
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
templateSpec . main . decorator = templateSpec . main _d ;
2014-05-07 13:08:29 -05:00
// Note: Using env.VM references rather than local var references throughout this section to allow
// for external users to override these as psuedo-supported APIs.
2014-12-10 09:30:02 +03:00
env . VM . checkRevision ( templateSpec . compiler ) ;
2017-04-20 16:51:03 +08:00
function invokePartialWrapper ( partial , context , options ) {
if ( options . hash ) {
context = Utils . extend ( { } , context , options . hash ) ;
if ( options . ids ) {
options . ids [ 0 ] = true ;
}
2014-12-10 09:30:02 +03:00
}
2017-04-20 16:51:03 +08:00
partial = env . VM . resolvePartial . call ( this , partial , context , options ) ;
var result = env . VM . invokePartial . call ( this , partial , context , options ) ;
2014-12-10 09:30:02 +03:00
if ( result == null && env . compile ) {
2017-04-20 16:51:03 +08:00
options . partials [ options . name ] = env . compile ( partial , templateSpec . compilerOptions , env ) ;
result = options . partials [ options . name ] ( context , options ) ;
2014-12-10 09:30:02 +03:00
}
if ( result != null ) {
2017-04-20 16:51:03 +08:00
if ( options . indent ) {
2014-12-10 09:30:02 +03:00
var lines = result . split ( '\n' ) ;
for ( var i = 0 , l = lines . length ; i < l ; i ++ ) {
if ( ! lines [ i ] && i + 1 === l ) {
break ;
}
2017-04-20 16:51:03 +08:00
lines [ i ] = options . indent + lines [ i ] ;
2014-12-10 09:30:02 +03:00
}
result = lines . join ( '\n' ) ;
}
return result ;
2014-05-07 13:08:29 -05:00
} else {
2017-04-20 16:51:03 +08:00
throw new _exception2 [ 'default' ] ( 'The partial ' + options . name + ' could not be compiled when running in runtime-only mode' ) ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
}
2014-05-07 13:08:29 -05:00
// Just add water
var container = {
2017-04-20 16:51:03 +08:00
strict : function strict ( obj , name ) {
if ( ! ( name in obj ) ) {
throw new _exception2 [ 'default' ] ( '"' + name + '" not defined in ' + obj ) ;
}
return obj [ name ] ;
} ,
lookup : function lookup ( depths , name ) {
2014-12-10 09:30:02 +03:00
var len = depths . length ;
for ( var i = 0 ; i < len ; i ++ ) {
if ( depths [ i ] && depths [ i ] [ name ] != null ) {
return depths [ i ] [ name ] ;
}
}
} ,
2017-04-20 16:51:03 +08:00
lambda : function lambda ( current , context ) {
2014-12-10 09:30:02 +03:00
return typeof current === 'function' ? current . call ( context ) : current ;
} ,
2014-05-07 13:08:29 -05:00
escapeExpression : Utils . escapeExpression ,
invokePartial : invokePartialWrapper ,
2014-12-10 09:30:02 +03:00
2017-04-20 16:51:03 +08:00
fn : function fn ( i ) {
var ret = templateSpec [ i ] ;
ret . decorator = templateSpec [ i + '_d' ] ;
return ret ;
2014-12-10 09:30:02 +03:00
} ,
2014-05-07 13:08:29 -05:00
programs : [ ] ,
2017-04-20 16:51:03 +08:00
program : function program ( i , data , declaredBlockParams , blockParams , depths ) {
2014-12-10 09:30:02 +03:00
var programWrapper = this . programs [ i ] ,
fn = this . fn ( i ) ;
2017-04-20 16:51:03 +08:00
if ( data || depths || blockParams || declaredBlockParams ) {
programWrapper = wrapProgram ( this , i , fn , data , declaredBlockParams , blockParams , depths ) ;
2014-05-07 13:08:29 -05:00
} else if ( ! programWrapper ) {
2017-04-20 16:51:03 +08:00
programWrapper = this . programs [ i ] = wrapProgram ( this , i , fn ) ;
2014-05-07 13:08:29 -05:00
}
return programWrapper ;
} ,
2014-12-10 09:30:02 +03:00
2017-04-20 16:51:03 +08:00
data : function data ( value , depth ) {
while ( value && depth -- ) {
value = value . _parent ;
2014-12-10 09:30:02 +03:00
}
2017-04-20 16:51:03 +08:00
return value ;
2014-12-10 09:30:02 +03:00
} ,
2017-04-20 16:51:03 +08:00
merge : function merge ( param , common ) {
var obj = param || common ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
if ( param && common && param !== common ) {
obj = Utils . extend ( { } , common , param ) ;
2014-05-07 13:08:29 -05:00
}
2014-12-10 09:30:02 +03:00
2017-04-20 16:51:03 +08:00
return obj ;
2014-05-07 13:08:29 -05:00
} ,
2014-12-10 09:30:02 +03:00
2014-05-07 13:08:29 -05:00
noop : env . VM . noop ,
2014-12-10 09:30:02 +03:00
compilerInfo : templateSpec . compiler
2014-05-07 13:08:29 -05:00
} ;
2017-04-20 16:51:03 +08:00
function ret ( context ) {
var options = arguments . length <= 1 || arguments [ 1 ] === undefined ? { } : arguments [ 1 ] ;
2014-12-10 09:30:02 +03:00
var data = options . data ;
2014-05-07 13:08:29 -05:00
2014-12-10 09:30:02 +03:00
ret . _setup ( options ) ;
if ( ! options . partial && templateSpec . useData ) {
data = initData ( context , data ) ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
var depths = undefined ,
blockParams = templateSpec . useBlockParams ? [ ] : undefined ;
2014-12-10 09:30:02 +03:00
if ( templateSpec . useDepths ) {
2017-04-20 16:51:03 +08:00
if ( options . depths ) {
depths = context != options . depths [ 0 ] ? [ context ] . concat ( options . depths ) : options . depths ;
} else {
depths = [ context ] ;
}
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
function main ( context /*, options*/ ) {
return '' + templateSpec . main ( container , context , container . helpers , container . partials , data , blockParams , depths ) ;
}
main = executeDecorators ( templateSpec . main , main , container , options . depths || [ ] , data , blockParams ) ;
return main ( context , options ) ;
}
2014-12-10 09:30:02 +03:00
ret . isTop = true ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
ret . _setup = function ( options ) {
2014-12-10 09:30:02 +03:00
if ( ! options . partial ) {
container . helpers = container . merge ( options . helpers , env . helpers ) ;
2014-05-07 13:08:29 -05:00
2014-12-10 09:30:02 +03:00
if ( templateSpec . usePartial ) {
container . partials = container . merge ( options . partials , env . partials ) ;
}
2017-04-20 16:51:03 +08:00
if ( templateSpec . usePartial || templateSpec . useDecorators ) {
container . decorators = container . merge ( options . decorators , env . decorators ) ;
}
2014-12-10 09:30:02 +03:00
} else {
container . helpers = options . helpers ;
container . partials = options . partials ;
2017-04-20 16:51:03 +08:00
container . decorators = options . decorators ;
2014-12-10 09:30:02 +03:00
}
} ;
2017-04-20 16:51:03 +08:00
ret . _child = function ( i , data , blockParams , depths ) {
if ( templateSpec . useBlockParams && ! blockParams ) {
throw new _exception2 [ 'default' ] ( 'must pass block params' ) ;
}
2014-12-10 09:30:02 +03:00
if ( templateSpec . useDepths && ! depths ) {
2017-04-20 16:51:03 +08:00
throw new _exception2 [ 'default' ] ( 'must pass parent depths' ) ;
2014-12-10 09:30:02 +03:00
}
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
return wrapProgram ( container , i , templateSpec [ i ] , data , 0 , blockParams , depths ) ;
2014-05-07 13:08:29 -05:00
} ;
2014-12-10 09:30:02 +03:00
return ret ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
function wrapProgram ( container , i , fn , data , declaredBlockParams , blockParams , depths ) {
function prog ( context ) {
var options = arguments . length <= 1 || arguments [ 1 ] === undefined ? { } : arguments [ 1 ] ;
var currentDepths = depths ;
if ( depths && context != depths [ 0 ] ) {
currentDepths = [ context ] . concat ( depths ) ;
}
return fn ( container , context , container . helpers , container . partials , options . data || data , blockParams && [ options . blockParams ] . concat ( blockParams ) , currentDepths ) ;
}
prog = executeDecorators ( fn , prog , container , depths , data , blockParams ) ;
2014-05-07 13:08:29 -05:00
prog . program = i ;
2014-12-10 09:30:02 +03:00
prog . depth = depths ? depths . length : 0 ;
2017-04-20 16:51:03 +08:00
prog . blockParams = declaredBlockParams || 0 ;
2014-05-07 13:08:29 -05:00
return prog ;
}
2017-04-20 16:51:03 +08:00
function resolvePartial ( partial , context , options ) {
if ( ! partial ) {
if ( options . name === '@partial-block' ) {
var data = options . data ;
while ( data [ 'partial-block' ] === noop ) {
data = data . _parent ;
}
partial = data [ 'partial-block' ] ;
data [ 'partial-block' ] = noop ;
} else {
partial = options . partials [ options . name ] ;
}
} else if ( ! partial . call && ! options . name ) {
// This is a dynamic partial that returned a string
options . name = partial ;
partial = options . partials [ partial ] ;
}
return partial ;
}
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function invokePartial ( partial , context , options ) {
options . partial = true ;
if ( options . ids ) {
options . data . contextPath = options . ids [ 0 ] || options . data . contextPath ;
}
var partialBlock = undefined ;
if ( options . fn && options . fn !== noop ) {
options . data = _base . createFrame ( options . data ) ;
partialBlock = options . data [ 'partial-block' ] = options . fn ;
if ( partialBlock . partials ) {
options . partials = Utils . extend ( { } , options . partials , partialBlock . partials ) ;
}
}
if ( partial === undefined && partialBlock ) {
partial = partialBlock ;
}
if ( partial === undefined ) {
throw new _exception2 [ 'default' ] ( 'The partial ' + options . name + ' could not be found' ) ;
} else if ( partial instanceof Function ) {
2014-05-07 13:08:29 -05:00
return partial ( context , options ) ;
}
}
2017-04-20 16:51:03 +08:00
function noop ( ) {
return '' ;
}
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function initData ( context , data ) {
2014-12-10 09:30:02 +03:00
if ( ! data || ! ( 'root' in data ) ) {
2017-04-20 16:51:03 +08:00
data = data ? _base . createFrame ( data ) : { } ;
2014-12-10 09:30:02 +03:00
data . root = context ;
}
return data ;
}
2017-04-20 16:51:03 +08:00
function executeDecorators ( fn , prog , container , depths , data , blockParams ) {
if ( fn . decorator ) {
var props = { } ;
prog = fn . decorator ( prog , props , container , depths && depths [ 0 ] , data , blockParams , depths ) ;
Utils . extend ( prog , props ) ;
}
return prog ;
}
} , { "./base" : 7 , "./exception" : 10 , "./utils" : 23 } ] , 22 : [ function ( require , module , exports ) {
2014-05-07 13:08:29 -05:00
// Build out our basic SafeString type
2017-04-20 16:51:03 +08:00
'use strict' ;
exports . _ _esModule = true ;
2014-05-07 13:08:29 -05:00
function SafeString ( string ) {
this . string = string ;
}
2017-04-20 16:51:03 +08:00
SafeString . prototype . toString = SafeString . prototype . toHTML = function ( ) {
return '' + this . string ;
2014-05-07 13:08:29 -05:00
} ;
2017-04-20 16:51:03 +08:00
exports [ 'default' ] = SafeString ;
module . exports = exports [ 'default' ] ;
} , { } ] , 23 : [ function ( require , module , exports ) {
'use strict' ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
exports . _ _esModule = true ;
exports . extend = extend ;
exports . indexOf = indexOf ;
exports . escapeExpression = escapeExpression ;
exports . isEmpty = isEmpty ;
exports . createFrame = createFrame ;
exports . blockParams = blockParams ;
exports . appendContextPath = appendContextPath ;
2014-05-07 13:08:29 -05:00
var escape = {
2017-04-20 16:51:03 +08:00
'&' : '&' ,
'<' : '<' ,
'>' : '>' ,
'"' : '"' ,
"'" : ''' ,
'`' : '`' ,
'=' : '='
2014-05-07 13:08:29 -05:00
} ;
2017-04-20 16:51:03 +08:00
var badChars = /[&<>"'`=]/g ,
possible = /[&<>"'`=]/ ;
2014-05-07 13:08:29 -05:00
function escapeChar ( chr ) {
2014-12-10 09:30:02 +03:00
return escape [ chr ] ;
2014-05-07 13:08:29 -05:00
}
2014-12-10 09:30:02 +03:00
function extend ( obj /* , ...source */ ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
for ( var key in arguments [ i ] ) {
if ( Object . prototype . hasOwnProperty . call ( arguments [ i ] , key ) ) {
obj [ key ] = arguments [ i ] [ key ] ;
}
2014-05-07 13:08:29 -05:00
}
}
2014-12-10 09:30:02 +03:00
return obj ;
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
var toString = Object . prototype . toString ;
2014-05-07 13:08:29 -05:00
exports . toString = toString ;
// Sourced from lodash
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
2017-04-20 16:51:03 +08:00
/* eslint-disable func-style */
var isFunction = function isFunction ( value ) {
2014-05-07 13:08:29 -05:00
return typeof value === 'function' ;
} ;
// fallback for older versions of Chrome and Safari
2014-12-10 09:30:02 +03:00
/* istanbul ignore next */
2014-05-07 13:08:29 -05:00
if ( isFunction ( /x/ ) ) {
2017-04-20 16:51:03 +08:00
exports . isFunction = isFunction = function ( value ) {
2014-05-07 13:08:29 -05:00
return typeof value === 'function' && toString . call ( value ) === '[object Function]' ;
} ;
}
exports . isFunction = isFunction ;
2017-04-20 16:51:03 +08:00
/* eslint-enable func-style */
2014-12-10 09:30:02 +03:00
/* istanbul ignore next */
2017-04-20 16:51:03 +08:00
var isArray = Array . isArray || function ( value ) {
return value && typeof value === 'object' ? toString . call ( value ) === '[object Array]' : false ;
2014-05-07 13:08:29 -05:00
} ;
2017-04-20 16:51:03 +08:00
2014-05-07 13:08:29 -05:00
exports . isArray = isArray ;
2017-04-20 16:51:03 +08:00
// Older IE versions do not directly support indexOf so we must implement our own, sadly.
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function indexOf ( array , value ) {
for ( var i = 0 , len = array . length ; i < len ; i ++ ) {
if ( array [ i ] === value ) {
return i ;
}
2014-05-07 13:08:29 -05:00
}
2017-04-20 16:51:03 +08:00
return - 1 ;
}
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
function escapeExpression ( string ) {
if ( typeof string !== 'string' ) {
// don't escape SafeStrings, since they're already safe
if ( string && string . toHTML ) {
return string . toHTML ( ) ;
} else if ( string == null ) {
return '' ;
} else if ( ! string ) {
return string + '' ;
}
// Force a string conversion as this will be done by the append regardless and
// the regex test will do this transparently behind the scenes, causing issues if
// an object's to string has escaped characters in it.
string = '' + string ;
}
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
if ( ! possible . test ( string ) ) {
return string ;
}
2014-05-07 13:08:29 -05:00
return string . replace ( badChars , escapeChar ) ;
}
2017-04-20 16:51:03 +08:00
function isEmpty ( value ) {
2014-05-07 13:08:29 -05:00
if ( ! value && value !== 0 ) {
return true ;
} else if ( isArray ( value ) && value . length === 0 ) {
return true ;
} else {
return false ;
}
}
2017-04-20 16:51:03 +08:00
function createFrame ( object ) {
var frame = extend ( { } , object ) ;
frame . _parent = object ;
return frame ;
}
function blockParams ( params , ids ) {
params . path = ids ;
return params ;
}
function appendContextPath ( contextPath , id ) {
2014-12-10 09:30:02 +03:00
return ( contextPath ? contextPath + '.' : '' ) + id ;
}
2017-04-20 16:51:03 +08:00
} , { } ] , 24 : [ function ( require , module , exports ) {
2014-05-07 13:08:29 -05:00
// Create a simple path alias to allow browserify to resolve
// the runtime on a supported path.
2017-04-20 16:51:03 +08:00
module . exports = require ( './dist/cjs/handlebars.runtime' ) [ 'default' ] ;
2014-05-07 13:08:29 -05:00
2017-04-20 16:51:03 +08:00
} , { "./dist/cjs/handlebars.runtime" : 6 } ] , 25 : [ function ( require , module , exports ) {
2014-05-07 14:56:48 -05:00
var $ = require ( 'unopinionate' ) . selector ;
var $document = $ ( document ) ,
bindings = { } ;
var click = function ( events ) {
click . bind . apply ( click , arguments ) ;
return click ;
} ;
/*** Configuration Options ***/
click . distanceLimit = 10 ;
click . timeLimit = 140 ;
/*** Useful Properties ***/
click . isTouch = ( 'ontouchstart' in window ) ||
window . DocumentTouch &&
document instanceof DocumentTouch ;
/*** Cached Functions ***/
var onTouchstart = function ( e ) {
e . stopPropagation ( ) ; //Prevents multiple click events from happening
click . _doAnywheres ( e ) ;
var $this = $ ( this ) ,
startTime = new Date ( ) . getTime ( ) ,
startPos = click . _getPos ( e ) ;
$this . one ( 'touchend' , function ( e ) {
e . preventDefault ( ) ; //Prevents click event from firing
var time = new Date ( ) . getTime ( ) - startTime ,
endPos = click . _getPos ( e ) ,
distance = Math . sqrt (
Math . pow ( endPos . x - startPos . x , 2 ) +
Math . pow ( endPos . y - startPos . y , 2 )
) ;
if ( time < click . timeLimit && distance < click . distanceLimit ) {
//Find the correct callback
$ . each ( bindings , function ( selector , callback ) {
if ( $this . is ( selector ) ) {
callback . apply ( e . target , [ e ] ) ;
return false ;
}
} ) ;
}
} ) ;
} ;
/*** API ***/
click . bind = function ( events ) {
//Argument Surgery
if ( ! $ . isPlainObject ( events ) ) {
newEvents = { } ;
newEvents [ arguments [ 0 ] ] = arguments [ 1 ] ;
events = newEvents ;
}
$ . each ( events , function ( selector , callback ) {
/*** Register Binding ***/
if ( typeof bindings [ selector ] != 'undefined' ) {
click . unbind ( selector ) ; //Ensure no duplicates
}
bindings [ selector ] = callback ;
/*** Touch Support ***/
if ( click . isTouch ) {
$document . delegate ( selector , 'touchstart' , onTouchstart ) ;
}
/*** Mouse Support ***/
$document . delegate ( selector , 'click' , function ( e ) {
e . stopPropagation ( ) ; //Prevents multiple click events from happening
//click._doAnywheres(e); //Do anywheres first to be consistent with touch order
callback . apply ( this , [ e ] ) ;
} ) ;
} ) ;
return this ;
} ;
click . unbind = function ( selector ) {
$document
. undelegate ( selector , 'touchstart' )
. undelegate ( selector , 'click' ) ;
delete bindings [ selector ] ;
return this ;
} ;
click . unbindAll = function ( ) {
$ . each ( bindings , function ( selector , callback ) {
$document
. undelegate ( selector , 'touchstart' )
. undelegate ( selector , 'click' ) ;
} ) ;
bindings = { } ;
return this ;
} ;
click . trigger = function ( selector , e ) {
e = e || $ . Event ( 'click' ) ;
if ( typeof bindings [ selector ] != 'undefined' ) {
bindings [ selector ] ( e ) ;
}
else {
console . error ( "No click events bound for selector '" + selector + "'." ) ;
}
return this ;
} ;
click . anywhere = function ( callback ) {
click . _anywheres . push ( callback ) ;
return this ;
} ;
/*** Internal (but useful) Methods ***/
click . _getPos = function ( e ) {
e = e . originalEvent ;
if ( e . pageX || e . pageY ) {
return {
x : e . pageX ,
y : e . pageY
} ;
}
else if ( e . changedTouches ) {
return {
x : e . changedTouches [ 0 ] . clientX ,
y : e . changedTouches [ 0 ] . clientY
} ;
}
else {
return {
x : e . clientX + document . body . scrollLeft + document . documentElement . scrollLeft ,
y : e . clientY + document . body . scrollTop + document . documentElement . scrollTop
} ;
}
} ;
click . _anywheres = [ ] ;
click . _doAnywheres = function ( e ) {
var i = click . _anywheres . length ;
while ( i -- ) {
click . _anywheres [ i ] ( e ) ;
}
} ;
$ ( document ) . bind ( 'mousedown' , click . _doAnywheres ) ;
module . exports = click ;
2017-04-20 16:51:03 +08:00
} , { "unopinionate" : 27 } ] , 26 : [ function ( require , module , exports ) {
2014-05-07 16:51:03 -05:00
( function ( root ) {
var callbacks = [ ] ;
var transitionComplete = function ( callback ) {
if ( callbacks . length === 0 ) {
setEvent ( ) ;
}
callbacks . push ( callback ) ;
} ;
function setEvent ( ) {
document . addEventListener ( eventName ( ) , function ( ) {
var i = callbacks . length ;
while ( i -- ) {
callbacks [ i ] ( ) ;
}
callbacks = [ ] ;
} ) ;
}
var _eventName ;
function eventName ( ) {
if ( ! _eventName ) {
// Sourced from: http://stackoverflow.com/questions/5023514/how-do-i-normalize-css3-transition-functions-across-browsers
var el = document . createElement ( 'fakeelement' ) ;
transitions = {
transition : 'transitionend' ,
OTransition : 'oTransitionEnd' ,
MozTransition : 'transitionend' ,
WebkitTransition : 'webkitTransitionEnd'
} ;
for ( var t in transitions ) {
if ( el . style [ t ] !== undefined ) {
_eventName = transitions [ t ] ;
}
}
}
return _eventName ;
}
/*** Export ***/
// AMD
if ( typeof define === 'function' && define . amd ) {
define ( [ ] , function ( ) {
return transitionComplete ;
} ) ;
}
// CommonJS
else if ( typeof exports !== 'undefined' ) {
module . exports = transitionComplete ;
}
// Browser Global
else {
root . transitionComplete = transitionComplete ;
}
} ) ( this ) ;
2017-04-20 16:51:03 +08:00
} , { } ] , 27 : [ function ( require , module , exports ) {
2014-05-07 13:08:29 -05:00
( function ( global ) {
( function ( root ) {
var unopinionate = {
selector : root . jQuery || root . Zepto || root . ender || root . $ ,
template : root . Handlebars || root . Mustache
} ;
/*** Export ***/
//AMD
if ( typeof define === 'function' && define . amd ) {
define ( [ ] , function ( ) {
return unopinionate ;
} ) ;
}
//CommonJS
else if ( typeof module . exports !== 'undefined' ) {
module . exports = unopinionate ;
}
//Global
else {
root . unopinionate = unopinionate ;
}
} ) ( typeof window != 'undefined' ? window : global ) ;
2017-04-20 16:51:03 +08:00
} ) . call ( this , typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : { } )
} , { } ] } , { } , [ 4 ] ) ;