1+ /*[global-shim-start]*/
2+ ( function ( exports , global , doEval ) {
3+ // jshint ignore:line
4+ var origDefine = global . define ;
5+
6+ var get = function ( name ) {
7+ var parts = name . split ( "." ) ,
8+ cur = global ,
9+ i ;
10+ for ( i = 0 ; i < parts . length ; i ++ ) {
11+ if ( ! cur ) {
12+ break ;
13+ }
14+ cur = cur [ parts [ i ] ] ;
15+ }
16+ return cur ;
17+ } ;
18+ var set = function ( name , val ) {
19+ var parts = name . split ( "." ) ,
20+ cur = global ,
21+ i ,
22+ part ,
23+ next ;
24+ for ( i = 0 ; i < parts . length - 1 ; i ++ ) {
25+ part = parts [ i ] ;
26+ next = cur [ part ] ;
27+ if ( ! next ) {
28+ next = cur [ part ] = { } ;
29+ }
30+ cur = next ;
31+ }
32+ part = parts [ parts . length - 1 ] ;
33+ cur [ part ] = val ;
34+ } ;
35+ var useDefault = function ( mod ) {
36+ if ( ! mod || ! mod . __esModule ) return false ;
37+ var esProps = { __esModule : true , default : true } ;
38+ for ( var p in mod ) {
39+ if ( ! esProps [ p ] ) return false ;
40+ }
41+ return true ;
42+ } ;
43+
44+ var hasCjsDependencies = function ( deps ) {
45+ return (
46+ deps [ 0 ] === "require" && deps [ 1 ] === "exports" && deps [ 2 ] === "module"
47+ ) ;
48+ } ;
49+
50+ var modules =
51+ ( global . define && global . define . modules ) ||
52+ ( global . _define && global . _define . modules ) ||
53+ { } ;
54+ var ourDefine = ( global . define = function ( moduleName , deps , callback ) {
55+ var module ;
56+ if ( typeof deps === "function" ) {
57+ callback = deps ;
58+ deps = [ ] ;
59+ }
60+ var args = [ ] ,
61+ i ;
62+ for ( i = 0 ; i < deps . length ; i ++ ) {
63+ args . push (
64+ exports [ deps [ i ] ]
65+ ? get ( exports [ deps [ i ] ] )
66+ : modules [ deps [ i ] ] || get ( deps [ i ] )
67+ ) ;
68+ }
69+ // CJS has no dependencies but 3 callback arguments
70+ if ( hasCjsDependencies ( deps ) || ( ! deps . length && callback . length ) ) {
71+ module = { exports : { } } ;
72+ args [ 0 ] = function ( name ) {
73+ return exports [ name ] ? get ( exports [ name ] ) : modules [ name ] ;
74+ } ;
75+ args [ 1 ] = module . exports ;
76+ args [ 2 ] = module ;
77+ } else if ( ! args [ 0 ] && deps [ 0 ] === "exports" ) {
78+ // Babel uses the exports and module object.
79+ module = { exports : { } } ;
80+ args [ 0 ] = module . exports ;
81+ if ( deps [ 1 ] === "module" ) {
82+ args [ 1 ] = module ;
83+ }
84+ } else if ( ! args [ 0 ] && deps [ 0 ] === "module" ) {
85+ args [ 0 ] = { id : moduleName } ;
86+ }
87+
88+ global . define = origDefine ;
89+ var result = callback ? callback . apply ( null , args ) : undefined ;
90+ global . define = ourDefine ;
91+
92+ // Favor CJS module.exports over the return value
93+ result = module && module . exports ? module . exports : result ;
94+ modules [ moduleName ] = result ;
95+
96+ // Set global exports
97+ var globalExport = exports [ moduleName ] ;
98+ if ( globalExport && ! get ( globalExport ) ) {
99+ if ( useDefault ( result ) ) {
100+ result = result [ "default" ] ;
101+ }
102+ set ( globalExport , result ) ;
103+ }
104+ } ) ;
105+ global . define . orig = origDefine ;
106+ global . define . modules = modules ;
107+ global . define . amd = true ;
108+ ourDefine ( "@loader" , [ ] , function ( ) {
109+ // shim for @@global -helpers
110+ var noop = function ( ) { } ;
111+ return {
112+ get : function ( ) {
113+ return { prepareGlobal : noop , retrieveGlobal : noop } ;
114+ } ,
115+ global : global ,
116+ __exec : function ( __load ) {
117+ doEval ( __load . source , global ) ;
118+ }
119+ } ;
120+ } ) ;
121+ } ) (
122+ { } ,
123+ typeof self == "object" && self . Object == Object ? self : window ,
124+ function ( __$source__ , __$global__ ) {
125+ // jshint ignore:line
126+ eval ( "(function() { " + __$source__ + " \n }).call(__$global__);" ) ;
127+ }
128+ ) ;
129+
130+ /*can-simple-observable@0.0.0#can-simple-observable*/
131+ define ( 'can-simple-observable' , [
132+ 'require' ,
133+ 'exports' ,
134+ 'module' ,
135+ 'can-reflect' ,
136+ 'can-event/batch/batch' ,
137+ 'can-observation' ,
138+ 'can-cid'
139+ ] , function ( require , exports , module ) {
140+ var canReflect = require ( 'can-reflect' ) ;
141+ var canBatch = require ( 'can-event/batch/batch' ) ;
142+ var Observation = require ( 'can-observation' ) ;
143+ var CID = require ( 'can-cid' ) ;
144+ module . exports = function reflectiveValue ( initialValue ) {
145+ var value = initialValue ;
146+ var handlers = [ ] ;
147+ var fn = function ( newValue ) {
148+ if ( arguments . length ) {
149+ value = newValue ;
150+ handlers . forEach ( function ( handler ) {
151+ canBatch . queue ( [
152+ handler ,
153+ fn ,
154+ [ newValue ]
155+ ] ) ;
156+ } , this ) ;
157+ } else {
158+ Observation . add ( fn ) ;
159+ return value ;
160+ }
161+ } ;
162+ CID ( fn ) ;
163+ canReflect . assignSymbols ( fn , {
164+ 'can.onValue' : function ( handler ) {
165+ handlers . push ( handler ) ;
166+ } ,
167+ 'can.offValue' : function ( handler ) {
168+ var index = handlers . indexOf ( handler ) ;
169+ handlers . splice ( index , 1 ) ;
170+ } ,
171+ 'can.setValue' : function ( newValue ) {
172+ return fn ( newValue ) ;
173+ } ,
174+ 'can.getValue' : function ( ) {
175+ return fn ( ) ;
176+ }
177+ } ) ;
178+ return fn ;
179+ } ;
180+ } ) ;
181+ /*[global-shim-end]*/
182+ ( function ( global ) { // jshint ignore:line
183+ global . _define = global . define ;
184+ global . define = global . define . orig ;
185+ }
186+ ) ( typeof self == "object" && self . Object == Object ? self : window ) ;
0 commit comments