"use strict";const isValidURL=o=>{let n;try{n=new URL(o)}catch(o){return!1}return"http:"===n.protocol||"https:"===n.protocol},getValueFromUrl=o=>{const n=window.location.search;return new URLSearchParams(n).get(o)},sortByArray=(o,n,t)=>(o||[]).sort(((o,r)=>-1===t.indexOf(null==o?void 0:o[n])?1:-1===t.indexOf(null==r?void 0:r[n])?-1:t.indexOf(null==o?void 0:o[n])-t.indexOf(null==r?void 0:r[n]))),getVariantFromValues=({variants:o,values:n})=>{const t=Object.keys(n);for(const r of o){const o=["option_1","option_2","option_3"].map((o=>r[o])).filter((o=>null!=o));if((null==o?void 0:o.length)===(null==t?void 0:t.length)&&t.every((t=>o.includes(n[t]))))return r}return null},isInRange=(o,n)=>{const t=parseInt(o);return!(n&&((null==n?void 0:n.ad_hoc_max_amount)||(null==n?void 0:n.ad_hoc_min_amount))&&((null==n?void 0:n.ad_hoc_max_amount)&&t>(null==n?void 0:n.ad_hoc_max_amount)||(null==n?void 0:n.ad_hoc_min_amount)&&t<(null==n?void 0:n.ad_hoc_min_amount)))};exports.getValueFromUrl=getValueFromUrl,exports.getVariantFromValues=getVariantFromValues,exports.isInRange=isInRange,exports.isValidURL=isValidURL,exports.sortByArray=sortByArray;