export function pick(t,...n){return Object.assign({},...n.map((n=>({[n]:t[n]}))))}export function deepEqual(t,n){return"object"==typeof t&&Object.keys(t).length>0?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).every((o=>deepEqual(t[o],n[o]))):t===n}export function closestElement(t,n){return function n(o){if(!o||o===document||o===window)return null;return o.closest(t)||n(o.getRootNode().host)}(n)}export function findElements(t,n){return function n(o){if(!o)return null;let e=o.querySelectorAll(t);return e&&(null==e?void 0:e.length)?e:n(null==o?void 0:o.shadowRoot)}(n)}export const capitalize=t=>t&&t[0].toUpperCase()+t.slice(1);export const isValidURL=t=>{let n;try{n=new URL(t)}catch(t){return!1}return"http:"===n.protocol||"https:"===n.protocol};export const getValueFromUrl=t=>{const n=window.location.search;return new URLSearchParams(n).get(t)};export const sortByArray=(t,n,o)=>(t||[]).sort(((t,e)=>-1===o.indexOf(null==t?void 0:t[n])?1:-1===o.indexOf(null==e?void 0:e[n])?-1:o.indexOf(null==t?void 0:t[n])-o.indexOf(null==e?void 0:e[n])));export const getVariantFromValues=({variants:t,values:n})=>{const o=Object.keys(n);for(const e of t){const t=["option_1","option_2","option_3"].map((t=>e[t])).filter((t=>null!=t));if((null==t?void 0:t.length)===(null==o?void 0:o.length)&&o.every((o=>t.includes(n[o]))))return e}return null};export const isInRange=(t,n)=>{const o=parseInt(t);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)&&o>(null==n?void 0:n.ad_hoc_max_amount)||(null==n?void 0:n.ad_hoc_min_amount)&&o<(null==n?void 0:n.ad_hoc_min_amount)))};