1+ /*[process-shim]*/
2+ ( function ( global , env ) {
3+ // jshint ignore:line
4+ if ( typeof process === "undefined" ) {
5+ global . process = {
6+ argv : [ ] ,
7+ cwd : function ( ) {
8+ return "" ;
9+ } ,
10+ browser : true ,
11+ env : {
12+ NODE_ENV : env || "development"
13+ } ,
14+ version : "" ,
15+ platform :
16+ global . navigator &&
17+ global . navigator . userAgent &&
18+ / W i n d o w s / . test ( global . navigator . userAgent )
19+ ? "win"
20+ : ""
21+ } ;
22+ }
23+ } ) (
24+ typeof self == "object" && self . Object == Object
25+ ? self
26+ : typeof process === "object" &&
27+ Object . prototype . toString . call ( process ) === "[object process]"
28+ ? global
29+ : window ,
30+ "development"
31+ ) ;
32+
33+ /*[global-shim-start]*/
34+ ( function ( exports , global , doEval ) {
35+ // jshint ignore:line
36+ var origDefine = global . define ;
37+
38+ var get = function ( name ) {
39+ var parts = name . split ( "." ) ,
40+ cur = global ,
41+ i ;
42+ for ( i = 0 ; i < parts . length ; i ++ ) {
43+ if ( ! cur ) {
44+ break ;
45+ }
46+ cur = cur [ parts [ i ] ] ;
47+ }
48+ return cur ;
49+ } ;
50+ var set = function ( name , val ) {
51+ var parts = name . split ( "." ) ,
52+ cur = global ,
53+ i ,
54+ part ,
55+ next ;
56+ for ( i = 0 ; i < parts . length - 1 ; i ++ ) {
57+ part = parts [ i ] ;
58+ next = cur [ part ] ;
59+ if ( ! next ) {
60+ next = cur [ part ] = { } ;
61+ }
62+ cur = next ;
63+ }
64+ part = parts [ parts . length - 1 ] ;
65+ cur [ part ] = val ;
66+ } ;
67+ var useDefault = function ( mod ) {
68+ if ( ! mod || ! mod . __esModule ) return false ;
69+ var esProps = { __esModule : true , default : true } ;
70+ for ( var p in mod ) {
71+ if ( ! esProps [ p ] ) return false ;
72+ }
73+ return true ;
74+ } ;
75+
76+ var hasCjsDependencies = function ( deps ) {
77+ return (
78+ deps [ 0 ] === "require" && deps [ 1 ] === "exports" && deps [ 2 ] === "module"
79+ ) ;
80+ } ;
81+
82+ var modules =
83+ ( global . define && global . define . modules ) ||
84+ ( global . _define && global . _define . modules ) ||
85+ { } ;
86+ var ourDefine = ( global . define = function ( moduleName , deps , callback ) {
87+ var module ;
88+ if ( typeof deps === "function" ) {
89+ callback = deps ;
90+ deps = [ ] ;
91+ }
92+ var args = [ ] ,
93+ i ;
94+ for ( i = 0 ; i < deps . length ; i ++ ) {
95+ args . push (
96+ exports [ deps [ i ] ]
97+ ? get ( exports [ deps [ i ] ] )
98+ : modules [ deps [ i ] ] || get ( deps [ i ] )
99+ ) ;
100+ }
101+ // CJS has no dependencies but 3 callback arguments
102+ if ( hasCjsDependencies ( deps ) || ( ! deps . length && callback . length ) ) {
103+ module = { exports : { } } ;
104+ args [ 0 ] = function ( name ) {
105+ return exports [ name ] ? get ( exports [ name ] ) : modules [ name ] ;
106+ } ;
107+ args [ 1 ] = module . exports ;
108+ args [ 2 ] = module ;
109+ }
110+ // Babel uses the exports and module object.
111+ else if ( ! args [ 0 ] && deps [ 0 ] === "exports" ) {
112+ module = { exports : { } } ;
113+ args [ 0 ] = module . exports ;
114+ if ( deps [ 1 ] === "module" ) {
115+ args [ 1 ] = module ;
116+ }
117+ } else if ( ! args [ 0 ] && deps [ 0 ] === "module" ) {
118+ args [ 0 ] = { id : moduleName } ;
119+ }
120+
121+ global . define = origDefine ;
122+ var result = callback ? callback . apply ( null , args ) : undefined ;
123+ global . define = ourDefine ;
124+
125+ // Favor CJS module.exports over the return value
126+ result = module && module . exports ? module . exports : result ;
127+ modules [ moduleName ] = result ;
128+
129+ // Set global exports
130+ var globalExport = exports [ moduleName ] ;
131+ if ( globalExport && ! get ( globalExport ) ) {
132+ if ( useDefault ( result ) ) {
133+ result = result [ "default" ] ;
134+ }
135+ set ( globalExport , result ) ;
136+ }
137+ } ) ;
138+ global . define . orig = origDefine ;
139+ global . define . modules = modules ;
140+ global . define . amd = true ;
141+ ourDefine ( "@loader" , [ ] , function ( ) {
142+ // shim for @@global -helpers
143+ var noop = function ( ) { } ;
144+ return {
145+ get : function ( ) {
146+ return { prepareGlobal : noop , retrieveGlobal : noop } ;
147+ } ,
148+ global : global ,
149+ __exec : function ( __load ) {
150+ doEval ( __load . source , global ) ;
151+ }
152+ } ;
153+ } ) ;
154+ } ) (
155+ { } ,
156+ typeof self == "object" && self . Object == Object
157+ ? self
158+ : typeof process === "object" &&
159+ Object . prototype . toString . call ( process ) === "[object process]"
160+ ? global
161+ : window ,
162+ function ( __$source__ , __$global__ ) {
163+ // jshint ignore:line
164+ eval ( "(function() { " + __$source__ + " \n }).call(__$global__);" ) ;
165+ }
166+ ) ;
167+
168+ /*can-react-component@2.0.2#can-react-component*/
169+ define ( 'can-react-component' , [
170+ 'require' ,
171+ 'exports' ,
172+ 'module' ,
173+ 'react' ,
174+ 'can-namespace' ,
175+ 'can-assign' ,
176+ 'can-reflect' ,
177+ 'can-symbol' ,
178+ 'can-view-callbacks'
179+ ] , function ( require , exports , module ) {
180+ var React = require ( 'react' ) ;
181+ var namespace = require ( 'can-namespace' ) ;
182+ var assign = require ( 'can-assign' ) ;
183+ var reflect = require ( 'can-reflect' ) ;
184+ var canSymbol = require ( 'can-symbol' ) ;
185+ var viewCallbacks = require ( 'can-view-callbacks' ) ;
186+ var viewModelSymbol = canSymbol . for ( 'can.viewModel' ) ;
187+ module . exports = namespace . reactComponent = function canReactComponent ( displayName , CanComponent ) {
188+ if ( arguments . length === 1 ) {
189+ CanComponent = arguments [ 0 ] ;
190+ displayName = ( CanComponent . shortName || 'CanComponent' ) + 'Wrapper' ;
191+ }
192+ const __renderComponent = viewCallbacks . _tags [ CanComponent . prototype . tag ] ;
193+ viewCallbacks . _tags [ CanComponent . prototype . tag ] = function renderComponent ( el ) {
194+ if ( el . getAttribute ( 'auto-mount' ) !== 'false' ) {
195+ __renderComponent . apply ( this , arguments ) ;
196+ }
197+ } ;
198+ function Wrapper ( ) {
199+ React . Component . call ( this ) ;
200+ this . canComponent = null ;
201+ this . createComponent = this . createComponent . bind ( this ) ;
202+ }
203+ Wrapper . displayName = displayName ;
204+ Wrapper . prototype = Object . create ( React . Component . prototype ) ;
205+ assign ( Wrapper . prototype , {
206+ constructor : Wrapper ,
207+ createComponent : function ( el ) {
208+ if ( this . canComponent ) {
209+ this . canComponent = null ;
210+ }
211+ if ( el ) {
212+ this . vm = el [ viewModelSymbol ] ;
213+ if ( this . vm ) {
214+ reflect . assign ( this . vm , this . props ) ;
215+ } else {
216+ this . canComponent = new CanComponent ( el , { viewModel : this . props } ) ;
217+ this . vm = this . canComponent . viewModel ;
218+ }
219+ }
220+ } ,
221+ componentDidUpdate : function ( ) {
222+ this . vm && reflect . assign ( this . vm , this . props ) ;
223+ } ,
224+ render : function ( ) {
225+ return React . createElement ( CanComponent . prototype . tag , {
226+ ref : this . createComponent ,
227+ 'auto-mount' : 'false'
228+ } ) ;
229+ }
230+ } ) ;
231+ Object . defineProperty ( Wrapper . prototype , 'viewModel' , {
232+ enumerable : false ,
233+ configurable : true ,
234+ get : function ( ) {
235+ return this . vm ;
236+ }
237+ } ) ;
238+ try {
239+ Object . defineProperty ( Wrapper , 'name' , {
240+ writable : false ,
241+ enumerable : false ,
242+ configurable : true ,
243+ value : displayName
244+ } ) ;
245+ } catch ( e ) {
246+ }
247+ return Wrapper ;
248+ } ;
249+ } ) ;
250+ /*[global-shim-end]*/
251+ ( function ( global ) { // jshint ignore:line
252+ global . _define = global . define ;
253+ global . define = global . define . orig ;
254+ }
255+ ) ( typeof self == "object" && self . Object == Object ? self : ( typeof process === "object" && Object . prototype . toString . call ( process ) === "[object process]" ) ? global : window ) ;
0 commit comments