PageSourceSearch

https://www.med24.dk/resources/compiled/js/1790942545/med24/modules/clerk.js?c=1EJTPh

js med24.dk collected 2026-10-02 12:08:15 UTC 4,026 bytes, 2 lines download raw bytes

1"use strict";import cookie from"cookie";import request from"request-promise";const Clerk={endpointBase:"https://api.clerk.io/v2/",apiKey:null,language:null,visitorID:null,globalFilter:"",init:(apiKey,globalFilter,language)=>{Clerk.apiKey=apiKey,Clerk.globalFilter=globalFilter||Clerk.globalFilter,Clerk.language=language||Clerk.language,Clerk.visitorID=cookie.getCookie("ClerkVisitor"),"string"!=typeof Clerk.visitorID&&(Clerk.visitorID=Clerk.generateUUID(),cookie.setCookie("ClerkVisitor",Clerk.visitorID,"",365,"/"));apiKey=cookie.getCookie("ClerkPendingClick");"string"==typeof apiKey&&null!==apiKey.match(/^[0-9]+$/)&&Clerk.call("log/click",{product:apiKey},function(){cookie.eraseCookie("ClerkPendingClick")}),console.debug("clerkinit"),window.dispatchEvent(new Event("clerkinit"))},generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=16*Math.random()|0;return("x"==c?r:3&r|8).toString(16)})},compileFilter:function(customFilter){return 0!==(customFilter=customFilter||"").length&&0!==Clerk.globalFilter.length?"("+customFilter+") and ("+Clerk.globalFilter+")":customFilter||Clerk.globalFilter||""},call:(endpoint,options,callback)=>{callback=callback||(()=>{});return new Promise((resolve,reject)=>{null===Clerk.apiKey&&reject("Clerk: Not initialized"),(options=options||{}).key=Clerk.apiKey,options.visitor=Clerk.visitorID,null!==Clerk.language&&(options.language=Clerk.language);var url=Clerk.endpointBase+endpoint+"?callback=?";request.getURL(url,{payload:JSON.stringify(options)},{mode:"cors"}).then(response=>{if("ok"!==response.status)return reject();callback(response)}).catch(error=>{reject(error)})})},compileTemplate:function(template,vars){return template.replace(/\{\{\{([a-z0-9_-]+)\}\}\}/gm,function(matchString,variableName){return void 0!==vars[variableName]?vars[variableName]:""})},logClick:function(productID){cookie.setCookie("ClerkPendingClick",productID)},logSale:function(orderID,customerID,products,email){var options={};return options.sale=orderID,options.customer=customerID,options.products=products,"string"==typeof email&&(options.email=email),Clerk.call("log/sale",options)},logEmail:function(email){var options={};return options.email=email,Clerk.call("log/email",options)},search:function(query,callback,filter,limit){var options={};return options.query=query,options.limit=limit||100,options.filter=Clerk.compileFilter(filter),Clerk.call("search/search",options,callback)},getRelatedProducts:function(productIDs,callback,filter,limit,labels){var options={};return options.products=productIDs||[],options.limit=limit||100,options.filter=Clerk.compileFilter(filter),options.labels=["Related Products"].concat(labels||[]),Clerk.call("recommendations/complementary",options,callback)},getAlternativeProducts:function(productIDs,callback,filter,limit,labels){var options={};return options.products=productIDs||[],options.limit=limit||100,options.filter=Clerk.compileFilter(filter),options.labels=["Alternative Products"].concat(labels||[]),Clerk.call("recommendations/substituting",options,callback)},getPopularInCategory:function(categoryID,callback,filter,limit,labels){var options={};return options.category=categoryID,options.limit=limit||100,options.filter=Clerk.compileFilter(filter),options.labels=["Popular In Category"].concat(labels||[]),Clerk.call("recommendations/category/popular",options,callback)},getPopularProducts:function(callback,filter,limit,labels){var options={};return options.limit=limit||100,options.filter=Clerk.compileFilter(filter),options.labels=["Popular Products"].concat(labels||[]),Clerk.call("recommendations/visitor/complementary",options,callback)},getTrendingProducts:function(callback,filter,limit,labels){var options={};return options.limit=limit||100,options.filter=Clerk.compileFilter(filter),options.labels=["Trending Products"].concat(labels||[]),Clerk.call("recommendations/trending",options,callback)}};export default Clerk;
2//# sourceMappingURL=/resources/compiled/js/med24/modules/clerk.js.map

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.