PageSourceSearch

https://iterasys.com.br/scripts/global.js

js iterasys.com.br collected 2026-10-08 00:12:14 UTC 14,920 bytes, 443 lines download raw bytes

1(function() {
2  var runMaxTries = 15;
3  (function run() {
4    if(!window.$ready || !window.$evBus) {
5      if(--runMaxTries <= 0) { return; }
6      return setTimeout(run, 1000);
7    }
8    // --- START: PLUGINS CODE ---
9    $ready('facebook', true);
10    // plugin id: 'facebook'
11    try { 
12        !function(f,b,e,v,n,t,s)
13        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
14        n.callMethod.apply(n,arguments):n.queue.push(arguments)};
15        if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
16        n.queue=[];t=b.createElement(e);t.async=!0;
17        t.src=v;s=b.getElementsByTagName(e)[0];
18        s.parentNode.insertBefore(t,s)}(window, document,'script',
19        'https://connect.facebook.net/en_US/fbevents.js');
20
21        var enabled = $nuxt.$state.namespace.websiteConfig.cookies.enable;
22        var consented = $nuxt.$cookies.get('cookies_consented') || {};
23        if (enabled && consented.ad_storage === false) {
24          fbq('consent', 'revoke');
25        }
26
27        var initParams;
28        if($nuxt.$state.auth.loggedUser && $nuxt.$state.auth.loggedUser.profile.email) {
29          var p = $nuxt.$state.auth.loggedUser.profile;
30          var s = p.name.split(' ');
31          var fn = s[0];
32          var ln = s.length > 1 ? s[s.length - 1] : undefined;
33          initParams = { fn: fn, ln: ln, em: p.email };
34        }
35
36        fbq('init', '424166089478391', initParams);
37       } catch(e) { console.error(e); }
38    $evBus.$on('global-pageChange', function(data) {
39      $ready('facebook').then(function() {
40        fbq('track', 'PageView');
41      });
42    });
43    $evBus.$on('global-login', function(data) {
44      $ready('facebook').then(function() {
45        
46          var s = data.loggedUser.profile.name.split(' ');
47          var fn = s[0];
48          var ln = s.length > 1 ? s[s.length - 1] : undefined;
49          fbq('init', '424166089478391', { fn: fn, ln: ln, em: data.loggedUser.profile.email });
50          if(data.signUp) {
51            fbq('track', 'CompleteRegistration', { content_name: 'Sign-up Form' });
52            fbq('track', 'Lead', {
53              content_type: 'signupForm'
54            });
55          }
56        
57      });
58    });
59    $evBus.$on('global-userConsent', function(data) {
60      $ready('facebook').then(function() {
61        
62          fbq('consent', data.ad_storage ? 'grant' : 'revoke');
63        
64      });
65    });
66    $evBus.$on('global-newsletterSubscription', function(data) {
67      $ready('facebook').then(function() {
68        
69          fbq('init', '424166089478391', { em: data.email });
70          fbq('track', 'Lead', {
71            content_type: 'newsletterForm'
72          });
73        
74      });
75    });
76    $evBus.$on('global-checkoutInterest', function(data) {
77      $ready('facebook').then(function() {
78        
79          var content = data.product || data.plan;
80          fbq('track', 'AddToCart', {
81            content_ids: [content.code],
82            content_name: content.name,
83            content_type: 'product',
84            currency: $nuxt.$state.namespace.namespace.config.currency,
85            value: content.amount / 100
86          });
87          fbq('track', 'InitiateCheckout', {
88            content_ids: [content.code],
89            content_name: content.name,
90            content_type: 'product',
91            currency: $nuxt.$state.namespace.namespace.config.currency,
92            num_items: 1,
93            value: content.amount / 100
94          });
95        
96      });
97    });
98    $evBus.$on('global-checkoutConfirm', function(data) {
99      $ready('facebook').then(function() {
100        
101          var content = data.product || data.plan;
102          fbq('track', 'Purchase', {
103            content_ids: [content.code],
104            content_name: content.name,
105            content_type: 'product',
106            currency: $nuxt.$state.namespace.namespace.config.currency,
107            value: data.amount / 100
108          });
109        
110      });
111    });
112    $evBus.$on('global-fabClicked', function(data) {
113      $ready('facebook').then(function() {
114        
115          fbq('track', 'Lead', {
116            content_type: 'fabClicked'
117          });
118        
119      });
120    });
121    $evBus.$on('global-leadForm', function(data) {
122      $ready('facebook').then(function() {
123        
124          var s = data.name.split(' ');
125          var fn = s[0];
126          var ln = s.length > 1 ? s[s.length - 1] : undefined;
127          fbq('init', '424166089478391', { fn: fn, ln: ln, em: data.email, ph: data.phone, sr: data.source });
128          fbq('track', 'Lead', {
129            content_name: data.source,
130            content_type: 'leadForm'
131          });
132        
133      });
134    });
135    $evBus.$on('global-contactForm', function(data) {
136      $ready('facebook').then(function() {
137        
138          var s = data.name.split(' ');
139          var fn = s[0];
140          var ln = s.length > 1 ? s[s.length - 1] : undefined;
141          fbq('init', '424166089478391', { fn: fn, ln: ln, em: data.email, ph: data.phone });
142          fbq('track', 'Contact');
143          fbq('track', 'Lead', {
144            content_type: 'contactForm'
145          });
146        
147      });
148    });
149    $ready('facebook').then(function() {
150      fbq('track', 'PageView');
151    });
152    // plugin id: 'tagmanager'
153    try { 
154        window.dataLayer = window.dataLayer || [];
155        function gtag(){dataLayer.push(arguments);}
156        window.gtag = gtag;
157        var enabled = $nuxt.$state.namespace.websiteConfig.cookies.enable;
158        var consented = $nuxt.$cookies.get('cookies_consented') || {};
159        
160        gtag('consent', 'default', {
161          'ad_storage': enabled && consented.ad_storage === false ? 'denied' : 'granted',
162          'analytics_storage': enabled && consented.analytics_storage === false ? 'denied' : 'granted',
163          'functionality_storage': enabled && consented.functionality_storage === false ? 'denied' : 'granted'
164        });
165
166        (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
167        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
168        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
169        'https://www.googletagmanager.com/gtm.js?id='+i+dl;
170        j.addEventListener('load', function() {
171          $ready('tagmanager', true);
172        });
173        f.parentNode.insertBefore(j,f);
174        })(window,document,'script','dataLayer','GTM-NJVD436');
175       } catch(e) { console.error(e); }
176    $evBus.$on('global-login', function(data) {
177      $ready('tagmanager').then(function() {
178        
179        window.dataLayer.push({
180          'event': data.signUp ? 'signup' : 'signin',
181          'userName': data.loggedUser.profile.name,
182          'userEmail': data.loggedUser.profile.email,
183        });
184        $nuxt.$evPlugin.tagmanager.identified = true;
185      
186      });
187    });
188    $evBus.$on('global-userConsent', function(data) {
189      $ready('tagmanager').then(function() {
190        
191        window.dataLayer.push({
192          'event': 'userConsent',
193          'ad_storage': data.ad_storage ? 'granted' : 'denied',
194          'analytics_storage': data.analytics_storage ? 'granted' : 'denied',
195          'functionality_storage': data.functionality_storage ? 'granted' : 'denied'
196        })
197
198        gtag('consent', 'update', {
199          'ad_storage': data.ad_storage ? 'granted' : 'denied',
200          'analytics_storage': data.analytics_storage ? 'granted' : 'denied',
201          'functionality_storage': data.functionality_storage ? 'granted' : 'denied'
202        });
203      
204      });
205    });
206    $evBus.$on('global-newsletterSubscription', function(data) {
207      $ready('tagmanager').then(function() {
208        
209        window.dataLayer.push({
210          'event': 'newsletterSubscription',
211          'email': data.email
212        })
213      
214      });
215    });
216    $evBus.$on('global-checkoutInterest', function(data) {
217      $ready('tagmanager').then(function() {
218        
219        var item = data.product || data.plan;
220        var itemType = data.product ? 'product' : 'plan';
221        var itemAmount = data.amount / 100;
222        window.dataLayer.push({
223          'event': 'checkoutInterest',
224          'transactionId': data.transactionId,
225          'itemType': itemType,
226          'itemAmount': itemAmount,
227          'itemName': item.name,
228          'itemCode': item.code,
229          'itemVersion': item.version,
230          'items': [{
231            item_id: item.code,
232            item_name: item.name,
233            item_category: itemType,
234            price: itemAmount,
235            currency: 'BRL',
236            quantity: 1
237          }]
238        });
239      
240      });
241    });
242    $evBus.$on('global-checkoutConfirm', function(data) {
243      $ready('tagmanager').then(function() {
244        
245        var item = data.product || data.plan;
246        var itemType = data.product ? 'product' : 'plan';
247        var itemAmount = data.amount / 100;
248        var couponCode = data.coupon ? data.coupon.code : undefined;
249        window.dataLayer.push({
250          'event': 'checkoutConfirm',
251          'transactionId': data.transactionId,
252          'itemType': itemType,
253          'itemAmount': itemAmount,
254          'itemName': item.name,
255          'itemCode': item.code,
256          'itemVersion': item.version,
257          'itemCouponCode': couponCode,
258          'items': [{
259            'item_id': item.code,
260            'item_name': item.name,
261            'item_category': itemType,
262            'coupon': couponCode,
263            'discount': data.discount,
264            'price': itemAmount,
265            'currency': 'BRL',
266            'quantity': 1
267          }],
268          // universal analytics - standard ecommerce - transaction
269          'transactionTotal': itemAmount,
270          'transactionProducts': [{
271              'sku': "" + item.code,
272              'name': item.name,
273              'category': itemType,
274              'price': itemAmount,
275              'quantity': 1
276          }]
277        });
278      
279      });
280    });
281    $evBus.$on('global-courseStarted', function(data) {
282      $ready('tagmanager').then(function() {
283        
284        window.dataLayer.push({
285          'event': 'courseStarted',
286          'courseCode': data.course.code,
287          'courseSlug': data.course.slug,
288          'courseName': data.course.name,
289        });
290      
291      });
292    });
293    $evBus.$on('global-courseProgress', function(data) {
294      $ready('tagmanager').then(function() {
295        
296        window.dataLayer.push({
297          'event': 'courseProgress',
298          'courseCode': data.course.code,
299          'courseSlug': data.course.slug,
300          'courseName': data.course.name,
301          'courseProgress': data.progress,
302        });
303      
304      });
305    });
306    $evBus.$on('global-courseFinished', function(data) {
307      $ready('tagmanager').then(function() {
308        
309        window.dataLayer.push({
310          'event': 'courseFinished',
311          'courseCode': data.course.code,
312          'courseSlug': data.course.slug,
313          'courseName': data.course.name,
314        });
315      
316      });
317    });
318    $evBus.$on('global-fabClicked', function(data) {
319      $ready('tagmanager').then(function() {
320        
321        window.dataLayer.push({
322          'event': 'fabClicked',
323          'transactionId': data.transactionId,
324          'socialNetwork': data.socialNetwork
325        })
326      
327      });
328    });
329    $evBus.$on('global-lessonWatched', function(data) {
330      $ready('tagmanager').then(function() {
331        
332        window.dataLayer.push({
333          'event': 'lessonWatched',
334          'courseCode': data.course.code,
335          'courseSlug': data.course.slug,
336          'courseName': data.course.name,
337          'lessonId': data.lesson._id,
338          'lessonTitle': data.lesson.title,
339        });
340      
341      });
342    });
343    $evBus.$on('global-quizzDone', function(data) {
344      $ready('tagmanager').then(function() {
345        
346        window.dataLayer.push({
347          'event': 'quizzDone',
348          'courseCode': data.course.code,
349          'courseSlug': data.course.slug,
350          'courseName': data.course.name,
351          'quizzId': data.exercise._id,
352          'quizzTitle': data.exercise.title,
353        });
354      
355      });
356    });
357    $evBus.$on('global-testDone', function(data) {
358      $ready('tagmanager').then(function() {
359        
360        window.dataLayer.push({
361          'event': 'testDone',
362          'courseCode': data.course.code,
363          'courseSlug': data.course.slug,
364          'courseName': data.course.name,
365          'testId': data.test._id,
366          'testTitle': data.test.title,
367          'testScore': data.score,
368        });
369      
370      });
371    });
372    $evBus.$on('global-fileDownloaded', function(data) {
373      $ready('tagmanager').then(function() {
374        
375        if (data.digitalDownload) {
376          window.dataLayer.push({
377            'event': 'fileDownloaded',
378            'digitalDownloadCode': data.digitalDownload.code,
379            'digitalDownloadName': data.digitalDownload.name,
380            'digitalDownloadSlug': data.digitalDownload.slug,
381            'fileId': data.file._id,
382            'fileTitle': data.file.title,
383          });
384        } else if (data.course) {
385          window.dataLayer.push({
386            'event': 'fileDownloaded',
387            'courseCode': data.course.code,
388            'courseSlug': data.course.slug,
389            'courseName': data.course.name,
390            'lessonId': data.lesson ? data.lesson._id : undefined,
391            'lessonTitle': data.lesson ? data.lesson.title : undefined,
392            'fileId': data.file._id,
393            'fileTitle': data.file.title,
394          });
395        }
396      
397      });
398    });
399    $evBus.$on('global-leadForm', function(data) {
400      $ready('tagmanager').then(function() {
401        
402        window.dataLayer.push({
403          'event': 'leadForm',
404          'leadName': data.name,
405          'leadEmail': data.email,
406          'leadPhone': data.phone,
407          'leadSource': data.source,
408        });
409      
410      });
411    });
412    $evBus.$on('global-contactForm', function(data) {
413      $ready('tagmanager').then(function() {
414        
415        window.dataLayer.push({
416          'event': 'contactForm',
417          'leadName': data.name,
418          'leadEmail': data.email,
419          'leadPhone': data.phone,
420          'leadSubject': data.subject,
421          'leadMessage': data.message,
422        });
423      
424      });
425    });
426    $ready('tagmanager').then(function() {
427      
428        $nuxt.$evPlugin.tagmanager = $nuxt.$evPlugin.tagmanager || {};
429        if (!$nuxt.$evPlugin.tagmanager.identified && $nuxt.$state.auth.loggedUser && $nuxt.$state.auth.loggedUser.profile) {
430          window.dataLayer.push({
431            'event': 'identify',
432            'userName': $nuxt.$state.auth.loggedUser.profile.name,
433            'userEmail': $nuxt.$state.auth.loggedUser.profile.email,
434          });
435          $nuxt.$evPlugin.tagmanager.identified = true;
436        }
437      
438    });
439    // --- END: PLUGINS CODE ---
440
441    $ready('global', true);
442  }());
443}())

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.