@nosto/search-js 3.25.1 → 3.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AutocompletePageProvider-BzesU3Sd.js → AutocompletePageProvider-CQePqAhB.js} +3 -3
- package/dist/{CategoryPageProvider-Dr1yt_W6.js → CategoryPageProvider-DVL9lsCU.js} +2 -2
- package/dist/{ErrorBoundary-DRQYkbCh.js → ErrorBoundary--j3FHvZ3.js} +1 -1
- package/dist/{InfiniteScrollWithObserver-EA6Wg5dM.cjs → InfiniteScrollWithObserver-CjukRCW7.cjs} +1 -1
- package/dist/{InfiniteScrollWithObserver-B3Bo-Rq5.js → InfiniteScrollWithObserver-DJzbYXZA.js} +2 -2
- package/dist/{SerpPageProvider-OZ8MddJH.js → SerpPageProvider-BzrNPc7g.js} +2 -2
- package/dist/{baseConfig-3-nxNQ6T.js → baseConfig-Cf28X268.js} +2 -2
- package/dist/core/core.es.js +1 -1
- package/dist/isBot-ByWyyjRB.cjs +1 -0
- package/dist/isBot-m_h8RaQC.js +20 -0
- package/dist/preact/autocomplete/autocomplete.es.js +1 -1
- package/dist/preact/category/category.es.js +1 -1
- package/dist/preact/common/common.cjs.js +1 -1
- package/dist/preact/common/common.es.js +5 -5
- package/dist/preact/hooks/hooks.cjs.js +1 -1
- package/dist/preact/hooks/hooks.es.js +5 -5
- package/dist/preact/inject/inject.es.js +7 -7
- package/dist/preact/legacy/legacy.cjs.js +1 -1
- package/dist/preact/legacy/legacy.es.js +3 -3
- package/dist/preact/serp/serp.es.js +2 -2
- package/dist/{search-BhKKtZ7A.js → search-D1jQPG6P.js} +1 -1
- package/dist/{storage-Di59aviU.js → storage-B97DRj5i.js} +2 -2
- package/dist/{unique-Bs8duqVh.js → unique-CCu7ChUL.js} +9 -9
- package/dist/{useActions-PtUizryF.js → useActions-BD6dgsX8.js} +7 -7
- package/dist/{useHistory-Bf2wPbzH.js → useHistory-sjFYeR68.js} +2 -2
- package/dist/{useLoadMore-B7GqRB6p.js → useLoadMore-D7HOr7gc.js} +2 -2
- package/dist/{useLoadMore-DwIxMB48.cjs → useLoadMore-Dm2qQgim.cjs} +1 -1
- package/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.es.js +3 -3
- package/package.json +13 -13
- package/dist/isBot-0jVC54QA.js +0 -20
- package/dist/isBot-CM2hS03W.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { u as o } from "./jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
-
import { c as i, S as n, C as s } from "./useActions-
|
|
3
|
-
import { d as u, u as m, S as c } from "./baseConfig-
|
|
4
|
-
import { g as f } from "./useHistory-
|
|
2
|
+
import { c as i, S as n, C as s } from "./useActions-BD6dgsX8.js";
|
|
3
|
+
import { d as u, u as m, S as c } from "./baseConfig-Cf28X268.js";
|
|
4
|
+
import { g as f } from "./useHistory-sjFYeR68.js";
|
|
5
5
|
import { useEffect as l } from "preact/hooks";
|
|
6
6
|
const p = {
|
|
7
7
|
...u,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as t } from "./jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
-
import { c as n, S as s, C as i } from "./useActions-
|
|
3
|
-
import { d as c, u as C, S as f } from "./baseConfig-
|
|
2
|
+
import { c as n, S as s, C as i } from "./useActions-BD6dgsX8.js";
|
|
3
|
+
import { d as c, u as C, S as f } from "./baseConfig-Cf28X268.js";
|
|
4
4
|
const l = {
|
|
5
5
|
...c,
|
|
6
6
|
persistentSearchCache: !1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as t } from "./jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
-
import { l as m } from "./storage-
|
|
2
|
+
import { l as m } from "./storage-B97DRj5i.js";
|
|
3
3
|
import { Fragment as n } from "preact";
|
|
4
4
|
import { useErrorBoundary as u } from "preact/hooks";
|
|
5
5
|
function p({ children: o }) {
|
package/dist/{InfiniteScrollWithObserver-EA6Wg5dM.cjs → InfiniteScrollWithObserver-CjukRCW7.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const v=require("./jsxRuntime.module-B3sGoTIU.cjs"),d=require("./useLoadMore-
|
|
1
|
+
"use strict";const v=require("./jsxRuntime.module-B3sGoTIU.cjs"),d=require("./useLoadMore-Dm2qQgim.cjs"),N=require("./storage-9KuhFI9v.cjs"),x=require("./pick-rYi1lc2m.cjs"),u=require("preact"),h=require("preact/hooks");function E(e,r){const t=r.products?.total??0,o=e.products?.from??0,n=e.products?.size??0;return t>0&&t>o+n}function A(){return!!(window.IntersectionObserver&&window.IntersectionObserverEntry&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)}function M(e,r){for(var t in r)e[t]=r[t];return e}function f(e,r){for(var t in e)if(t!=="__source"&&!(t in r))return!0;for(var o in r)if(o!=="__source"&&e[o]!==r[o])return!0;return!1}function m(e,r){this.props=e,this.context=r}function U(e,r){function t(n){var s=this.props.ref,i=s==n.ref;return!i&&s&&(s.call?s(null):s.current=null),r?!r(this.props,n)||!i:f(this.props,n)}function o(n){return this.shouldComponentUpdate=t,u.createElement(e,n)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(m.prototype=new u.Component).isPureReactComponent=!0,m.prototype.shouldComponentUpdate=function(e,r){return f(this.props,e)||f(this.state,r)};var y=u.options.__b;u.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),y&&y(e)};var q=u.options.__e;u.options.__e=function(e,r,t,o){if(e.then){for(var n,s=r;s=s.__;)if((n=s.__c)&&n.__c)return r.__e==null&&(r.__e=t.__e,r.__k=t.__k),n.__c(e,r)}q(e,r,t,o)};var b=u.options.unmount;function P(e,r,t){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=M({},e)).__c!=null&&(e.__c.__P===t&&(e.__c.__P=r),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return P(o,r,t)})),e}function R(e,r,t){return e&&t&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return R(o,r,t)}),e.__c&&e.__c.__P===r&&(e.__e&&t.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=t)),e}function p(){this.__u=0,this.o=null,this.__b=null}function S(e){var r=e.__.__c;return r&&r.__a&&r.__a(e)}function c(){this.i=null,this.l=null}u.options.unmount=function(e){var r=e.__c;r&&r.__R&&r.__R(),r&&32&e.__u&&(e.type=null),b&&b(e)},(p.prototype=new u.Component).__c=function(e,r){var t=r.__c,o=this;o.o==null&&(o.o=[]),o.o.push(t);var n=S(o.__v),s=!1,i=function(){s||(s=!0,t.__R=null,n?n(_):_())};t.__R=i;var _=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=R(l,l.__c.__P,l.__c.__O)}var a;for(o.setState({__a:o.__b=null});a=o.o.pop();)a.forceUpdate()}};o.__u++||32&r.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},p.prototype.componentWillUnmount=function(){this.o=[]},p.prototype.render=function(e,r){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=P(this.__b,t,o.__O=o.__P)}this.__b=null}var n=r.__a&&u.createElement(u.Fragment,null,e.fallback);return n&&(n.__u&=-33),[u.createElement(u.Fragment,null,r.__a?null:e.children),n]};var g=function(e,r,t){if(++t[1]===t[0]&&e.l.delete(r),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(t=e.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.i=t=t[2]}};(c.prototype=new u.Component).__a=function(e){var r=this,t=S(r.__v),o=r.l.get(e);return o[0]++,function(n){var s=function(){r.props.revealOrder?(o.push(n),g(r,e,o)):n()};t?t(s):s()}},c.prototype.render=function(e){this.i=null,this.l=new Map;var r=u.toChildArray(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&r.reverse();for(var t=r.length;t--;)this.l.set(r[t],this.i=[1,0,this.i]);return e.children},c.prototype.componentDidUpdate=c.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(r,t){g(e,t,r)})};var I=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,W=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,j=/[A-Z0-9]/g,F=typeof document<"u",H=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};u.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(u.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(r){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:r})}})});var k=u.options.event;function L(){}function z(){return this.cancelBubble}function B(){return this.defaultPrevented}u.options.event=function(e){return k&&(e=k(e)),e.persist=L,e.isPropagationStopped=z,e.isDefaultPrevented=B,e.nativeEvent=e};var D={enumerable:!1,configurable:!0,get:function(){return this.class}},O=u.options.vnode;u.options.vnode=function(e){typeof e.type=="string"&&(function(r){var t=r.props,o=r.type,n={},s=o.indexOf("-")===-1;for(var i in t){var _=t[i];if(!(i==="value"&&"defaultValue"in t&&_==null||F&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var l=i.toLowerCase();i==="defaultValue"&&"value"in t&&t.value==null?i="value":i==="download"&&_===!0?_="":l==="translate"&&_==="no"?_=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?i="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||H(t.type)?l==="onfocus"?i="onfocusin":l==="onblur"?i="onfocusout":V.test(i)&&(i=l):l=i="oninput":s&&W.test(i)?i=i.replace(j,"-$&").toLowerCase():_===null&&(_=void 0),l==="oninput"&&n[i=l]&&(i="oninputCapture"),n[i]=_}}o=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=u.toChildArray(t.children).forEach(function(a){a.props.selected=n.value.indexOf(a.props.value)!=-1})),o=="select"&&n.defaultValue!=null&&(n.value=u.toChildArray(t.children).forEach(function(a){a.props.selected=n.multiple?n.defaultValue.indexOf(a.props.value)!=-1:n.defaultValue==a.props.value})),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",D)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),r.props=n})(e),e.$$typeof=I,O&&O(e)};var C=u.options.__r;u.options.__r=function(e){C&&C(e),e.__c};var w=u.options.diffed;u.options.diffed=function(e){w&&w(e);var r=e.props,t=e.__e;t!=null&&e.type==="textarea"&&"value"in r&&r.value!==t.value&&(t.value=r.value==null?"":r.value)};function T({children:e,pageSize:r,observerOptions:t}){const o=h.useRef(null),{query:n,response:s}=d.useNostoAppState(_=>x.pick(_,"query","response")),{loadMore:i}=d.useLoadMore(r);return h.useEffect(()=>{let _,l;return E(n,s)&&(_=o.current,l=new IntersectionObserver(a=>{a[0]?.isIntersecting&&i()},t),_&&l.observe(_)),()=>{_&&l.unobserve(_)}},[s]),v.u(u.Fragment,{children:[e,v.u("div",{ref:o,style:{height:"1px"}})]})}const $=U(T,N.isEqual);exports.InfiniteScrollWithObserver=$;exports.hasMoreResults=E;exports.intersectionObserverSupported=A;
|
package/dist/{InfiniteScrollWithObserver-B3Bo-Rq5.js → InfiniteScrollWithObserver-DJzbYXZA.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as y } from "./jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
-
import { a as x, u as U } from "./useLoadMore-
|
|
3
|
-
import { i as I } from "./storage-
|
|
2
|
+
import { a as x, u as U } from "./useLoadMore-D7HOr7gc.js";
|
|
3
|
+
import { i as I } from "./storage-B97DRj5i.js";
|
|
4
4
|
import { p as A } from "./pick-DReBictn.js";
|
|
5
5
|
import { Component as c, options as l, createElement as v, Fragment as d, toChildArray as h } from "preact";
|
|
6
6
|
import { useRef as M, useEffect as W } from "preact/hooks";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as r } from "./jsxRuntime.module-Bzuv3cXw.js";
|
|
2
|
-
import { c as n, S as s, C as c } from "./useActions-
|
|
3
|
-
import { d as i, u as f, S } from "./baseConfig-
|
|
2
|
+
import { c as n, S as s, C as c } from "./useActions-BD6dgsX8.js";
|
|
3
|
+
import { d as i, u as f, S } from "./baseConfig-Cf28X268.js";
|
|
4
4
|
const l = {
|
|
5
5
|
...i,
|
|
6
6
|
persistentSearchCache: !1,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as l, h as f } from "./useActions-
|
|
1
|
+
import { b as l, h as f } from "./useActions-BD6dgsX8.js";
|
|
2
2
|
import { u as c } from "./eventBusSubscribe-B5E7dTzk.js";
|
|
3
3
|
import { s as p } from "./index.es-XNBESE3P.js";
|
|
4
|
-
import { l as d } from "./storage-
|
|
4
|
+
import { l as d } from "./storage-B97DRj5i.js";
|
|
5
5
|
import { useEffect as m } from "preact/hooks";
|
|
6
6
|
function k() {
|
|
7
7
|
const { pageType: e } = l(), { newSearch: n, updateSearch: i, replaceFilter: a, toggleProductFilter: s } = f();
|
package/dist/core/core.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as t, s as i } from "../index.es-XNBESE3P.js";
|
|
2
|
-
import { s as p } from "../search-
|
|
2
|
+
import { s as p } from "../search-D1jQPG6P.js";
|
|
3
3
|
async function c(o, a, r = 1) {
|
|
4
4
|
await t(a, void 0, r), await (await new Promise(i)).recordSearchAddToCart(o, a);
|
|
5
5
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+\\.ai|\\bmanus-user/|\\bort/|\\bperl\\b|\\bsecurityheaders\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/",t=/bot|crawl|http|lighthouse|scan|search|spider/i,e;function o(){if(e instanceof RegExp)return e;try{e=new RegExp(r,"i")}catch{e=t}return e}function s(a){return!!a&&o().test(a)}function i(){return s(navigator.userAgent)}exports.isBot=i;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var r = " daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+\\.ai|\\bmanus-user/|\\bort/|\\bperl\\b|\\bsecurityheaders\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/", t = /bot|crawl|http|lighthouse|scan|search|spider/i, e;
|
|
2
|
+
function o() {
|
|
3
|
+
if (e instanceof RegExp)
|
|
4
|
+
return e;
|
|
5
|
+
try {
|
|
6
|
+
e = new RegExp(r, "i");
|
|
7
|
+
} catch {
|
|
8
|
+
e = t;
|
|
9
|
+
}
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function s(a) {
|
|
13
|
+
return !!a && o().test(a);
|
|
14
|
+
}
|
|
15
|
+
function i() {
|
|
16
|
+
return s(navigator.userAgent);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
i
|
|
20
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as g } from "../../AutocompletePageProvider-
|
|
1
|
+
import { A as g } from "../../AutocompletePageProvider-CQePqAhB.js";
|
|
2
2
|
import { u as m } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
3
3
|
import { s } from "../../index.es-XNBESE3P.js";
|
|
4
4
|
import { B as a } from "../../BaseElement-DD_4UwDm.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../../ErrorBoundary-DqLZNIh4.cjs"),g=require("../../isBot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../../ErrorBoundary-DqLZNIh4.cjs"),g=require("../../isBot-ByWyyjRB.cjs"),o=require("../../jsxRuntime.module-B3sGoTIU.cjs"),u=require("../../useLoadMore-Dm2qQgim.cjs"),p=require("../../pick-rYi1lc2m.cjs"),n=require("../../InfiniteScrollWithObserver-CjukRCW7.cjs"),C=require("preact"),e=require("../../useActions-DIlSparF.cjs");function q({pageSize:t}){const{loadMore:r}=u.useLoadMore(t);return o.u("button",{onClick:r,children:"More results"})}function s({children:t,loadMoreComponent:r,pageSize:i}){const{loading:c,query:l,response:a}=u.useNostoAppState(f=>p.pick(f,"loading","query","response")),d=!c&&n.hasMoreResults(l,a);return o.u(C.Fragment,{children:[t,d&&(r?o.u(r,{pageSize:i}):o.u(q,{pageSize:i}))]})}const y=!g.isBot()&&n.intersectionObserverSupported()?n.InfiniteScrollWithObserver:s;exports.ErrorBoundary=S.ErrorBoundary;exports.StoreContext=e.StoreContext;exports.createExtendableStore=e.createExtendableStore;exports.createStore=e.createStore;exports.defaultState=e.defaultState;exports.useAutocompleteConfig=e.useAutocompleteConfig;exports.useCategoryConfig=e.useCategoryConfig;exports.useConfig=e.useConfig;exports.useSerpConfig=e.useSerpConfig;exports.InfiniteScroll=y;exports.InfiniteScrollWithLink=s;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as v } from "../../ErrorBoundary
|
|
2
|
-
import { i as f } from "../../isBot-
|
|
1
|
+
import { E as v } from "../../ErrorBoundary--j3FHvZ3.js";
|
|
2
|
+
import { i as f } from "../../isBot-m_h8RaQC.js";
|
|
3
3
|
import { u as e } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
4
|
-
import { u as p, a as c } from "../../useLoadMore-
|
|
4
|
+
import { u as p, a as c } from "../../useLoadMore-D7HOr7gc.js";
|
|
5
5
|
import { p as l } from "../../pick-DReBictn.js";
|
|
6
|
-
import { h as m, i as d, I as S } from "../../InfiniteScrollWithObserver-
|
|
6
|
+
import { h as m, i as d, I as S } from "../../InfiniteScrollWithObserver-DJzbYXZA.js";
|
|
7
7
|
import { Fragment as g } from "preact";
|
|
8
|
-
import { S as B,
|
|
8
|
+
import { S as B, d as O, c as W, e as F, a as N, f as R, b as j, g as w } from "../../useActions-BD6dgsX8.js";
|
|
9
9
|
function C({ pageSize: r }) {
|
|
10
10
|
const { loadMore: o } = p(r);
|
|
11
11
|
return /* @__PURE__ */ e("button", { onClick: o, children: "More results" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../../useActions-DIlSparF.cjs"),q=require("../../storage-9KuhFI9v.cjs"),h=require("../../useLoadMore-DwIxMB48.cjs"),L=require("../../eventBusSubscribe-C4H9Nv1Z.cjs"),l=require("preact/hooks"),M=require("../../useHistory-DLCyHMo1.cjs"),z=require("../../index.es-Dp6Iaxz3.cjs"),O=require("../../eventBusDispatch-BKQcSHAB.cjs"),F=require("../../parseNumber-FsZ8w61u.cjs");function X(e){const s=h.useNostoAppState(t=>t.response);return e&&Array.isArray(e)||e&&q.isPlainObject(e)?e:s}function E(e,s){const t=e.data?.filter(f=>f.selected).length??0,{active:o}={active:t>0,...s},[n,c]=l.useState(o),{toggleProductFilter:u}=A.useActions(),a=l.useCallback(()=>{c(!n)},[n]);return L.useEventBusSubscribe({event:"events/removeAllFilters",callback:()=>{c(!1)}}),{active:n,selectedFiltersCount:t,toggleActive:a,toggleProductFilter:u}}function j(){const{loading:e,facets:s}=h.useNostoAppState(t=>({loading:t.loading,facets:t.response?.products?.facets??[]}));return{loading:e,facets:s}}function V(e,s){const t=s-e;return!isNaN(t)&&t>0?new Array(s-e).fill(void 0).map((o,n)=>n+e):[]}function B(e){const{query:s,products:t}=h.useNostoAppState(o=>({query:o.query,products:o.response.products}));return l.useMemo(()=>{if(!t)return{totalPages:0,resultsFrom:0,resultsTo:0,pages:[]};const o=s.products?.from??0,n=e?.width??1/0,c=Math.max(Math.floor(n-1)/2,1),u=t.size>0?Math.floor(o/t.size)+1:1,a=t.size>0?Math.ceil(t.total/t.size):0,f=y=>y>=u-c&&y<=u+c,r=o+1,i=Math.min(o+t.total,t.total),d={from:o,page:u,current:!0},p=y=>({from:(y-1)*t.size,page:y,current:y===u}),S=u>1?p(u-1):void 0,v=u<a?p(u+1):void 0,m=u-c-1>1?p(1):void 0,g=u+c+1<a?p(a):void 0,b=V(1,a+1).filter(f).map(p);return!m&&b[0]?.page===2&&b.unshift(p(1)),!g&&b[b.length-1]?.page===a-1&&b.push(p(a)),{totalPages:a,resultsFrom:r,resultsTo:i,current:d,prev:S,next:v,first:m,last:g,pages:b}},[s,t,e?.width])}function D(){const[e,s]=l.useState([]),[t,o]=l.useState([]);return l.useEffect(()=>{z.s(async n=>{const{products:c,segments:u}=await n.getSearchSessionParams();s(u??[]),o(c?.personalizationBoost??[])})},[]),{segments:e,boost:t}}function $(){const{facets:e}=h.useNostoAppState(r=>({facets:r.response.products?.facets??[]})),{replaceFilter:s,toggleProductFilter:t}=A.useActions(),o=l.useCallback(r=>{const i=e?.find(d=>d.type==="stats"&&d.field===r);if(i&&"min"in i&&"max"in i)return i},[e]),n=l.useCallback(r=>e?.find(i=>i.field===r)?.name??r,[e]),c=l.useCallback(r=>"field"in r&&(r.value instanceof Array||r.range instanceof Array),[]),u=l.useCallback(r=>({...r,range:r.range?.map(i=>({gt:i.gt?Number(i.gt):i.gt,gte:i.gte?Number(i.gte):i.gte,lt:i.lt?Number(i.lt):i.lt,lte:i.lte?Number(i.lte):i.lte}))}),[]),a=l.useCallback(r=>(r.value??[]).map(d=>({value:d,field:r.field,name:n(r.field),filter:u(r),remove:()=>{t(r.field,d,!1)}})),[u,n,t]),f=l.useCallback(r=>(r.range??[]).map(d=>{const p=d.gte??d.gt??o(r.field)?.min,S=d.lte??d.lt??o(r.field)?.max;if(p!==void 0&&S!==void 0)return{value:`${p} - ${S}`,field:r.field,name:n(r.field),filter:u(r),remove:()=>{s(r.field,void 0)}}}).filter(Boolean),[u,o,n,s]);return{selectFilters:c,toValueFilter:a,toRangeFilter:f}}function T(){const{filter:e}=h.useNostoAppState(a=>({filter:a.query.products?.filter??[]})),{updateSearch:s}=A.useActions(),{selectFilters:t,toValueFilter:o,toRangeFilter:n}=$(),c=l.useMemo(()=>e?e.filter(t).flatMap(a=>"value"in a?o(a):"range"in a?n(a):[]).filter(Boolean):[],[e,t,n,o]),u=l.useCallback(()=>{s({products:{filter:[]}}),O.dispatchNostoEvent({event:"events/removeAllFilters",params:null})},[s]);return{filters:c,removeAll:u}}function x(e){const{replaceFilter:s}=A.useActions(),{query:t,products:o}=h.useNostoAppState(g=>({query:g.query,products:g.response.products})),n=o?.facets?.find(g=>g.id===e),c=t.products?.filter?.find(g=>g.field===n?.field),[u,a]=U(c),f=n&&"min"in n?Math.floor(n.min??0):0,r=n&&"max"in n?Math.ceil(n.max??0):0,i=l.useMemo(()=>[u??f,a??r],[u,a,f,r]),d=u!==void 0||a!==void 0,[p,S]=l.useState(d),v=l.useCallback(()=>{S(g=>!g)},[]),m=l.useCallback(([g,b])=>{if(!n)return;const y=_(g,b,f,r);s(n.field,y)},[f,r,s,n]);return L.useEventBusSubscribe({event:"events/removeAllFilters",callback:()=>{S(!1)}}),n?{min:f,max:r,range:i,updateRange:m,active:p,toggleActive:v}:H}const H={min:0,max:0,range:[0,0],active:!1,toggleActive:()=>{},updateRange:()=>{}};function U(e){const s=e?.range?.[0];return typeof s=="object"&&("gte"in s||"lte"in s)?[F.parseNumber(s.gte),F.parseNumber(s.lte)]:[void 0,void 0]}function _(e,s,t,o){const n=e!==void 0?Math.floor(e):void 0,c=s!==void 0?Math.ceil(s):void 0,u=n!==void 0,a=c!==void 0;if((t===n||!u)&&(o===c||!a))return;const f={};return u&&n!==t&&(f.gte=n.toString()),a&&c!==o&&(f.lte=c.toString()),Object.keys(f).length>0?f:void 0}function I(e,s){const{min:t,max:o,range:n,updateRange:c}=x(e),{filters:u}=T(),a=l.useMemo(()=>{const d=u.find(m=>m?.filter?.range);let p=null;if(d){const m=d.filter.range?.[0];p=[F.parseNumber(m?.gte),F.parseNumber(m?.lte)]}const S=[];let v=Math.floor(t/s)*s;for(;v<o;){const m=v+s,g=p&&p[0]===v&&p[1]===m;S.push({min:v,max:m,selected:g}),v=m}return S},[u,t,o,s]),f=l.useCallback(d=>{c([d,n[1]])},[n,c]),r=l.useCallback(d=>{c([n[0],d])},[n,c]),i=t!==n[0]||o!==n[1];return{min:t,max:o,range:n,updateRange:c,ranges:a,handleMinChange:f,handleMaxChange:r,isSelected:i}}function K(){const{products:e,keywords:s,popularSearches:t,categories:o}=h.useNostoAppState(n=>({products:n.response.products??w,keywords:n.response.keywords??w,popularSearches:n.response.popularSearches??w,categories:n.response.categories??w}));return{products:e,keywords:s,popularSearches:t,categories:o}}const w={hits:[],total:0};function Z(){const e=h.useNostoAppState(t=>t.query.products?.filter);return l.useMemo(()=>e?e.reduce((t,o)=>t+(Array.isArray(o.value)?o.value.length:1),0):0,[e])}const G=300*1e3,N=new Map;function J(e){const[s,t]=l.useState({product:null,loading:!0,error:null});return l.useEffect(()=>{if(!e){t({product:null,loading:!1,error:"Product handle is required"});return}t(n=>({...n,loading:!0,error:null}));const o=Y(e);if(o){t({product:o,loading:!1,error:null});return}W(e).then(n=>{ee(e,n),t({product:n,loading:!1,error:null})}).catch(n=>{t({product:null,loading:!1,error:n.message||"Failed to fetch product"})})},[e]),s}function Q(e){const s=window.Shopify?.routes?.root;return s?new URL(`${s}products/${e}`,window.location.href):e}async function W(e){const s=await fetch(Q(`/products/${e}.js`));if(!s.ok)throw new Error(`Failed to fetch product: ${s.status} ${s.statusText}`);return s.json()}function Y(e){const s=N.get(e);return s?Date.now()-s.created>G?(N.delete(e),null):s.product:null}function ee(e,s){N.set(e,{product:s,created:Date.now()})}function k(e){return e&&!Number.isNaN(e)?e:0}function te(e,s){const{from:t,size:o,total:n}=h.useNostoAppState(r=>({from:k(r.query.products?.from??0),size:k(r.response?.products?.size??s),total:k(r.response?.products?.total??0)})),{updateSearch:c}=A.useActions(),u=t+o,a=l.useMemo(()=>[...e].reverse().filter(r=>r<n),[e,n]),f=l.useCallback(r=>{c({products:{size:F.parseNumber(r)}})},[c]);return{from:t,to:u,total:n,size:o,sizeOptions:a,handleSizeChange:f}}function se(e,s){return e.length!==s.length?!1:e.every(t=>s.find(o=>t.field===o.field&&t.order===o.order))}function ne(e){const s=h.useNostoAppState(c=>c.query),{updateSearch:t}=A.useActions(),o=e.find(c=>se(c.value.sort,s.products?.sort||[]))?.id??e[0]?.id,n=l.useCallback(c=>{if(c===o)return;const u=e.find(a=>a.id===c);u&&t({products:{sort:u.value.sort}})},[e,t,o]);return{activeSort:o,setSort:n}}const C=window.SpeechRecognition||window.webkitSpeechRecognition,P=!!(C&&typeof C=="function");function oe(){return{listening:!1,startListening:()=>{},stopListening:()=>{}}}function re({language:e="en-US",interimResults:s=!1,onResult:t,onError:o}={}){const[n,c]=l.useState(!1),u=l.useRef(null),a=l.useCallback(()=>{const r=new C;r.lang=e,r.interimResults=s,r.onstart=()=>c(!0),t&&(r.onresult=i=>{const{transcript:d}=i.results?.[0]?.[0];t(d)}),o&&(r.onerror=i=>o(i.error)),r.onend=()=>c(!1),u.current=r,r.start()},[e,s,o,t]),f=l.useCallback(()=>{u.current?.stop()},[u]);return{listening:n,startListening:a,stopListening:f}}const ce=P?re:oe;function ue(e,s){if(!e.length||!s.length)return[];const t=s.reduce((o,n)=>(o[n]={},o),{});return e.forEach(o=>{o.customFields?.forEach(({key:n,value:c})=>{const u=n.toLowerCase();s.includes(u)&&(t[u][c]=t[u][c]||[],t[u][c].push(o))})}),Object.entries(t).filter(o=>Object.keys(o[1]).length).map(([o,n])=>({field:o,options:Object.entries(n).map(([c,u])=>({value:c,skus:u,unavailable:!1,selected:!1}))}))}function ie(e,s){return e.length?e.map(({field:t,options:o})=>({field:t,options:o.map(n=>{const c=!n.skus?.some(a=>Object.entries(s).every(([f,r])=>f===t?!0:a.customFields?.find(d=>d.key.toLowerCase()===f)?.value===r)),u=s[t]===n.value;return{...n,unavailable:c,selected:u}})})):[]}const R=["4XS","3XS","2XS","XXS","XS","S","M","L","XL","XXL","2XL","XXXL","3XL","4XL"];function ae(e){if(R.includes(e))return 1e3+R.indexOf(e);const s=parseFloat(e);return isNaN(s)?e:s}function le(e,s){return[...s].sort((t,o)=>{const[n,c]=[t.value,o.value].map(ae);return n<c?-1:1})}function de(e=[],s=[]){const[t,o]=l.useState({}),n=l.useMemo(()=>ue(e,s).map(({field:r,options:i})=>({field:r,options:le(r,i)})),[e,s]),c=l.useMemo(()=>ie(n,t),[n,t]),u=l.useCallback((f,r)=>{o(i=>{const d={...i};return d[f]===r?delete d[f]:d[f]=r,d})},[]),a=l.useMemo(()=>Object.keys(t).filter(i=>t[i]).length===0?[]:c.filter(({field:i})=>t[i]).map(({field:i,options:d})=>{const p=t[i];return d.find(v=>v.value===p)?.skus??[]}).reduce((i,d)=>i.filter(p=>d.includes(p))),[c,t]);return{swatches:c,toggleOption:u,matchedSkus:a}}exports.useActions=A.useActions;exports.useLoadMore=h.useLoadMore;exports.useNostoAppState=h.useNostoAppState;exports.addToHistory=M.addToHistory;exports.getSavedHistory=M.getSavedHistory;exports.useHistory=M.useHistory;exports.speechToTextSupported=P;exports.useDecoratedSearchResults=X;exports.useFacet=E;exports.useFacets=j;exports.usePagination=B;exports.usePersonalization=D;exports.useProductFilters=T;exports.useRange=x;exports.useRangeSelector=I;exports.useResponse=K;exports.useSelectedFiltersCount=Z;exports.useShopifyProduct=J;exports.useSizeOptions=te;exports.useSort=ne;exports.useSpeechToText=ce;exports.useSwatches=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../../useActions-DIlSparF.cjs"),q=require("../../storage-9KuhFI9v.cjs"),h=require("../../useLoadMore-Dm2qQgim.cjs"),L=require("../../eventBusSubscribe-C4H9Nv1Z.cjs"),l=require("preact/hooks"),M=require("../../useHistory-DLCyHMo1.cjs"),z=require("../../index.es-Dp6Iaxz3.cjs"),O=require("../../eventBusDispatch-BKQcSHAB.cjs"),F=require("../../parseNumber-FsZ8w61u.cjs");function X(e){const s=h.useNostoAppState(t=>t.response);return e&&Array.isArray(e)||e&&q.isPlainObject(e)?e:s}function E(e,s){const t=e.data?.filter(f=>f.selected).length??0,{active:o}={active:t>0,...s},[n,c]=l.useState(o),{toggleProductFilter:u}=A.useActions(),a=l.useCallback(()=>{c(!n)},[n]);return L.useEventBusSubscribe({event:"events/removeAllFilters",callback:()=>{c(!1)}}),{active:n,selectedFiltersCount:t,toggleActive:a,toggleProductFilter:u}}function j(){const{loading:e,facets:s}=h.useNostoAppState(t=>({loading:t.loading,facets:t.response?.products?.facets??[]}));return{loading:e,facets:s}}function V(e,s){const t=s-e;return!isNaN(t)&&t>0?new Array(s-e).fill(void 0).map((o,n)=>n+e):[]}function B(e){const{query:s,products:t}=h.useNostoAppState(o=>({query:o.query,products:o.response.products}));return l.useMemo(()=>{if(!t)return{totalPages:0,resultsFrom:0,resultsTo:0,pages:[]};const o=s.products?.from??0,n=e?.width??1/0,c=Math.max(Math.floor(n-1)/2,1),u=t.size>0?Math.floor(o/t.size)+1:1,a=t.size>0?Math.ceil(t.total/t.size):0,f=y=>y>=u-c&&y<=u+c,r=o+1,i=Math.min(o+t.total,t.total),d={from:o,page:u,current:!0},p=y=>({from:(y-1)*t.size,page:y,current:y===u}),S=u>1?p(u-1):void 0,v=u<a?p(u+1):void 0,m=u-c-1>1?p(1):void 0,g=u+c+1<a?p(a):void 0,b=V(1,a+1).filter(f).map(p);return!m&&b[0]?.page===2&&b.unshift(p(1)),!g&&b[b.length-1]?.page===a-1&&b.push(p(a)),{totalPages:a,resultsFrom:r,resultsTo:i,current:d,prev:S,next:v,first:m,last:g,pages:b}},[s,t,e?.width])}function D(){const[e,s]=l.useState([]),[t,o]=l.useState([]);return l.useEffect(()=>{z.s(async n=>{const{products:c,segments:u}=await n.getSearchSessionParams();s(u??[]),o(c?.personalizationBoost??[])})},[]),{segments:e,boost:t}}function $(){const{facets:e}=h.useNostoAppState(r=>({facets:r.response.products?.facets??[]})),{replaceFilter:s,toggleProductFilter:t}=A.useActions(),o=l.useCallback(r=>{const i=e?.find(d=>d.type==="stats"&&d.field===r);if(i&&"min"in i&&"max"in i)return i},[e]),n=l.useCallback(r=>e?.find(i=>i.field===r)?.name??r,[e]),c=l.useCallback(r=>"field"in r&&(r.value instanceof Array||r.range instanceof Array),[]),u=l.useCallback(r=>({...r,range:r.range?.map(i=>({gt:i.gt?Number(i.gt):i.gt,gte:i.gte?Number(i.gte):i.gte,lt:i.lt?Number(i.lt):i.lt,lte:i.lte?Number(i.lte):i.lte}))}),[]),a=l.useCallback(r=>(r.value??[]).map(d=>({value:d,field:r.field,name:n(r.field),filter:u(r),remove:()=>{t(r.field,d,!1)}})),[u,n,t]),f=l.useCallback(r=>(r.range??[]).map(d=>{const p=d.gte??d.gt??o(r.field)?.min,S=d.lte??d.lt??o(r.field)?.max;if(p!==void 0&&S!==void 0)return{value:`${p} - ${S}`,field:r.field,name:n(r.field),filter:u(r),remove:()=>{s(r.field,void 0)}}}).filter(Boolean),[u,o,n,s]);return{selectFilters:c,toValueFilter:a,toRangeFilter:f}}function T(){const{filter:e}=h.useNostoAppState(a=>({filter:a.query.products?.filter??[]})),{updateSearch:s}=A.useActions(),{selectFilters:t,toValueFilter:o,toRangeFilter:n}=$(),c=l.useMemo(()=>e?e.filter(t).flatMap(a=>"value"in a?o(a):"range"in a?n(a):[]).filter(Boolean):[],[e,t,n,o]),u=l.useCallback(()=>{s({products:{filter:[]}}),O.dispatchNostoEvent({event:"events/removeAllFilters",params:null})},[s]);return{filters:c,removeAll:u}}function x(e){const{replaceFilter:s}=A.useActions(),{query:t,products:o}=h.useNostoAppState(g=>({query:g.query,products:g.response.products})),n=o?.facets?.find(g=>g.id===e),c=t.products?.filter?.find(g=>g.field===n?.field),[u,a]=U(c),f=n&&"min"in n?Math.floor(n.min??0):0,r=n&&"max"in n?Math.ceil(n.max??0):0,i=l.useMemo(()=>[u??f,a??r],[u,a,f,r]),d=u!==void 0||a!==void 0,[p,S]=l.useState(d),v=l.useCallback(()=>{S(g=>!g)},[]),m=l.useCallback(([g,b])=>{if(!n)return;const y=_(g,b,f,r);s(n.field,y)},[f,r,s,n]);return L.useEventBusSubscribe({event:"events/removeAllFilters",callback:()=>{S(!1)}}),n?{min:f,max:r,range:i,updateRange:m,active:p,toggleActive:v}:H}const H={min:0,max:0,range:[0,0],active:!1,toggleActive:()=>{},updateRange:()=>{}};function U(e){const s=e?.range?.[0];return typeof s=="object"&&("gte"in s||"lte"in s)?[F.parseNumber(s.gte),F.parseNumber(s.lte)]:[void 0,void 0]}function _(e,s,t,o){const n=e!==void 0?Math.floor(e):void 0,c=s!==void 0?Math.ceil(s):void 0,u=n!==void 0,a=c!==void 0;if((t===n||!u)&&(o===c||!a))return;const f={};return u&&n!==t&&(f.gte=n.toString()),a&&c!==o&&(f.lte=c.toString()),Object.keys(f).length>0?f:void 0}function I(e,s){const{min:t,max:o,range:n,updateRange:c}=x(e),{filters:u}=T(),a=l.useMemo(()=>{const d=u.find(m=>m?.filter?.range);let p=null;if(d){const m=d.filter.range?.[0];p=[F.parseNumber(m?.gte),F.parseNumber(m?.lte)]}const S=[];let v=Math.floor(t/s)*s;for(;v<o;){const m=v+s,g=p&&p[0]===v&&p[1]===m;S.push({min:v,max:m,selected:g}),v=m}return S},[u,t,o,s]),f=l.useCallback(d=>{c([d,n[1]])},[n,c]),r=l.useCallback(d=>{c([n[0],d])},[n,c]),i=t!==n[0]||o!==n[1];return{min:t,max:o,range:n,updateRange:c,ranges:a,handleMinChange:f,handleMaxChange:r,isSelected:i}}function K(){const{products:e,keywords:s,popularSearches:t,categories:o}=h.useNostoAppState(n=>({products:n.response.products??w,keywords:n.response.keywords??w,popularSearches:n.response.popularSearches??w,categories:n.response.categories??w}));return{products:e,keywords:s,popularSearches:t,categories:o}}const w={hits:[],total:0};function Z(){const e=h.useNostoAppState(t=>t.query.products?.filter);return l.useMemo(()=>e?e.reduce((t,o)=>t+(Array.isArray(o.value)?o.value.length:1),0):0,[e])}const G=300*1e3,N=new Map;function J(e){const[s,t]=l.useState({product:null,loading:!0,error:null});return l.useEffect(()=>{if(!e){t({product:null,loading:!1,error:"Product handle is required"});return}t(n=>({...n,loading:!0,error:null}));const o=Y(e);if(o){t({product:o,loading:!1,error:null});return}W(e).then(n=>{ee(e,n),t({product:n,loading:!1,error:null})}).catch(n=>{t({product:null,loading:!1,error:n.message||"Failed to fetch product"})})},[e]),s}function Q(e){const s=window.Shopify?.routes?.root;return s?new URL(`${s}products/${e}`,window.location.href):e}async function W(e){const s=await fetch(Q(`/products/${e}.js`));if(!s.ok)throw new Error(`Failed to fetch product: ${s.status} ${s.statusText}`);return s.json()}function Y(e){const s=N.get(e);return s?Date.now()-s.created>G?(N.delete(e),null):s.product:null}function ee(e,s){N.set(e,{product:s,created:Date.now()})}function k(e){return e&&!Number.isNaN(e)?e:0}function te(e,s){const{from:t,size:o,total:n}=h.useNostoAppState(r=>({from:k(r.query.products?.from??0),size:k(r.response?.products?.size??s),total:k(r.response?.products?.total??0)})),{updateSearch:c}=A.useActions(),u=t+o,a=l.useMemo(()=>[...e].reverse().filter(r=>r<n),[e,n]),f=l.useCallback(r=>{c({products:{size:F.parseNumber(r)}})},[c]);return{from:t,to:u,total:n,size:o,sizeOptions:a,handleSizeChange:f}}function se(e,s){return e.length!==s.length?!1:e.every(t=>s.find(o=>t.field===o.field&&t.order===o.order))}function ne(e){const s=h.useNostoAppState(c=>c.query),{updateSearch:t}=A.useActions(),o=e.find(c=>se(c.value.sort,s.products?.sort||[]))?.id??e[0]?.id,n=l.useCallback(c=>{if(c===o)return;const u=e.find(a=>a.id===c);u&&t({products:{sort:u.value.sort}})},[e,t,o]);return{activeSort:o,setSort:n}}const C=window.SpeechRecognition||window.webkitSpeechRecognition,P=!!(C&&typeof C=="function");function oe(){return{listening:!1,startListening:()=>{},stopListening:()=>{}}}function re({language:e="en-US",interimResults:s=!1,onResult:t,onError:o}={}){const[n,c]=l.useState(!1),u=l.useRef(null),a=l.useCallback(()=>{const r=new C;r.lang=e,r.interimResults=s,r.onstart=()=>c(!0),t&&(r.onresult=i=>{const{transcript:d}=i.results?.[0]?.[0];t(d)}),o&&(r.onerror=i=>o(i.error)),r.onend=()=>c(!1),u.current=r,r.start()},[e,s,o,t]),f=l.useCallback(()=>{u.current?.stop()},[u]);return{listening:n,startListening:a,stopListening:f}}const ce=P?re:oe;function ue(e,s){if(!e.length||!s.length)return[];const t=s.reduce((o,n)=>(o[n]={},o),{});return e.forEach(o=>{o.customFields?.forEach(({key:n,value:c})=>{const u=n.toLowerCase();s.includes(u)&&(t[u][c]=t[u][c]||[],t[u][c].push(o))})}),Object.entries(t).filter(o=>Object.keys(o[1]).length).map(([o,n])=>({field:o,options:Object.entries(n).map(([c,u])=>({value:c,skus:u,unavailable:!1,selected:!1}))}))}function ie(e,s){return e.length?e.map(({field:t,options:o})=>({field:t,options:o.map(n=>{const c=!n.skus?.some(a=>Object.entries(s).every(([f,r])=>f===t?!0:a.customFields?.find(d=>d.key.toLowerCase()===f)?.value===r)),u=s[t]===n.value;return{...n,unavailable:c,selected:u}})})):[]}const R=["4XS","3XS","2XS","XXS","XS","S","M","L","XL","XXL","2XL","XXXL","3XL","4XL"];function ae(e){if(R.includes(e))return 1e3+R.indexOf(e);const s=parseFloat(e);return isNaN(s)?e:s}function le(e,s){return[...s].sort((t,o)=>{const[n,c]=[t.value,o.value].map(ae);return n<c?-1:1})}function de(e=[],s=[]){const[t,o]=l.useState({}),n=l.useMemo(()=>ue(e,s).map(({field:r,options:i})=>({field:r,options:le(r,i)})),[e,s]),c=l.useMemo(()=>ie(n,t),[n,t]),u=l.useCallback((f,r)=>{o(i=>{const d={...i};return d[f]===r?delete d[f]:d[f]=r,d})},[]),a=l.useMemo(()=>Object.keys(t).filter(i=>t[i]).length===0?[]:c.filter(({field:i})=>t[i]).map(({field:i,options:d})=>{const p=t[i];return d.find(v=>v.value===p)?.skus??[]}).reduce((i,d)=>i.filter(p=>d.includes(p))),[c,t]);return{swatches:c,toggleOption:u,matchedSkus:a}}exports.useActions=A.useActions;exports.useLoadMore=h.useLoadMore;exports.useNostoAppState=h.useNostoAppState;exports.addToHistory=M.addToHistory;exports.getSavedHistory=M.getSavedHistory;exports.useHistory=M.useHistory;exports.speechToTextSupported=P;exports.useDecoratedSearchResults=X;exports.useFacet=E;exports.useFacets=j;exports.usePagination=B;exports.usePersonalization=D;exports.useProductFilters=T;exports.useRange=x;exports.useRangeSelector=I;exports.useResponse=K;exports.useSelectedFiltersCount=Z;exports.useShopifyProduct=J;exports.useSizeOptions=te;exports.useSort=ne;exports.useSpeechToText=ce;exports.useSwatches=de;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { h as A } from "../../useActions-
|
|
2
|
-
import {
|
|
3
|
-
import { a as S } from "../../useLoadMore-
|
|
4
|
-
import { u as Le } from "../../useLoadMore-
|
|
1
|
+
import { h as A } from "../../useActions-BD6dgsX8.js";
|
|
2
|
+
import { b as X } from "../../storage-B97DRj5i.js";
|
|
3
|
+
import { a as S } from "../../useLoadMore-D7HOr7gc.js";
|
|
4
|
+
import { u as Le } from "../../useLoadMore-D7HOr7gc.js";
|
|
5
5
|
import { u as P } from "../../eventBusSubscribe-B5E7dTzk.js";
|
|
6
6
|
import { useState as b, useCallback as p, useMemo as y, useEffect as k, useRef as z } from "preact/hooks";
|
|
7
|
-
import { a as Me, g as Te, u as Ne } from "../../useHistory-
|
|
7
|
+
import { a as Me, g as Te, u as Ne } from "../../useHistory-sjFYeR68.js";
|
|
8
8
|
import { s as C } from "../../index.es-XNBESE3P.js";
|
|
9
9
|
import { d as O } from "../../eventBusDispatch-DPR2Vwd4.js";
|
|
10
10
|
import { p as R } from "../../parseNumber-QA48nJLp.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { A as L, m as j } from "../../AutocompletePageProvider-
|
|
2
|
-
import { C as O, m as R } from "../../CategoryPageProvider-
|
|
3
|
-
import { n as T, c as p } from "../../useActions-
|
|
4
|
-
import { S as $, m as F } from "../../SerpPageProvider-
|
|
1
|
+
import { A as L, m as j } from "../../AutocompletePageProvider-CQePqAhB.js";
|
|
2
|
+
import { C as O, m as R } from "../../CategoryPageProvider-DVL9lsCU.js";
|
|
3
|
+
import { n as T, c as p } from "../../useActions-BD6dgsX8.js";
|
|
4
|
+
import { S as $, m as F } from "../../SerpPageProvider-BzrNPc7g.js";
|
|
5
5
|
import { u as d } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
6
|
-
import { E as h } from "../../ErrorBoundary
|
|
6
|
+
import { E as h } from "../../ErrorBoundary--j3FHvZ3.js";
|
|
7
7
|
import { d as k, b as B } from "../../disableNativeAutocomplete-Bkta_WR2.js";
|
|
8
|
-
import {
|
|
8
|
+
import { m as I } from "../../unique-CCu7ChUL.js";
|
|
9
9
|
import { render as y } from "preact";
|
|
10
|
-
import { l as q, g as w, s as Q } from "../../storage-
|
|
10
|
+
import { l as q, g as w, s as Q } from "../../storage-B97DRj5i.js";
|
|
11
11
|
function U(e) {
|
|
12
12
|
let n;
|
|
13
13
|
return (t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../useActions-DIlSparF.cjs"),r=require("../../InfiniteScrollWithObserver-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../useActions-DIlSparF.cjs"),r=require("../../InfiniteScrollWithObserver-CjukRCW7.cjs"),t=require("../../useLoadMore-Dm2qQgim.cjs");exports.newSearch=e.newSearch;exports.updateSearch=e.updateSearch;exports.InfiniteScrollWithObserver=r.InfiniteScrollWithObserver;exports.intersectionObserverSupported=r.intersectionObserverSupported;exports.getNextPageQuery=t.getNextPageQuery;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as t, u as a } from "../../useActions-
|
|
2
|
-
import { I as s, i } from "../../InfiniteScrollWithObserver-
|
|
3
|
-
import { g as p } from "../../useLoadMore-
|
|
1
|
+
import { n as t, u as a } from "../../useActions-BD6dgsX8.js";
|
|
2
|
+
import { I as s, i } from "../../InfiniteScrollWithObserver-DJzbYXZA.js";
|
|
3
|
+
import { g as p } from "../../useLoadMore-D7HOr7gc.js";
|
|
4
4
|
export {
|
|
5
5
|
s as InfiniteScrollWithObserver,
|
|
6
6
|
p as getNextPageQuery,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { u as i } from "../../jsxRuntime.module-Bzuv3cXw.js";
|
|
2
2
|
import { s as l } from "../../index.es-XNBESE3P.js";
|
|
3
3
|
import { B as m } from "../../BaseElement-DD_4UwDm.js";
|
|
4
|
-
import { b as p } from "../../useActions-
|
|
4
|
+
import { b as p } from "../../useActions-BD6dgsX8.js";
|
|
5
5
|
import { useCallback as f } from "preact/hooks";
|
|
6
|
-
import { S as h } from "../../SerpPageProvider-
|
|
6
|
+
import { S as h } from "../../SerpPageProvider-BzrNPc7g.js";
|
|
7
7
|
const S = "nosto:search-js:scrollPos";
|
|
8
8
|
function g() {
|
|
9
9
|
window.sessionStorage.setItem(S, window.scrollY.toString());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as m } from "./index.es-XNBESE3P.js";
|
|
2
|
-
import { d as g,
|
|
2
|
+
import { d as g, a as y, i as l, l as S } from "./storage-B97DRj5i.js";
|
|
3
3
|
async function C(t, { hitDecorators: e, ...n }, s) {
|
|
4
4
|
const r = await s(t, n);
|
|
5
5
|
if (!r.products?.hits?.length || !e?.length)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as u } from "./storage-B97DRj5i.js";
|
|
2
2
|
function d(...r) {
|
|
3
3
|
return c(...r);
|
|
4
4
|
}
|
|
5
5
|
function c(...r) {
|
|
6
|
-
return r.reduce((e, n) =>
|
|
6
|
+
return r.reduce((e, n) => i(e, n));
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function i(r, e) {
|
|
9
9
|
return u(r) && u(e) ? Object.entries(e).reduce(
|
|
10
|
-
(n, [t, o]) => (n[t] =
|
|
10
|
+
(n, [t, o]) => (n[t] = i(n[t], o), n),
|
|
11
11
|
{ ...r }
|
|
12
12
|
) : u(r) ? r : e;
|
|
13
13
|
}
|
|
@@ -15,13 +15,13 @@ function l(...r) {
|
|
|
15
15
|
if (!r.every((e) => e == null))
|
|
16
16
|
return r.filter((e) => Array.isArray(e)).reduce((e, n) => e.concat(n), []);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const a = "nosto.search.";
|
|
19
19
|
function f(r) {
|
|
20
|
-
const e = `${
|
|
20
|
+
const e = `${a}${r}`;
|
|
21
21
|
window.performance?.mark(`${e}.start`);
|
|
22
22
|
}
|
|
23
23
|
function s(r) {
|
|
24
|
-
const e = `${
|
|
24
|
+
const e = `${a}${r}`;
|
|
25
25
|
window.performance?.mark(`${e}.end`), window.performance?.measure(e, `${e}.start`, `${e}.end`);
|
|
26
26
|
}
|
|
27
27
|
function $(r) {
|
|
@@ -31,9 +31,9 @@ function w(r) {
|
|
|
31
31
|
return Array.from(new Set(r));
|
|
32
32
|
}
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
l as a,
|
|
35
35
|
c as b,
|
|
36
36
|
d,
|
|
37
|
-
|
|
37
|
+
$ as m,
|
|
38
38
|
w as u
|
|
39
39
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext as S } from "preact";
|
|
2
2
|
import { useContext as k, useMemo as I, useCallback as d } from "preact/hooks";
|
|
3
|
-
import { b as w, u as M,
|
|
4
|
-
import { i as b, l as A } from "./storage-
|
|
5
|
-
import { s as U } from "./search-
|
|
3
|
+
import { b as w, u as M, m as f, d as h, a as E } from "./unique-CCu7ChUL.js";
|
|
4
|
+
import { i as b, l as A } from "./storage-B97DRj5i.js";
|
|
5
|
+
import { s as U } from "./search-D1jQPG6P.js";
|
|
6
6
|
const q = S(null);
|
|
7
7
|
function p() {
|
|
8
8
|
const e = k(q);
|
|
@@ -250,10 +250,10 @@ export {
|
|
|
250
250
|
X as a,
|
|
251
251
|
p as b,
|
|
252
252
|
K as c,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
Q as d,
|
|
254
|
+
z as e,
|
|
255
|
+
W as f,
|
|
256
|
+
R as g,
|
|
257
257
|
Y as h,
|
|
258
258
|
v as n,
|
|
259
259
|
m as u
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as l, a as m } from "./useActions-
|
|
2
|
-
import { g as c, s as u } from "./storage-
|
|
1
|
+
import { S as l, a as m } from "./useActions-BD6dgsX8.js";
|
|
2
|
+
import { g as c, s as u } from "./storage-B97DRj5i.js";
|
|
3
3
|
import { useContext as y, useCallback as f } from "preact/hooks";
|
|
4
4
|
const e = "nosto:search-js:history";
|
|
5
5
|
function g({ value: o, historySize: t, store: s }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as n, h as u } from "./useActions-
|
|
1
|
+
import { S as n, h as u } from "./useActions-BD6dgsX8.js";
|
|
2
2
|
import { useContext as a, useState as c, useEffect as i, useCallback as f } from "preact/hooks";
|
|
3
|
-
import { i as m } from "./isBot-
|
|
3
|
+
import { i as m } from "./isBot-m_h8RaQC.js";
|
|
4
4
|
function l(t = p) {
|
|
5
5
|
const e = a(n), [o, r] = c(t(e.getState()));
|
|
6
6
|
return e.onChange(t, r), i(() => () => e.clearOnChange(r), [e]), o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./useActions-DIlSparF.cjs"),s=require("preact/hooks"),i=require("./isBot-
|
|
1
|
+
"use strict";const n=require("./useActions-DIlSparF.cjs"),s=require("preact/hooks"),i=require("./isBot-ByWyyjRB.cjs");function c(e=f){const t=s.useContext(n.StoreContext),[o,r]=s.useState(e(t.getState()));return t.onChange(e,r),s.useEffect(()=>()=>t.clearOnChange(r),[t]),o}function f(e){return e}function a({from:e,size:t,pageSize:o}){return i.isBot()?{products:{from:e+o}}:{products:{size:t+o}}}function d(e=24){const{from:t,size:o}=c(u=>({from:u.query.products?.from??0,size:u.query.products?.size??0})),{updateSearch:r}=n.useActions();return{loadMore:s.useCallback(async()=>{await r(a({from:t,size:o,pageSize:e}))},[t,o,e,r])}}exports.getNextPageQuery=a;exports.useLoadMore=d;exports.useNostoAppState=c;
|
package/dist/utils/utils.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../disableNativeAutocomplete-DI6zaZII.cjs"),o=require("../cl-B00bZ7jc.cjs"),t=require("../unique-C1G3v2Y8.cjs"),s=require("../isBot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../disableNativeAutocomplete-DI6zaZII.cjs"),o=require("../cl-B00bZ7jc.cjs"),t=require("../unique-C1G3v2Y8.cjs"),s=require("../isBot-ByWyyjRB.cjs"),e=require("../storage-9KuhFI9v.cjs"),i=require("../parseNumber-FsZ8w61u.cjs"),a=require("../pick-rYi1lc2m.cjs");exports.bindInput=r.bindInput;exports.disableNativeAutocomplete=r.disableNativeAutocomplete;exports.cl=o.cl;exports.deepMerge=t.deepMerge;exports.measure=t.measure;exports.mergeArrays=t.mergeArrays;exports.unique=t.unique;exports.isBot=s.isBot;exports.getLocalStorageItem=e.getLocalStorageItem;exports.getSessionStorageItem=e.getSessionStorageItem;exports.isEqual=e.isEqual;exports.isPlainObject=e.isPlainObject;exports.logger=e.logger;exports.removeLocalStorageItem=e.removeLocalStorageItem;exports.removeSessionStorageItem=e.removeSessionStorageItem;exports.setLocalStorageItem=e.setLocalStorageItem;exports.setSessionStorageItem=e.setSessionStorageItem;exports.parseNumber=i.parseNumber;exports.pick=a.pick;
|
package/dist/utils/utils.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { b as s, d as o } from "../disableNativeAutocomplete-Bkta_WR2.js";
|
|
2
2
|
import { c as t } from "../cl-CcykAxZN.js";
|
|
3
|
-
import { d as i,
|
|
4
|
-
import { i as S } from "../isBot-
|
|
5
|
-
import { g as f,
|
|
3
|
+
import { d as i, m as p, a as g, u as l } from "../unique-CCu7ChUL.js";
|
|
4
|
+
import { i as S } from "../isBot-m_h8RaQC.js";
|
|
5
|
+
import { g as f, a as n, i as x, b as I, l as b, r as d, c as v, s as L, d as q } from "../storage-B97DRj5i.js";
|
|
6
6
|
import { p as N } from "../parseNumber-QA48nJLp.js";
|
|
7
7
|
import { p as k } from "../pick-DReBictn.js";
|
|
8
8
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nosto/search-js",
|
|
3
|
-
"version": "3.25.
|
|
3
|
+
"version": "3.25.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -97,31 +97,31 @@
|
|
|
97
97
|
"prepare": "husky"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@commitlint/cli": "^20.
|
|
101
|
-
"@commitlint/config-conventional": "^20.
|
|
102
|
-
"@nosto/nosto-js": "^2.
|
|
100
|
+
"@commitlint/cli": "^20.4.2",
|
|
101
|
+
"@commitlint/config-conventional": "^20.4.2",
|
|
102
|
+
"@nosto/nosto-js": "^2.11.1",
|
|
103
103
|
"@testing-library/dom": "^10.4.1",
|
|
104
104
|
"@types/dom-speech-recognition": "^0.0.7",
|
|
105
105
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
106
|
-
"@types/node": "^25.
|
|
107
|
-
"@vitest/coverage-v8": "^4.0.
|
|
106
|
+
"@types/node": "^25.2.3",
|
|
107
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
108
108
|
"concurrently": "^9.2.1",
|
|
109
109
|
"copyfiles": "^2.4.1",
|
|
110
110
|
"eslint": "^9.39.2",
|
|
111
111
|
"eslint-config-prettier": "^10.1.8",
|
|
112
112
|
"eslint-plugin-barrel-files": "^3.0.1",
|
|
113
|
-
"eslint-plugin-prettier": "^5.5.
|
|
113
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
114
114
|
"eslint-plugin-react": "^7.37.5",
|
|
115
115
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
116
116
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
117
|
-
"eslint-plugin-unused-imports": "^4.
|
|
117
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
118
118
|
"husky": "^9.1.7",
|
|
119
|
-
"isbot": "^5.1.
|
|
120
|
-
"jsdom": "^
|
|
121
|
-
"prettier": "^3.
|
|
122
|
-
"typedoc": "^0.28.
|
|
119
|
+
"isbot": "^5.1.35",
|
|
120
|
+
"jsdom": "^28.1.0",
|
|
121
|
+
"prettier": "^3.8.1",
|
|
122
|
+
"typedoc": "^0.28.17",
|
|
123
123
|
"typescript": "^5.9.3",
|
|
124
|
-
"typescript-eslint": "^8.
|
|
124
|
+
"typescript-eslint": "^8.56.1",
|
|
125
125
|
"vite": "^7.3.1",
|
|
126
126
|
"vite-plugin-dts": "^4.5.4",
|
|
127
127
|
"vitest": "^4.0.7"
|
package/dist/isBot-0jVC54QA.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var r = " daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/", t = /bot|crawl|http|lighthouse|scan|search|spider/i, e;
|
|
2
|
-
function o() {
|
|
3
|
-
if (e instanceof RegExp)
|
|
4
|
-
return e;
|
|
5
|
-
try {
|
|
6
|
-
e = new RegExp(r, "i");
|
|
7
|
-
} catch {
|
|
8
|
-
e = t;
|
|
9
|
-
}
|
|
10
|
-
return e;
|
|
11
|
-
}
|
|
12
|
-
function s(a) {
|
|
13
|
-
return !!a && o().test(a);
|
|
14
|
-
}
|
|
15
|
-
function c() {
|
|
16
|
-
return s(navigator.userAgent);
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
c as i
|
|
20
|
-
};
|
package/dist/isBot-CM2hS03W.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/",t=/bot|crawl|http|lighthouse|scan|search|spider/i,e;function o(){if(e instanceof RegExp)return e;try{e=new RegExp(r,"i")}catch{e=t}return e}function s(a){return!!a&&o().test(a)}function c(){return s(navigator.userAgent)}exports.isBot=c;
|