1+ ( function ( source , args ) {
2+ function DidomiLoader ( source ) {
3+ function UserConsentStatusForVendorSubscribe ( ) { }
4+
5+ UserConsentStatusForVendorSubscribe . prototype . filter = function ( ) {
6+ return new UserConsentStatusForVendorSubscribe ( ) ;
7+ } ;
8+
9+ UserConsentStatusForVendorSubscribe . prototype . subscribe = noopFunc ;
10+
11+ function UserConsentStatusForVendor ( ) { }
12+
13+ UserConsentStatusForVendor . prototype . first = function ( ) {
14+ return new UserConsentStatusForVendorSubscribe ( ) ;
15+ } ;
16+
17+ UserConsentStatusForVendor . prototype . filter = function ( ) {
18+ return new UserConsentStatusForVendorSubscribe ( ) ;
19+ } ;
20+
21+ UserConsentStatusForVendor . prototype . subscribe = noopFunc ;
22+ var DidomiWrapper = {
23+ isConsentRequired : falseFunc ,
24+ getUserConsentStatusForPurpose : trueFunc ,
25+ getUserConsentStatus : trueFunc ,
26+ getUserStatus : noopFunc ,
27+ getRequiredPurposes : noopArray ,
28+ getUserConsentStatusForVendor : trueFunc ,
29+ Purposes : {
30+ Cookies : 'cookies'
31+ } ,
32+ notice : {
33+ configure : noopFunc ,
34+ hide : noopFunc ,
35+ isVisible : falseFunc ,
36+ show : noopFunc ,
37+ showDataProcessing : trueFunc
38+ } ,
39+ isUserConsentStatusPartial : falseFunc ,
40+ on : function on ( ) {
41+ return {
42+ actions : { } ,
43+ emitter : { } ,
44+ services : { } ,
45+ store : { }
46+ } ;
47+ } ,
48+ shouldConsentBeCollected : falseFunc ,
49+ getUserConsentStatusForAll : noopFunc ,
50+ getObservableOnUserConsentStatusForVendor : function getObservableOnUserConsentStatusForVendor ( ) {
51+ return new UserConsentStatusForVendor ( ) ;
52+ }
53+ } ;
54+ window . Didomi = DidomiWrapper ;
55+ var didomiStateWrapper = {
56+ didomiExperimentId : '' ,
57+ didomiExperimentUserGroup : '' ,
58+ didomiGDPRApplies : 1 ,
59+ didomiIABConsent : '' ,
60+ didomiPurposesConsent : '' ,
61+ didomiPurposesConsentDenied : '' ,
62+ didomiPurposesConsentUnknown : '' ,
63+ didomiVendorsConsent : '' ,
64+ didomiVendorsConsentDenied : '' ,
65+ didomiVendorsConsentUnknown : '' ,
66+ didomiVendorsRawConsent : '' ,
67+ didomiVendorsRawConsentDenied : '' ,
68+ didomiVendorsRawConsentUnknown : ''
69+ } ;
70+ window . didomiState = didomiStateWrapper ;
71+ var tcData = {
72+ eventStatus : 'tcloaded' ,
73+ gdprApplies : false ,
74+ listenerId : noopFunc ,
75+ vendor : {
76+ consents : [ ]
77+ } ,
78+ purpose : {
79+ consents : [ ]
80+ }
81+ } ;
82+
83+ var __tcfapiWrapper = function __tcfapiWrapper ( ) {
84+ for ( var _len = arguments . length , args = new Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
85+ args [ _key ] = arguments [ _key ] ;
86+ } // eslint-disable-next-line no-restricted-syntax
87+
88+
89+ for ( var _i = 0 , _args = args ; _i < _args . length ; _i ++ ) {
90+ var arg = _args [ _i ] ;
91+
92+ if ( typeof arg === 'function' ) {
93+ try {
94+ setTimeout ( arg ( tcData , true ) ) ;
95+ } catch ( ex ) {
96+ /* empty */
97+ }
98+ }
99+ }
100+ } ;
101+
102+ window . __tcfapi = __tcfapiWrapper ;
103+ var didomiEventListenersWrapper = {
104+ stub : true ,
105+ push : noopFunc
106+ } ;
107+ window . didomiEventListeners = didomiEventListenersWrapper ;
108+ var didomiOnReadyWrapper = {
109+ stub : true ,
110+ push : function push ( arg ) {
111+ if ( typeof arg !== 'function' ) {
112+ return ;
113+ }
114+
115+ if ( document . readyState !== 'complete' ) {
116+ window . addEventListener ( 'load' , function ( ) {
117+ setTimeout ( arg ( window . Didomi ) ) ;
118+ } ) ;
119+ } else {
120+ setTimeout ( arg ( window . Didomi ) ) ;
121+ }
122+ }
123+ } ;
124+ window . didomiOnReady = window . didomiOnReady || didomiOnReadyWrapper ;
125+
126+ if ( Array . isArray ( window . didomiOnReady ) ) {
127+ window . didomiOnReady . forEach ( function ( arg ) {
128+ if ( typeof arg === 'function' ) {
129+ try {
130+ setTimeout ( arg ( window . Didomi ) ) ;
131+ } catch ( e ) {
132+ /* empty */
133+ }
134+ }
135+ } ) ;
136+ }
137+
138+ hit ( source ) ;
139+ }
140+ function hit ( source , message ) {
141+ if ( source . verbose !== true ) {
142+ return ;
143+ }
144+
145+ try {
146+ var log = console . log . bind ( console ) ;
147+ var trace = console . trace . bind ( console ) ; // eslint-disable-line compat/compat
148+
149+ var prefix = source . ruleText || '' ;
150+
151+ if ( source . domainName ) {
152+ var AG_SCRIPTLET_MARKER = '#%#//' ;
153+ var UBO_SCRIPTLET_MARKER = '##+js' ;
154+ var ruleStartIndex ;
155+
156+ if ( source . ruleText . indexOf ( AG_SCRIPTLET_MARKER ) > - 1 ) {
157+ ruleStartIndex = source . ruleText . indexOf ( AG_SCRIPTLET_MARKER ) ;
158+ } else if ( source . ruleText . indexOf ( UBO_SCRIPTLET_MARKER ) > - 1 ) {
159+ ruleStartIndex = source . ruleText . indexOf ( UBO_SCRIPTLET_MARKER ) ;
160+ } // delete all domains from ruleText and leave just rule part
161+
162+
163+ var rulePart = source . ruleText . slice ( ruleStartIndex ) ; // prepare applied scriptlet rule for specific domain
164+
165+ prefix = "" . concat ( source . domainName ) . concat ( rulePart ) ;
166+ } // Used to check if scriptlet uses 'hit' function for logging
167+
168+
169+ var LOG_MARKER = 'log: ' ;
170+
171+ if ( message ) {
172+ if ( message . indexOf ( LOG_MARKER ) === - 1 ) {
173+ log ( "" . concat ( prefix , " message:\n" ) . concat ( message ) ) ;
174+ } else {
175+ log ( message . slice ( LOG_MARKER . length ) ) ;
176+ }
177+ }
178+
179+ log ( "" . concat ( prefix , " trace start" ) ) ;
180+
181+ if ( trace ) {
182+ trace ( ) ;
183+ }
184+
185+ log ( "" . concat ( prefix , " trace end" ) ) ;
186+ } catch ( e ) { // try catch for Edge 15
187+ // In according to this issue https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14495220/
188+ // console.log throws an error
189+ } // This is necessary for unit-tests only!
190+
191+
192+ if ( typeof window . __debug === 'function' ) {
193+ window . __debug ( source ) ;
194+ }
195+ }
196+ function noopFunc ( ) { }
197+ function noopArray ( ) {
198+ return [ ] ;
199+ }
200+ function trueFunc ( ) {
201+ return true ;
202+ }
203+ function falseFunc ( ) {
204+ return false ;
205+ } ;
206+ const updatedArgs = args ? [ ] . concat ( source ) . concat ( args ) : [ source ] ;
207+ try {
208+ DidomiLoader . apply ( this , updatedArgs ) ;
209+ } catch ( e ) {
210+ console . log ( e ) ;
211+ }
212+
213+ } ) ( { "name" :"didomi-loader" , "args" :[ ] } , [ ] ) ;
0 commit comments