PageSourceSearch

https://dashboard.visme.co/register-visme3.js

js visme.co collected 2026-09-24 08:24:02 UTC 7,607 bytes, 231 lines download raw bytes

1; (function (factory) {
2    if (typeof define === 'function' && define.amd) {
3        define(factory);
4    } else if (typeof exports === 'object') {
5        module.exports = factory();
6    } else {
7        var OldCookies = window.Cookies;
8        var api = window.Cookies = factory();
9        api.noConflict = function () {
10            window.Cookies = OldCookies;
11            return api;
12        };
13    }
14}(function () {
15    function extend() {
16        var i = 0;
17        var result = {};
18        for (; i < arguments.length; i++) {
19            var attributes = arguments[i];
20            for (var key in attributes) {
21                result[key] = attributes[key];
22            }
23        }
24        return result;
25    }
26
27    function init(converter) {
28        function api(key, value, attributes) {
29            var result;
30            if (typeof document === 'undefined') {
31                return;
32            }
33
34            // Write
35
36            if (arguments.length > 1) {
37                attributes = extend({
38                    path: '/'
39                }, api.defaults, attributes);
40
41                if (typeof attributes.expires === 'number') {
42                    var expires = new Date();
43                    expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
44                    attributes.expires = expires;
45                }
46
47                try {
48                    result = JSON.stringify(value);
49                    if (/^[\{\[]/.test(result)) {
50                        value = result;
51                    }
52                } catch (e) { }
53
54                if (!converter.write) {
55                    value = encodeURIComponent(String(value))
56                        .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
57                } else {
58                    value = converter.write(value, key);
59                }
60
61                key = encodeURIComponent(String(key));
62                key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
63                key = key.replace(/[\(\)]/g, escape);
64
65                return (document.cookie = [
66                    key, '=', value,
67                    attributes.expires ? '; expires=' + attributes.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
68                    attributes.path ? '; path=' + attributes.path : '',
69                    attributes.domain ? '; domain=' + attributes.domain : '',
70                    attributes.secure ? '; secure' : ''
71                ].join(''));
72            }
73
74            // Read
75
76            if (!key) {
77                result = {};
78            }
79
80            // To prevent the for loop in the first place assign an empty array
81            // in case there are no cookies at all. Also prevents odd result when
82            // calling "get()"
83            var cookies = document.cookie ? document.cookie.split('; ') : [];
84            var rdecode = /(%[0-9A-Z]{2})+/g;
85            var i = 0;
86
87            for (; i < cookies.length; i++) {
88                var parts = cookies[i].split('=');
89                var cookie = parts.slice(1).join('=');
90
91                if (cookie.charAt(0) === '"') {
92                    cookie = cookie.slice(1, -1);
93                }
94
95                try {
96                    var name = parts[0].replace(rdecode, decodeURIComponent);
97                    cookie = converter.read ?
98                        converter.read(cookie, name) : converter(cookie, name) ||
99                        cookie.replace(rdecode, decodeURIComponent);
100
101                    if (this.json) {
102                        try {
103                            cookie = JSON.parse(cookie);
104                        } catch (e) { }
105                    }
106
107                    if (key === name) {
108                        result = cookie;
109                        break;
110                    }
111
112                    if (!key) {
113                        result[name] = cookie;
114                    }
115                } catch (e) { }
116            }
117
118            return result;
119        }
120
121        api.set = api;
122        api.get = function (key) {
123            return api(key);
124        };
125        api.getJSON = function () {
126            return api.apply({
127                json: true
128            }, [].slice.call(arguments));
129        };
130        api.defaults = {};
131
132        api.remove = function (key, attributes) {
133            api(key, '', extend(attributes, {
134                expires: -1
135            }));
136        };
137
138        api.withConverter = init;
139
140        return api;
141    }
142
143    return init(function () { });
144}));
145
146(function () {
147    var getUrlParameter = function getUrlParameter(sParam) {
148        var sPageURL = decodeURIComponent(window.location.search.substring(1)),
149            sURLVariables = sPageURL.split('&'),
150            sParameterName,
151            i;
152
153        for (i = 0; i < sURLVariables.length; i++) {
154            sParameterName = sURLVariables[i].split('=');
155
156            if (sParameterName[0] === sParam) {
157                return sParameterName[1] === undefined ? true : sParameterName[1];
158            }
159        }
160    };
161
162    var popup = null;
163    var visme_campaign = getUrlParameter("vc");
164    if (typeof visme_campaign == "undefined") {
165        visme_campaign = Cookies.get("vcid");
166    }
167    else {
168        Cookies.set("vcid", visme_campaign, { domain: '.visme.co' });
169    }
170
171    addEventListener('ewc-register-popup', function (e) {
172        if (!popup) {
173            popup = document.createElement("div");
174            popup.setAttribute("id", "ewc-register-popup");
175            popup.style.width = '100%';
176            popup.style.height = '100%';
177            popup.style.position = 'fixed';
178            popup.style.left = '0px';
179            popup.style.top = '0px';
180            popup.style.zIndex = '10';
181            popup.style.display = 'none';
182            document.body.appendChild(popup);
183
184            function updateLayout() {
185                popup.style.height = window.innerHeight + 'px';
186            }
187            addEventListener('resize', updateLayout);
188            updateLayout();
189        }
190
191        var target = "https://dashboard.visme.co/v2/register";
192        if (typeof visme_project_type != "undefined" && visme_project_type != "") {
193            target = "https://dashboard.visme.co/visme/create-project/" + visme_project_type;
194        }
195        var src = "https://dashboard.visme.co/api/auth/redirect?mode=register&uri=" + encodeURI(target);
196
197        popup.innerHTML = "<iframe border='0' frameBorder='0' allowTransparency='true' style='border-width: 0px; background-color: transparent; width: 100%; height: 100%; overflow: hidden;' src='" + src + "'></iframe>";
198        popup.style.display = 'block';
199    });
200
201    function hidePopup() {
202        if (!popup) return;
203        popup.style.display = 'none';
204        popup.innerHTML = '';
205    }
206
207    addEventListener('message', function (e) {
208        if (!e || e.origin != 'https://dashboard.visme.co') return;
209        if (e.data == "ewc-close") {
210            hidePopup();
211        }
212        if (e.data == "ewc-login") {
213            if (document.querySelector('#login-box-inner')) {
214                hidePopup();
215            }
216            else {
217                window.location = "https://dashboard.visme.co/login";
218            }
219        }
220        if (e.data.split) {
221            var parts = e.data.split('||', 2);
222            if (parts[0] == "nav") {
223                window.location = parts[1];
224            }
225        }
226    });
227})();
228
229function EWCTriggerPopup() {
230    window.dispatchEvent(new Event("ewc-register-popup"));
231}

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.