@wix/stores 1.0.976 → 1.0.978

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.
Files changed (31) hide show
  1. package/_sdk-exports/context-category-by-id/runtime.js +2 -2
  2. package/_sdk-exports/context-category-by-slug/runtime.js +2 -2
  3. package/_sdk-exports/context-category-info/runtime.js +2 -2
  4. package/_sdk-exports/context-product-by-id/runtime.js +2 -2
  5. package/_sdk-exports/context-product-by-slug/runtime.js +2 -2
  6. package/_sdk-exports/context-product-item/runtime.js +2 -2
  7. package/build/cjs/context-category-by-id.js +218 -207
  8. package/build/cjs/context-category-by-id.js.map +1 -1
  9. package/build/cjs/context-category-by-slug.js +1202 -1191
  10. package/build/cjs/context-category-by-slug.js.map +1 -1
  11. package/build/cjs/context-category-info.js +258 -248
  12. package/build/cjs/context-category-info.js.map +1 -1
  13. package/build/cjs/context-product-by-id.js +39 -31
  14. package/build/cjs/context-product-by-id.js.map +1 -1
  15. package/build/cjs/context-product-by-slug.js +48 -40
  16. package/build/cjs/context-product-by-slug.js.map +1 -1
  17. package/build/cjs/context-product-item.js +1042 -1034
  18. package/build/cjs/context-product-item.js.map +1 -1
  19. package/build/es/context-category-by-id.mjs +218 -207
  20. package/build/es/context-category-by-id.mjs.map +1 -1
  21. package/build/es/context-category-by-slug.mjs +1202 -1191
  22. package/build/es/context-category-by-slug.mjs.map +1 -1
  23. package/build/es/context-category-info.mjs +262 -252
  24. package/build/es/context-category-info.mjs.map +1 -1
  25. package/build/es/context-product-by-id.mjs +39 -31
  26. package/build/es/context-product-by-id.mjs.map +1 -1
  27. package/build/es/context-product-by-slug.mjs +48 -40
  28. package/build/es/context-product-by-slug.mjs.map +1 -1
  29. package/build/es/context-product-item.mjs +1042 -1034
  30. package/build/es/context-product-item.mjs.map +1 -1
  31. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{useCallback as t,useMemo as n,useState as r}from"react";import{Fragment as i,jsx as a}from"react/jsx-runtime";import o,{useProductContext as s}from"@wix/stores/product-context-provider";import{useGetService as c,useService as l}from"@wix/services-manager-react";var u=Object.create,d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,m=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,g=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=p(t),a=0,o=i.length,s;a<o;a++)s=i[a],!h.call(e,s)&&s!==n&&d(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=f(t,s))||r.enumerable});return e},v=(e,t,n)=>(n=e==null?{}:u(m(e)),_(t||!e||!e.__esModule||!h.call(e,`default`)?d(n,`default`,{value:e,enumerable:!0}):n,e)),y={};function b(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var x=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},S=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:x(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},C=e=>e.__isAmbassador?!0:!!e().__isAmbassador,w=`__metadata`,T=`edge.wixapis.com`,E=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return D(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},D=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),O=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},k=e=>e&&typeof e==`object`&&!Array.isArray(e),ee=e=>e.__type===`host`;function te(e,t){return e.create(t)}var ne=`x-wix-bi-gateway`;function re(e,t,n){return{[ne]:ie({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ie(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ae(e){let t=globalThis.__wix_context__,n={client:y.client,elevatedClient:y.elevatedClient},r;globalThis.__wix_context__=void 0,y.client=void 0,y.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,y.client=n.client,y.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var oe={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function se(e){return fe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ce=/([\p{Ll}\d])(\p{Lu})/gu,le=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ue=`$1\0$2`,de=/[^\p{L}\d]+/giu;function fe(e){let t=e.trim();t=t.replace(ce,ue).replace(le,ue),t=t.replace(de,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var pe=e=>`validationError`in(e.response?.data?.details??{}),me=e=>`applicationError`in(e.response?.data?.details??{}),he=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function ge(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pe(e))return _e(e,t,n);if(me(e))return ye(e);if(he(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:se(n),data:{}},requestId:e.requestId};return ve(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return be(e)}var _e=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=xe(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return ve(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},ve=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ye=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??se(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return ve(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},be=e=>ve(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:se(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),xe=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Se(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Se(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Se=(e,t)=>{let n=Ce(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ce=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function we(e,t,n,r,i,a,o,s,c,l,u){return ae(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?T:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=re(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=Ee(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=ge(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var Te=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Ee=(e,t,n,r)=>new Te({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),De=`.`;function Oe(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=ke(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function ke(e){return Array.isArray(e)?e:e.split(De).map(e=>Ae(e)?Number(e):e)}function Ae(e){return/^\d+$/.test(e)}function je(e){let t={};for(let[n,r]of Object.entries(e))Me(n)||Oe(t,ke(n),r);return t}function Me(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Ne=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),je(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in oe?oe[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Le(e);if(a&&a in t){r.push(a),n=t[a];return}throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;if(e in n){o(e,t);continue}a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Pe(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Fe(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Ie(s,a);return c===null?null:(o.modifiedFields=c,o)}function Fe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Ne(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Ie(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Le(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Re(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var ze=e=>e.__type===`event-definition`;function Be(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Pe(s,a);if(e)return t(e)}}return t(a(o))}function Ve(e){let t=new Map,n=Re();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>Be(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>Be(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:b(`AppInstalled`)(),AppRemoved:b(`AppRemoved`)()}}}}var He=e=>e.__type===`service-plugin-definition`;function Ue(e){let t=new Map,n=Re();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var A=`X-Wix-Consistent`;function We(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[A]:t[A]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=Ge(e);return a&&(t[A]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=Ge(e);return a&&(t[A]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ue(i),{client:u,initModule:d}=Ve(i),f=async(n,r)=>{let i=o(),s=await a(),c=O(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[A]:t[A]}:{}}}),u=Ge(l);return u&&(t[A]=u),l},p=(t,n)=>{if(ze(t))return d(t);if(He(t))return l(t);if(ee(t)&&e.host)return te(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return we(ae(()=>C(t))?S(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return k(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[w])])):t},m=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?p(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:m,use:p,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?y.elevatedClient=this:y.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new E(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function Ge(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ke=`wix:`,qe={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Je={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`},Ye=`items`,Xe=`pagingMetadata`,Ze=qe;function Qe(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}function $e(e,{transformSystemFields:t=!0}={}){return t?Qe(e,Ze):e}var et=`sort.fieldName`;function tt(e,t,n){return(e===et||e.endsWith(`.${et}`))&&typeof t==`string`?Qe(t,n):t}function nt(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=rt(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=tt(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function rt(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function j(e,t=[]){return nt(e,qe,t)}function M(e,t=[]){return nt(e,Je,t)}function it(e){return e?.toISOString()}function N(e){return e?new Date(e):void 0}var at=new WeakMap;function ot(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function st(e,t){let n=e.get(t);return n||(n=ot(),e.set(t,n)),n}function ct(e,t){return t===`*`?(e.anyField??=ot(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,st(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,st(e.fields,t))}function lt(e){let t=ot();for(let n of e){let e=n.path.split(`.`).reduce(ct,t);e.leaves??=[],e.leaves.push(n)}return t}function ut(e){let t=at.get(e);return t||(t=lt(e),at.set(e,t)),t}function dt(e){return typeof e==`object`&&!!e}function ft(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?dt(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function pt(e,t,n){dt(e)&&gt(e,t,n)}function mt(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=ft(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>pt(e,i,n)):pt(t,i,n)}}function ht(e,t,n){for(let[r,i]of t){let t=e[r];dt(t)&&Object.values(t).forEach(e=>pt(e,i,n))}}function gt(e,{fields:t,mapFields:n,anyField:r},i){t&&mt(e,t,i),n&&ht(e,n,i),r&&Object.values(e).forEach(e=>pt(e,r,i))}function P(e,t){if(!dt(e))return e;for(let{paths:n,transformFn:r}of t)gt(e,ut(n),r);return e}function _t(e,t){let{protocol:n}=new URL(e);return n===`${t}:`?`${Ke}${e}`:e}function vt(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function yt(e){return wt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var bt=/([\p{Ll}\d])(\p{Lu})/gu,xt=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,St=`$1\0$2`,Ct=/[^\p{L}\d]+/giu;function wt(e){let t=e.trim();t=t.replace(bt,St).replace(xt,St),t=t.replace(Ct,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var Tt=e=>`validationError`in(e.response?.data?.details??{}),Et=e=>`applicationError`in(e.response?.data?.details??{}),Dt=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function F(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(Tt(e))return Ot(e,t,n);if(Et(e))return At(e);if(Dt(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:yt(n),data:{}},requestId:e.requestId};return kt(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return jt(e)}var Ot=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Mt(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return kt(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},kt=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),At=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??yt(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return kt(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},jt=e=>kt(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:yt(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Mt=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Nt(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Nt(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Nt=(e,t)=>{let n=Pt(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Pt=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ft(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return It(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:y.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:y.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:y.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:y.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return It(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return It(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function It(e){let t=globalThis.__wix_context__,n={client:y.client,elevatedClient:y.elevatedClient},r;globalThis.__wix_context__=void 0,y.client=void 0,y.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,y.client=n.client,y.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Lt(e,t){return((...n)=>{let r=Ft();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function Rt(e){let t=((...t)=>{let n=Ft();return n?n.initWixModules(e).apply(void 0,t):()=>({slug:e.type})});return t.__type=e.__type,t.type=e.type,t.isDomainEvent=e.isDomainEvent,t.transformations=e.transformations,t}function zt(e,t=!1){return Lt(e,t)}function Bt(e,t){let n=Ht(e),r=Object.entries(n).some(([e,t])=>e.includes(`.`)||Array.isArray(t)&&t.some(e=>typeof e==`object`));return t&&r?new URLSearchParams({".r":Wt(JSON.stringify(e))}):Object.entries(n).reduce((e,[t,n])=>((Array.isArray(n)?n:[n]).forEach(r=>{r==null||Array.isArray(n)&&typeof r==`object`||e.append(t,r)}),e),new URLSearchParams)}function Vt(e){let t=rn(tn(e.host),e.domainToMappings);return pn(un(e.protoPath,e.data||{}),t)}function Ht(e,t=``){let n={};return Object.entries(e).forEach(([e,r])=>{let i=typeof r==`object`&&!!r&&!Array.isArray(r),a=Ut(t,e);if(i){let e=Ht(r,a);Object.assign(n,e)}else n[a]=r}),n}function Ut(e,t){return`${e}${e?`.`:``}${t}`}var Wt=e=>{let t=new TextEncoder().encode(e);return(typeof btoa<`u`?btoa(String.fromCodePoint(...t)):Buffer.from(e,`utf-8`).toString(`base64`)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)},Gt=[`wix.com`,`editorx.com`],Kt=`_`,qt=`*.`,Jt=RegExp(`\\.(${Gt.join(`|`)})$`),Yt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Xt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Zt=`dev.wix-code.com`,Qt=/{(.*)}/,$t=RegExp(`\\.(${Yt.join(`|`)})$`),en=RegExp(`.*\\.${Zt}$`);function tn(e){return nn(e).replace(Jt,`._base_domain_`).replace($t,`._api_base_domain_`).replace(en,`*.dev.wix-code.com`)}function nn(e){return Xt[e]??e}function rn(e,t){let n=t[e];if(n)return n;let r=an(e,t)??on(e,t);if(!r){if(cn(e)){let e=t[ln];if(e)return e}let n=t[Kt];if(n)return n}return r??[]}function an(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function on(e,t){let[n]=Object.entries(t).filter(([t])=>sn(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function sn(e,t){if(!t.startsWith(qt))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function cn(e){return!!e.match(/\._base_domain_$/)}var ln=`www._base_domain_`;function un(e,t){return e.split(`/`).map(e=>dn(e,t)).join(`/`)}function dn(e,t){let n=e.match(Qt)||[],r=n[1];return r?fn(t,r,e,e.replace(n[0],``)):e}function fn(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function pn(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function I(e){return Rt(e)}function mn(e){return isFinite(e)?e:e.toString()}function hn(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}function gn(e){return e&&vt({city:e.city,hint:e.hint,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,formattedAddress:e.formatted,geocode:e.location,addressLine:e.addressLine1,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine}})}function _n(e){return e&&vt({formatted:e.formattedAddress,location:e.geocode,addressLine1:e.addressLine,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine},hint:e.hint,city:e.city,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,countryFullname:e.countryFullname,subdivisionFullname:e.subdivisionFullname})}var vn=`x-wix-linguist`,yn=`00000000-0000-0000-0000-000000000000`,bn=`false`,xn=()=>{let e=wn(`language`),t=wn(`locale`);if(e)return{[vn]:[e,t||e,bn,yn].join(`|`)}};function Sn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var Cn=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,wn=e=>Cn()?.[e],Tn=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=Dn();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:wn(`language`),locale:wn(`locale`),get passThroughHeaders(){return xn()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&En()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=Sn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function En(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Dn(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var On=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),kn=Tn({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:On({clientSdk:t,applicationId:n}),close:()=>{}}}}),An=(e,t)=>{let n=kn.host({applicationId:e,componentId:t}),r=kn.auth();return We({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},jn=e=>An(`215238eb-22a5-4c36-9e7b-e7c08025e04e`,e),Mn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Nn=new class extends Mn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Pn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},L=new class{#e=Pn;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Fn(e){setTimeout(e,0)}var In=typeof window>`u`||`Deno`in globalThis;function R(){}function Ln(e,t){return typeof e==`function`?e(t):e}function Rn(e){return typeof e==`number`&&e>=0&&e!==1/0}function zn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function z(e,t){return typeof e==`function`?e(t):e}function B(e,t){return typeof e==`function`?e(t):e}function Bn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Hn(o,t.options))return!1}else if(!Wn(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Vn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Un(t.options.mutationKey)!==Un(a))return!1}else if(!Wn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Hn(e,t){return(t?.queryKeyHashFn||Un)(e)}function Un(e){return JSON.stringify(e,(e,t)=>Yn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Wn(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Wn(e[n],t[n])):!1}var Gn=Object.prototype.hasOwnProperty;function Kn(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Jn(e)&&Jn(t);if(!r&&!(Yn(e)&&Yn(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Gn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Kn(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function qn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Jn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yn(e){if(!Xn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Xn(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Xn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Zn(e){return new Promise(t=>{L.setTimeout(t,e)})}function Qn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Kn(e,t)}function $n(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function er(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var tr=Symbol();function nr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===tr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rr(e,t){return typeof e==`function`?e(...t):!!e}function ir(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ar=(()=>{let e=()=>In;return{isServer(){return e()},setIsServer(t){e=t}}})();function or(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var sr=Fn;function cr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=sr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var V=cr(),lr=new class extends Mn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ur(e){return Math.min(1e3*2**e,3e4)}function dr(e){return(e??`online`)!==`online`||lr.isOnline()}var fr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function pr(e){let t=!1,n=0,r,i=or(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new fr(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Nn.isFocused()&&(e.networkMode===`always`||lr.isOnline())&&e.canRun(),u=()=>dr(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(ar.isServer()?0:3),o=e.retryDelay??ur,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Zn(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var mr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rn(this.gcTime)&&(this.#e=L.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ar.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(L.clearTimeout(this.#e),this.#e=void 0)}};function hr(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ir(e,()=>t.signal,()=>n=!0)},u=nr(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?er:$n;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?_r:gr,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:gr(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function gr(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _r(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var vr=class extends mr{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=xr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=xr(this.options);e.data!==void 0&&(this.setState(br(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Qn(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(R).catch(R):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>B(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>z(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!zn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=nr(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?hr(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=pr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof fr&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof fr){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...yr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...br(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function yr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function br(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function xr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Sr=class extends Mn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=or(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),wr(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof B(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!qn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Er(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||B(this.options.enabled,this.#t)!==B(t.enabled,this.#t)||z(this.options.staleTime,this.#t)!==z(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||B(this.options.enabled,this.#t)!==B(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Or(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(R)),t}#g(){this.#b();let e=z(this.options.staleTime,this.#t);if(ar.isServer()||this.#r.isStale||!Rn(e))return;let t=zn(this.#r.dataUpdatedAt,e)+1;this.#d=L.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!ar.isServer()&&B(this.options.enabled,this.#t)!==!1&&Rn(this.#p)&&this.#p!==0&&(this.#f=L.setInterval(()=>{(this.options.refetchIntervalInBackground||Nn.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(L.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(L.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&wr(e,t),o=i&&Er(e,n,t,r);(a||o)&&(l={...l,...yr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Qn(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Qn(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Dr(e,t),refetch:this.refetch,promise:this.#o,isEnabled:B(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=or();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!qn(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Cr(e,t){return B(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||B(t.retryOnMount,e)!==!1)}function wr(e,t){return Cr(e,t)||e.state.data!==void 0&&Tr(e,t,t.refetchOnMount)}function Tr(e,t,n){if(B(t.enabled,e)!==!1&&z(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Dr(e,t)}return!1}function Er(e,t,n,r){return(e!==t||B(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Dr(e,n)}function Dr(e,t){return B(t.enabled,e)!==!1&&e.isStaleByTime(z(t.staleTime,e))}function Or(e,t){return!qn(e.getCurrentResult(),t)}var kr=class extends mr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ar(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=pr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),V.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ar(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var jr=class extends Mn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new kr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Mr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Mr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Mr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Mr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){V.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Vn(t,e))}findAll(e={}){return this.getAll().filter(t=>Vn(e,t))}notify(e){V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return V.batch(()=>Promise.all(e.map(e=>e.continue().catch(R))))}};function Mr(e){return e.options.scope?.id}var Nr=class extends Mn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Hn(r,t),a=this.get(i);return a||(a=new vr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Bn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Bn(e,t)):t}notify(e){V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Nr,this.#t=e.mutationCache||new jr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Nn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=lr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(z(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ln(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return V.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return V.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=V.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(R).catch(R)}invalidateQueries(e,t={}){return V.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=V.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(R)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(R)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(z(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(R).catch(R)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(R).catch(R)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return lr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Wn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Wn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Hn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===tr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Fr=e.createContext(void 0),Ir=t=>{let n=e.useContext(Fr);if(t)return t;if(!n)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return n},Lr=({client:t,children:n})=>(e.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a(Fr.Provider,{value:t,children:n})),Rr=e.createContext(!1),zr=()=>e.useContext(Rr);Rr.Provider;function Br(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vr=e.createContext(Br()),Hr=()=>e.useContext(Vr),Ur=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?rr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Wr=t=>{e.useEffect(()=>{t.clearReset()},[t])},Gr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||rr(n,[e.error,r])),Kr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},qr=(e,t)=>e.isLoading&&e.isFetching&&!t,Jr=(e,t)=>e?.suspense&&t.isPending,Yr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xr(t,n,r){let i=zr(),a=Hr(),o=Ir(r),s=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash),l=t.subscribed!==!1;s._optimisticResults=i?`isRestoring`:l?`optimistic`:void 0,Kr(s),Ur(s,a,c),Wr(a);let u=!o.getQueryCache().get(s.queryHash),[d]=e.useState(()=>new n(o,s)),f=d.getOptimisticResult(s),p=!i&&l;if(e.useSyncExternalStore(e.useCallback(e=>{let t=p?d.subscribe(V.batchCalls(e)):R;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),e.useEffect(()=>{d.setOptions(s)},[s,d]),Jr(s,f))throw Yr(s,d,a);if(Gr({result:f,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!ar.isServer()&&qr(f,i)&&(u?Yr(s,d,a):c?.promise)?.catch(R).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function Zr(e,t){return Xr(e,Sr,t)}function H(e){return e}var Qr=H(`@wix/site-service-url`),$r=`215238eb-22a5-4c36-9e7b-e7c08025e04e`,ei=`1380b703-ce81-ff05-f115-39571d94dfcd`;`${$r}`,`${$r}`;var U=function(e){return e.SIDE_CART=`ecom_side_cart`,e.CART=`shopping_cart`,e.CHECKOUT=`checkout`,e.PRODUCT_PAGE=`product-page-builder`,e.CATEGORY_PAGE=`category-page-builder`,e}({}),ti={ecom_side_cart:`52b042d1-9e32-450e-88b9-b1abee4242f8`},ni=()=>{let e=l(Qr),n=t((t,n)=>{let r=e.appSectionRelativeUrl($r,t,!0);if(r)return`./${r.replace(/^\//,``).replace(/\/$/,``)}/${encodeURIComponent(n)}`},[e]);return{getPageRelativeUrl:n,getPageAbsoluteUrl:t((t,r)=>{let i=n(t,r);if(i)return new URL(i,`${e.siteUrl.replace(/\/$/,``)}/`).href},[n,e])}},ri=g(((e,t)=>{t.exports=typeof window==`object`&&window&&window.Object===Object&&window})),W=g(((e,t)=>{var n=ri(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),ii=g(((e,t)=>{t.exports=W().Symbol})),ai=g(((e,t)=>{var n=ii(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),oi=g(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),si=g(((e,t)=>{var n=ii(),r=ai(),i=oi(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),ci=g(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),li=g(((e,t)=>{var n=si(),r=ci(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),ui=g(((e,t)=>{var n=li();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),di=g(((e,t)=>{function n(e,t){return e>t}t.exports=n})),fi=g(((e,t)=>{function n(e){return e}t.exports=n})),pi=g(((e,t)=>{var n=ui(),r=di(),i=fi();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),mi=g(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),hi=g(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),gi=g(((e,t)=>{var n=hi();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),_i=g(((e,t)=>{var n=gi(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),vi=g(((e,t)=>{var n=gi();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),yi=g(((e,t)=>{var n=gi();function r(e){return n(this.__data__,e)>-1}t.exports=r})),bi=g(((e,t)=>{var n=gi();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),xi=g(((e,t)=>{var n=mi(),r=_i(),i=vi(),a=yi(),o=bi();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Si=g(((e,t)=>{var n=xi();function r(){this.__data__=new n,this.size=0}t.exports=r})),Ci=g(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),wi=g(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),Ti=g(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Ei=g(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Di=g(((e,t)=>{var n=si(),r=Ei(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Oi=g(((e,t)=>{t.exports=W()[`__core-js_shared__`]})),ki=g(((e,t)=>{var n=Oi(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Ai=g(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),ji=g(((e,t)=>{var n=Di(),r=ki(),i=Ei(),a=Ai(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Mi=g(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),G=g(((e,t)=>{var n=ji(),r=Mi();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Ni=g(((e,t)=>{t.exports=G()(W(),`Map`)})),Pi=g(((e,t)=>{t.exports=G()(Object,`create`)})),Fi=g(((e,t)=>{var n=Pi();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Ii=g(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Li=g(((e,t)=>{var n=Pi(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Ri=g(((e,t)=>{var n=Pi(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),zi=g(((e,t)=>{var n=Pi(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Bi=g(((e,t)=>{var n=Fi(),r=Ii(),i=Li(),a=Ri(),o=zi();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Vi=g(((e,t)=>{var n=Bi(),r=xi(),i=Ni();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Hi=g(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Ui=g(((e,t)=>{var n=Hi();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Wi=g(((e,t)=>{var n=Ui();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Gi=g(((e,t)=>{var n=Ui();function r(e){return n(this,e).get(e)}t.exports=r})),Ki=g(((e,t)=>{var n=Ui();function r(e){return n(this,e).has(e)}t.exports=r})),qi=g(((e,t)=>{var n=Ui();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Ji=g(((e,t)=>{var n=Vi(),r=Wi(),i=Gi(),a=Ki(),o=qi();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Yi=g(((e,t)=>{var n=xi(),r=Ni(),i=Ji(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),Xi=g(((e,t)=>{var n=xi(),r=Si(),i=Ci(),a=wi(),o=Ti(),s=Yi();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Zi=g(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),Qi=g(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),$i=g(((e,t)=>{var n=Ji(),r=Zi(),i=Qi();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),ea=g(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),ta=g(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),na=g(((e,t)=>{var n=$i(),r=ea(),i=ta(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),ra=g(((e,t)=>{t.exports=W().Uint8Array})),ia=g(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),aa=g(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),oa=g(((e,t)=>{var n=ii(),r=ra(),i=hi(),a=na(),o=ia(),s=aa(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),sa=g(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),K=g(((e,t)=>{t.exports=Array.isArray})),ca=g(((e,t)=>{var n=sa(),r=K();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),la=g(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),ua=g(((e,t)=>{function n(){return[]}t.exports=n})),da=g(((e,t)=>{var n=la(),r=ua(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),fa=g(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),pa=g(((e,t)=>{var n=si(),r=ci(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),ma=g(((e,t)=>{var n=pa(),r=ci(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),ha=g(((e,t)=>{function n(){return!1}t.exports=n})),ga=g(((e,t)=>{var n=W(),r=ha(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),_a=g(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),va=g(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),ya=g(((e,t)=>{var n=si(),r=va(),i=ci(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function ee(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=ee})),ba=g(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),xa=g(((e,t)=>{var n=ri(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),Sa=g(((e,t)=>{var n=ya(),r=ba(),i=xa(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Ca=g(((e,t)=>{var n=fa(),r=ma(),i=K(),a=ga(),o=_a(),s=Sa(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),wa=g(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),Ta=g(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Ea=g(((e,t)=>{t.exports=Ta()(Object.keys,Object)})),Da=g(((e,t)=>{var n=wa(),r=Ea(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),Oa=g(((e,t)=>{var n=Di(),r=va();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),ka=g(((e,t)=>{var n=Ca(),r=Da(),i=Oa();function a(e){return i(e)?n(e):r(e)}t.exports=a})),Aa=g(((e,t)=>{var n=ca(),r=da(),i=ka();function a(e){return n(e,i,r)}t.exports=a})),ja=g(((e,t)=>{var n=Aa(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),Ma=g(((e,t)=>{t.exports=G()(W(),`DataView`)})),Na=g(((e,t)=>{t.exports=G()(W(),`Promise`)})),Pa=g(((e,t)=>{t.exports=G()(W(),`Set`)})),Fa=g(((e,t)=>{t.exports=G()(W(),`WeakMap`)})),Ia=g(((e,t)=>{var n=Ma(),r=Ni(),i=Na(),a=Pa(),o=Fa(),s=si(),c=Ai(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),La=g(((e,t)=>{var n=Xi(),r=na(),i=oa(),a=ja(),o=Ia(),s=K(),c=ga(),l=Sa(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),Ra=g(((e,t)=>{var n=La(),r=ci();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),za=g(((e,t)=>{var n=Xi(),r=Ra(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),Ba=g(((e,t)=>{var n=Ei();function r(e){return e===e&&!n(e)}t.exports=r})),Va=g(((e,t)=>{var n=Ba(),r=ka();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),Ha=g(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),Ua=g(((e,t)=>{var n=za(),r=Va(),i=Ha();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Wa=g(((e,t)=>{var n=K(),r=li(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Ga=g(((e,t)=>{var n=Ji(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Ka=g(((e,t)=>{var n=Ga(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),qa=g(((e,t)=>{var n=Ka(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Ja=g(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Ya=g(((e,t)=>{var n=ii(),r=Ja(),i=K(),a=li(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Xa=g(((e,t)=>{var n=Ya();function r(e){return e==null?``:n(e)}t.exports=r})),Za=g(((e,t)=>{var n=K(),r=Wa(),i=qa(),a=Xa();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Qa=g(((e,t)=>{var n=li(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),$a=g(((e,t)=>{var n=Za(),r=Qa();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),eo=g(((e,t)=>{var n=$a();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),to=g(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),no=g(((e,t)=>{var n=Za(),r=ma(),i=K(),a=_a(),o=va(),s=Qa();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),ro=g(((e,t)=>{var n=to(),r=no();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),io=g(((e,t)=>{var n=Ra(),r=eo(),i=ro(),a=Wa(),o=Ba(),s=Ha(),c=Qa(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),ao=g(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),oo=g(((e,t)=>{var n=$a();function r(e){return function(t){return n(t,e)}}t.exports=r})),so=g(((e,t)=>{var n=ao(),r=oo(),i=Wa(),a=Qa();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),co=g(((e,t)=>{var n=Ua(),r=io(),i=fi(),a=K(),o=so();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),lo=g(((e,t)=>{var n=ui(),r=di(),i=co();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),uo=g(((e,t)=>{function n(e,t){return e<t}t.exports=n})),fo=g(((e,t)=>{var n=ui(),r=uo(),i=fi();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),po=g(((e,t)=>{var n=ui(),r=co(),i=uo();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),mo=v(pi(),1),ho=v(lo(),1),go=v(fo(),1),_o=v(po(),1),vo=({price:e})=>e.actualPrice;function q(e){return e.priceAfterDiscount===void 0?{currentSellingPrice:e.actualPrice,priceBeforeDiscount:e.compareAtPrice,pricePerUnit:e.pricePerUnit}:{currentSellingPrice:e.priceAfterDiscount,priceBeforeDiscount:e.actualPrice,pricePerUnit:e.pricePerUnit}}function yo(e,t){let n=e.subscriptionPrices.find(e=>e.subscriptionId===t);if(!n)throw Error(`Missing subscription price for plan ${t} on variant ${e.id}`);let r=n.price;return{currentSellingPrice:r,priceBeforeDiscount:r<e.price.actualPrice?e.price.actualPrice:void 0}}function bo(e){let t=(0,_o.default)(e,vo),n=(0,ho.default)(e,vo),r=e.map(({price:e})=>q(e)),i=q(t.price),a=q(n.price),o=r.flatMap(({priceBeforeDiscount:e})=>e===void 0?[]:[e]);return{minCurrentSellingPrice:i.currentSellingPrice,maxCurrentSellingPrice:a.currentSellingPrice,minPriceBeforeDiscount:(0,go.default)(o),maxPriceBeforeDiscount:(0,mo.default)(o),minPricePerUnit:i.pricePerUnit,maxPricePerUnit:a.pricePerUnit}}function xo(e,t){return e.subscriptionDetails.subscriptions.map(e=>({subscription:e,price:yo(t,e.id)}))}function So(e){return{productPrice:{currentSellingPrice:void 0},subscriptionPlanPrices:e.subscriptionDetails.subscriptions.map(e=>({subscription:e,price:{currentSellingPrice:void 0}})),productPriceRange:{minCurrentSellingPrice:void 0,maxCurrentSellingPrice:void 0}}}function Co(e){if(!e.minPriceVariant)return So(e);let t=q(e.minPriceVariant.price),n=e.minPriceVariant.price.priceAfterDiscount!==void 0;return{productPrice:t,subscriptionPlanPrices:e.subscriptionDetails.subscriptions.map(e=>({subscription:e,price:{}})),productPriceRange:{minCurrentSellingPrice:t.currentSellingPrice,maxCurrentSellingPrice:n?void 0:e.priceRange.maxActualPrice,minPriceBeforeDiscount:t.priceBeforeDiscount,maxPriceBeforeDiscount:n?e.priceRange.maxActualPrice:e.priceRange.maxCompareAtPrice,minPricePerUnit:t.pricePerUnit}}}function wo(e,t,n){if(!n)return Co(e);let r=(0,_o.default)(e.variants,vo),i=t??r;return i?{productPrice:q(i.price),subscriptionPlanPrices:xo(e,i),productPriceRange:bo(e.variants)}:So(e)}function To(e,t){let n=e.subscriptionPlanPrices.find(({subscription:e})=>e.id===t);return n?{currentSellingPrice:n.price.currentSellingPrice,priceBeforeDiscount:n.price.priceBeforeDiscount,pricePerUnit:e.productPrice.pricePerUnit}:e.productPrice}function Eo(e){return q(e.price).currentSellingPrice}function Do(e){return Object.keys(e).length===1&&`$and`in e&&Array.isArray(e.$and)}function Oo(e){return Object.keys(e).length===1&&`$or`in e&&Array.isArray(e.$or)}function ko(e){return Object.keys(e).length===1&&`$not`in e&&typeof e.$not==`object`}function J(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$and:[...Do(e)?e.$and:[e],...Do(t)?t.$and:[t]]}}function Ao(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$or:[...Oo(e)?e.$or:[e],...Oo(t)?t.$or:[t]]}}function jo(e){if(e!==void 0&&Object.keys(e).length!==0)return ko(e)?e.$not:{$not:e}}var Mo=class{_items;_fetchNextPage;_fetchPrevPage;_originQuery;_limit;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}){this._items=e,this._fetchNextPage=n,this._fetchPrevPage=r,this._originQuery=t,this._limit=i}get items(){return this._items}get length(){return this._items.length}get pageSize(){return this._limit}get query(){return this._originQuery}async next(){if(!this.hasNext())throw Error(`No next page to fetch`);return await this._fetchNextPage()}async prev(){if(!this.hasPrev())throw Error(`No previous page to fetch`);return await this._fetchPrevPage()}},No=class extends Mo{_nextCursor;_prevCursor;cursors;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i,nextCursor:a,prevCursor:o}){super({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}),this._nextCursor=a,this._prevCursor=o,this.cursors={next:a,prev:o}}hasNext(){return!!this._nextCursor}hasPrev(){return!!this._prevCursor}},Po=class extends Mo{_totalCount;_offset;_tooManyToCount;constructor({items:e,fetchNextPage:t,fetchPrevPage:n,offset:r,originQuery:i,limit:a,totalCount:o,tooManyToCount:s}){super({items:e,fetchNextPage:t,fetchPrevPage:n,originQuery:i,limit:a}),this._totalCount=o,this._offset=r,this._tooManyToCount=s}get currentPage(){return this._limit===0?void 0:Math.floor(this._offset/this._limit)}get totalPages(){return this._tooManyToCount||this._limit===0?void 0:Math.ceil(this._totalCount/this._limit)}get totalCount(){return this._tooManyToCount?void 0:this._totalCount}hasNext(){return this._limit!==0&&this.currentPage!==void 0&&this.totalPages!==void 0&&this.currentPage<this.totalPages-1}hasPrev(){return!!(this._limit!==0&&this.currentPage&&this.currentPage>0)}};function Fo(e){let t=n=>({query:n,async find(){try{let r=e.requestTransformer(e.pagingMethod===`CURSOR`&&n.cursorPaging.cursor?{cursorPaging:n.cursorPaging}:n),i=await e.func(r),{[Ye]:a,[Xe]:o}=e.responseTransformer(i);if(e.pagingMethod===`OFFSET`){let e=n;return new Po({items:a??[],fetchNextPage:()=>t({...e,paging:{offset:e.paging.offset+e.paging.limit,limit:e.paging.limit}}).find(),fetchPrevPage:()=>t({...n,paging:{offset:Math.max(e.paging.offset-e.paging.limit,0),limit:e.paging.limit}}).find(),offset:e.paging.offset,limit:e.paging.limit,totalCount:o?.total,tooManyToCount:o?.tooManyToCount,originQuery:this})}let s=n.cursorPaging;return new No({items:a??[],limit:s.limit,originQuery:this,fetchNextPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.next??void 0,limit:s.limit}}).find(),fetchPrevPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.prev??void 0,limit:s.limit}}).find(),prevCursor:o?.cursors?.prev??void 0,nextCursor:o?.cursors?.next??void 0})}catch(t){throw e.errorTransformer(t)}},skipTo(e){return t({...n,cursorPaging:{cursor:e,limit:n.cursorPaging.limit}})},eq(r,i){let a=i===void 0?null:i,o={[Y(e.transformationPaths,r)]:a};return t({...n,filter:J(n.filter,o)})},ne(r,i){let a=i===void 0?null:i,o={[Y(e.transformationPaths,r)]:{$ne:a}};return t({...n,filter:J(n.filter,o)})},ge(r,i){let a={[Y(e.transformationPaths,r)]:{$gte:i}};return t({...n,filter:J(n.filter,a)})},gt(r,i){let a={[Y(e.transformationPaths,r)]:{$gt:i}};return t({...n,filter:J(n.filter,a)})},le(r,i){let a={[Y(e.transformationPaths,r)]:{$lte:i}};return t({...n,filter:J(n.filter,a)})},lt(r,i){let a={[Y(e.transformationPaths,r)]:{$lt:i}};return t({...n,filter:J(n.filter,a)})},isNotEmpty(e){return this.ne(e,null)},isEmpty(e){return this.eq(e,null)},startsWith(r,i){let a={[Y(e.transformationPaths,r)]:{$startsWith:i}};return t({...n,filter:J(n.filter,a)})},endsWith(r,i){let a={[Y(e.transformationPaths,r)]:{$endsWith:i}};return t({...n,filter:J(n.filter,a)})},contains(r,i){let a={[Y(e.transformationPaths,r)]:{$contains:i}};return t({...n,filter:J(n.filter,a)})},hasSome(r,...i){let a={[Y(e.transformationPaths,r)]:{$hasSome:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:J(n.filter,a)})},hasAll(r,...i){let a={[Y(e.transformationPaths,r)]:{$hasAll:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:J(n.filter,a)})},between(e,t,n){return this.ge(e,t).lt(e,n)},in(r,i){let a={[Y(e.transformationPaths,r)]:{$in:i}};return t({...n,filter:J(n.filter,a)})},exists(r,i=!0){let a={[Y(e.transformationPaths,r)]:{$exists:i}};return t({...n,filter:J(n.filter,a)})},or(e){return t({...n,filter:Ao(n.filter,e.query.filter)})},and(e){return t({...n,filter:J(n.filter,e.query.filter)})},not(e){return t({...n,filter:jo(e.query.filter)})},ascending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:Y(e.transformationPaths,t),order:`ASC`}))]})},descending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:Y(e.transformationPaths,t),order:`DESC`}))]})},skip(e){return t({...n,paging:{offset:e,limit:`limit`in n.paging?n.paging.limit:50}})},limit(r){if(e.pagingMethod===`CURSOR`){let e=n;return t({...n,cursorPaging:{limit:r,cursor:`cursor`in e.cursorPaging?e.cursorPaging.cursor:void 0}})}let i=n;return t({...n,paging:{limit:r,offset:`offset`in i.paging?i.paging.offset:0}})}});return t({filter:{},...e.pagingMethod===`OFFSET`?{paging:{offset:0,limit:50}}:{cursorPaging:{limit:50}}})}function Y(e,t){let n=Object.entries(e).find(([e])=>e===t||t.startsWith(`${e}.`))?.[0];return n?t.replace(n,e[n]):Qe(t,{...e,...Ze})}function Io(e,t,n={}){let r=(r,i)=>Io(e,t,{...n,[r]:i}),i=()=>Object.keys(n).length===0?{}:{[$e(e,t)]:n};return{get filter(){return i()},eq:e=>r(`$eq`,e),ne:e=>r(`$ne`,e),gt:e=>r(`$gt`,e),gte:e=>r(`$gte`,e),lt:e=>r(`$lt`,e),lte:e=>r(`$lte`,e),startsWith:e=>r(`$startsWith`,e),endsWith:e=>r(`$endsWith`,e),contains:e=>r(`$contains`,e),in:e=>r(`$in`,e),nin:e=>r(`$nin`,e),hasSome:e=>r(`$hasSome`,e),hasAll:e=>r(`$hasAll`,e),exists:(e=!0)=>r(`$exists`,e),isEmpty:(e=!0)=>r(`$isEmpty`,e),isNotEmpty:()=>r(`$ne`,null)}}function Lo(e){return Object.assign(t=>Io(t,e),{and:(...e)=>({filter:{$and:e.map(e=>e.filter)}}),or:(...e)=>({filter:{$or:e.map(e=>e.filter)}}),not:e=>({filter:{$not:e.filter}})})}function Ro(e){return(t=>({asc:()=>({sort:{fieldName:$e(t,e),order:`ASC`}}),desc:()=>({sort:{fieldName:$e(t,e),order:`DESC`}})}))}function zo(e){return()=>{let t={},n={withFilter(e){return t={...t,filter:e.filter},n},withFields(...r){return t={...t,fields:r.map(t=>$e(t,e))},n},withSorting(...e){return t={...t,sort:e.map(e=>e.sort)},n},withPaging(e){return t={...t,paging:e},n},build(){return t}};return n}}function Bo(e){return{QueryBuilder:zo(e),Filter:Lo(e),Sort:Ro(e)}}var Vo=`filter`,Ho=`sort`,Uo=`cursorPaging`,Wo=`paging`,Go=[Vo,Ho,Uo],Ko=[Vo,Ho,Wo];function qo(e,t){return!e||typeof e!=`object`?!1:t.some(t=>e.hasOwnProperty(t))}function Jo(e){return qo(e,Go)}function Yo(e){return qo(e,Ko)}function Xo(e){let{hasOptionsParameter:t}=e;return function(...n){return t?Qo(n,e):Zo(n,e)}}function Zo(e,t){return e.length===0?t.builderQueryFunction():t.typedQueryFunction(e[0])}function Qo(e,t){switch(e.length){case 0:return t.builderQueryFunction();case 1:return Jo(e[0])||Yo(e[0])?t.typedQueryFunction(e[0]):t.builderQueryFunction(e[0]);default:return t.typedQueryFunction(e[0],e[1])}}function $o(e){if(!e)return;let t=_t(e,`image`),{protocol:n,hash:r,pathname:i}=new URL(t),a=new URLSearchParams(r.replace(`#`,``)),o=a.get(`originHeight`),s=a.get(`originWidth`),[c,l]=i.replace(`image://v1/`,``).split(`/`),u=l&&decodeURIComponent(l);if(n===`wix:`){let t={id:c,height:Number(o),width:Number(s)};return u?{...t,altText:u,filename:u,url:e}:t}return{url:e}}function es(e){if(!e)return;let t=``;return(e.filename||e.altText)&&(t=`/${encodeURIComponent(e.filename||e.altText)}`),e.id?`wix:image://v1/${e.id}${t}#originWidth=${e.width}&originHeight=${e.height}`:e.url}function ts(e){let t={},n={get search(){return t},expression(e){return t={...t,expression:e},n},mode(e){return t={...t,mode:e},n},fields(r){return t={...t,fields:r.map(t=>$e(t,e))},n},fuzzy(e=!0){return t={...t,fuzzy:e},n}};return n}function ns(e){return t=>{let n=ts(e);return t===void 0?n:n.expression(t)}}function rs(e){let t={...e,type:`VALUE`,value:{...e.value}},n={get aggregation(){return t},sortBy(e,r){return t={...t,value:{...t.value,sortType:e,sortDirection:r}},n},limit(e){return t={...t,value:{...t.value,limit:e}},n},excludeMissingValues(){return t={...t,value:{...t.value,missingValues:`EXCLUDE`}},n},includeMissingValues(){return t={...t,value:{...t.value,missingValues:`INCLUDE`}},n},includeValues(e){return t={...t,value:{...t.value,includeOptions:{addToBucket:e}}},n}};return n}function is(e){let t={...e,type:`RANGE`,range:{buckets:[]}},n={get aggregation(){return t},withBuckets(...e){return t={...t,range:{buckets:e}},n}};return n}function as(e){let t={...e,type:`DATE_HISTOGRAM`,dateHistogram:{}},n={get aggregation(){return t},interval(e){return t={...t,dateHistogram:{interval:e}},n}};return n}function os(e){let t={...e,type:`SCALAR`,scalar:{}},n={get aggregation(){return t},type(e){return t={...t,scalar:{type:e}},n}};return n}function ss(e){let t={...e,type:`NESTED`,nested:{nestedAggregations:[]}},n={get aggregation(){return t},addNestedAggregation(e){let r=e.aggregation,i=[...t.nested?.nestedAggregations??[],r];return t={...t,nested:{nestedAggregations:i}},n}};return n}function cs(e,t){let n={name:e},r={get aggregation(){return n},ofType(e){return n={...n,type:e},r},onField(e){return n={...n,fieldPath:$e(e,t)},r},asValueAggregation(){return rs(n)},asRangeAggregation(){return is(n)},asDateHistogramAggregation(){return as(n)},asScalarAggregation(){return os(n)},asNestedAggregation(){return ss(n)}};return r}function ls(e){return t=>cs(t,e)}function us(){return()=>{let e={},t={withFilter(n){return e={...e,filter:n.filter},t},withSearchClause(n){return e={...e,search:n.search},t},withSorting(...n){return e={...e,sort:n.map(e=>e.sort)},t},withAggregation(...n){return e={...e,aggregations:n.map(e=>e.aggregation)},t},withPaging(n){return e={...e,paging:n},t},withTimeZone(n){return e={...e,timeZone:n},t},build(){return e}};return t}}function ds(e){return{SearchBuilder:us(),Filter:Lo(e),Sort:Ro(e),SearchParams:ns(e),Aggregation:ls(e)}}function fs(e){return Vt(Object.assign(e,{domainToMappings:{"bo._base_domain_":[{srcPath:`/back-in-stock-service`,destPath:``}],"wixbo.ai":[{srcPath:`/back-in-stock-service`,destPath:``}],"wix-bo.com":[{srcPath:`/back-in-stock-service`,destPath:``}],"www.wixapis.com":[{srcPath:`/back-in-stock-service`,destPath:``}],_:[{srcPath:`/v1/back-in-stock-notification-requests`,destPath:`/v1/back-in-stock-notification-requests`}],"*.dev.wix-code.com":[{srcPath:`/v1/back-in-stock-notification-requests`,destPath:`/v1/back-in-stock-notification-requests`}]}}))}var ps=`@wix/auto_sdk_ecom_back-in-stock-notifications`;function ms(e){function t({host:t}){let n=P(e,[{transformFn:it,paths:[{path:`request.createdDate`},{path:`itemDetails.image.urlExpirationDate`}]},{transformFn:mn,paths:[{path:`itemDetails.image.focalPoint.x`},{path:`itemDetails.image.focalPoint.y`}]}]);return{entityFqdn:`wix.ecom.v1.back_in_stock_notification_request`,method:`POST`,methodFqn:`com.wixpress.ecom.back.in.stock.BackInStockNotificationRequestService.CreateBackInStockNotificationRequest`,packageName:ps,migrationOptions:{optInTransformResponse:!0},url:fs({protoPath:`/v1/back-in-stock-notification-requests`,data:n,host:t}),data:n,transformResponse:e=>P(e,[{transformFn:N,paths:[{path:`request.createdDate`}]}])}}return t}async function hs(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=ms(P(j({request:e,itemDetails:t}),[{transformFn:$o,paths:[{path:`itemDetails.image`}]}]));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),M(e.data)?.request}catch(e){let t=F(e,{spreadPathsToArguments:{},explicitPathsToArguments:{request:`$[0]`,itemDetails:`$[1]`},singleArgumentUnchanged:!1},[`request`,`itemDetails`]);throw r?.onError?.(e),t}}({...Bo()});function gs(e){return(t,n)=>hs(t,n,{httpClient:e})}var _s=b(`wix.ecom.v1.back_in_stock_notification_request_created`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`metadata.eventTime`}]}])))(),vs=b(`wix.ecom.v1.back_in_stock_notification_request_deleted`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`undefined.createdDate`},{path:`metadata.eventTime`}]}])))(),ys=b(`wix.ecom.v1.back_in_stock_notification_request_updated`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`metadata.eventTime`}]}])))(),bs=zt(gs);I(_s),I(vs),I(ys);function xs(e){if(!e)return;let{pathname:t}=new URL(e);return{relativePath:t,url:e}}function Ss(e){if(e)return e.url}function Cs(e){return Vt(Object.assign(e,{domainToMappings:{"api._api_base_domain_":[{srcPath:`/cart-v2`,destPath:``}],_:[{srcPath:`/_api/cart-v2`,destPath:``}],"*.dev.wix-code.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"create.editorx":[{srcPath:`/_api/cart-v2`,destPath:``}],"apps._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"manage._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"bo._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"wixbo.ai":[{srcPath:`/_api/cart-v2`,destPath:``}],"wix-bo.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www.wixapis.com":[{srcPath:`/ecom/v2/carts`,destPath:`/v2/carts`}],"editor.wixapps.net":[{srcPath:`/_api/cart-v2`,destPath:``}]}}))}var ws=`@wix/auto_sdk_ecom_cart-v-2`;function Ts(e){function t({host:t}){let n=P(e,[{transformFn:it,paths:[{path:`cart.createdDate`},{path:`cart.updatedDate`},{path:`cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate`},{path:`cart.lineItems.attributes.image.urlExpirationDate`},{path:`cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate`},{path:`cart.lineItems.attributes.serviceProperties.scheduledDate`},{path:`cart.lineItems.attributes.serviceProperties.endDate`},{path:`catalogItems.catalogOverrideFields.image.urlExpirationDate`},{path:`customItems.attributes.image.urlExpirationDate`},{path:`customItems.attributes.serviceProperties.scheduledDate`},{path:`customItems.attributes.serviceProperties.endDate`},{path:`customItems.attributes.subscriptionInfo.subscriptionSettings.startDate`}]},{transformFn:mn,paths:[{path:`cart.lineItems.source.catalogOverrideFields.physicalProperties.weight`},{path:`cart.lineItems.attributes.physicalProperties.weight`},{path:`cart.deliveryInfo.address.geocode.latitude`},{path:`cart.deliveryInfo.address.geocode.longitude`},{path:`cart.paymentInfo.billingAddress.geocode.latitude`},{path:`cart.paymentInfo.billingAddress.geocode.longitude`},{path:`cart.legacyFields.discounts.merchantDiscount.percentage`},{path:`cart.tcAppliedDiscounts.merchantDiscount.percentage`},{path:`catalogItems.catalogOverrideFields.physicalProperties.weight`},{path:`customItems.attributes.physicalProperties.weight`}]}]);return{entityFqdn:`wix.ecom.v2.cart`,method:`POST`,methodFqn:`wix.ecom.cart.v2.CartService.CreateCart`,packageName:ws,migrationOptions:{optInTransformResponse:!0},url:Cs({protoPath:`/v2/carts`,data:n,host:t}),data:n,transformResponse:e=>P(e,[{transformFn:N,paths:[{path:`cart.createdDate`},{path:`cart.updatedDate`},{path:`cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate`},{path:`cart.lineItems.attributes.image.urlExpirationDate`},{path:`cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate`},{path:`cart.lineItems.attributes.serviceProperties.scheduledDate`},{path:`cart.lineItems.attributes.serviceProperties.endDate`}]},{transformFn:hn,paths:[{path:`cart.lineItems.source.catalogOverrideFields.physicalProperties.weight`},{path:`cart.lineItems.attributes.physicalProperties.weight`},{path:`cart.deliveryInfo.address.geocode.latitude`},{path:`cart.deliveryInfo.address.geocode.longitude`},{path:`cart.paymentInfo.billingAddress.geocode.latitude`},{path:`cart.paymentInfo.billingAddress.geocode.longitude`},{path:`cart.legacyFields.discounts.merchantDiscount.percentage`},{path:`cart.tcAppliedDiscounts.merchantDiscount.percentage`}]}])}}return t}var Es=(e=>(e.UNSPECIFIED=`UNSPECIFIED`,e.WEB=`WEB`,e.POS=`POS`,e.EBAY=`EBAY`,e.AMAZON=`AMAZON`,e.OTHER_PLATFORM=`OTHER_PLATFORM`,e.WIX_APP_STORE=`WIX_APP_STORE`,e.WIX_INVOICES=`WIX_INVOICES`,e.BACKOFFICE_MERCHANT=`BACKOFFICE_MERCHANT`,e.WISH=`WISH`,e.CLASS_PASS=`CLASS_PASS`,e.GLOBAL_E=`GLOBAL_E`,e.FACEBOOK=`FACEBOOK`,e.ETSY=`ETSY`,e.TIKTOK=`TIKTOK`,e.FAIRE_COM=`FAIRE_COM`,e.PAYPAL_AGENTIC_CHECKOUT=`PAYPAL_AGENTIC_CHECKOUT`,e.STRIPE_AGENTIC_CHECKOUT=`STRIPE_AGENTIC_CHECKOUT`,e.WIX_INVOICES_PLATFORM=`WIX_INVOICES_PLATFORM`,e.UCP_AGENTIC_CHECKOUT=`UCP_AGENTIC_CHECKOUT`,e))(Es||{});async function Ds(e){let{httpClient:t,sideEffects:n}=arguments[1],r=Ts(P(j({cart:e?.cart,catalogItems:e?.catalogItems,customItems:e?.customItems,coupons:e?.coupons,deliveryMethod:e?.deliveryMethod,giftCards:e?.giftCards}),[{transformFn:$o,paths:[{path:`cart.lineItems.source.catalogOverrideFields.image`},{path:`cart.lineItems.attributes.image`},{path:`catalogItems.catalogOverrideFields.image`},{path:`customItems.attributes.image`}]},{transformFn:xs,paths:[{path:`cart.lineItems.attributes.url`},{path:`customItems.attributes.url`}]},{transformFn:gn,paths:[{path:`cart.deliveryInfo.address`},{path:`cart.paymentInfo.billingAddress`}]}]));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),M(P(e.data,[{transformFn:es,paths:[{path:`cart.lineItems.source.catalogOverrideFields.image`},{path:`cart.lineItems.attributes.image`}]},{transformFn:Ss,paths:[{path:`cart.lineItems.attributes.url`}]},{transformFn:_n,paths:[{path:`cart.deliveryInfo.address`},{path:`cart.paymentInfo.billingAddress`}]}]))?.cart}catch(e){let t=F(e,{spreadPathsToArguments:{},explicitPathsToArguments:{cart:`$[0].cart`,catalogItems:`$[0].catalogItems`,customItems:`$[0].customItems`,coupons:`$[0].coupons`,deliveryMethod:`$[0].deliveryMethod`,giftCards:`$[0].giftCards`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Os(e){return t=>Ds(t,{httpClient:e})}var ks=zt(Os);function As(e){return Vt(Object.assign(e,{domainToMappings:{"api._api_base_domain_":[{srcPath:`/cart-v2`,destPath:``}],_:[{srcPath:`/_api/cart-v2`,destPath:``}],"*.dev.wix-code.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"create.editorx":[{srcPath:`/_api/cart-v2`,destPath:``}],"apps._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"manage._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"bo._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"wixbo.ai":[{srcPath:`/_api/cart-v2`,destPath:``}],"wix-bo.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www.wixapis.com":[{srcPath:`/ecom/v2/carts`,destPath:`/v2/carts`}],"editor.wixapps.net":[{srcPath:`/_api/cart-v2`,destPath:``}]}}))}var js=`@wix/auto_sdk_ecom_current-cart-v-2`;function Ms(e){function t({host:t}){let n=P(e,[{transformFn:mn,paths:[{path:`catalogItems.catalogOverrideFields.physicalProperties.weight`},{path:`customItems.attributes.physicalProperties.weight`}]},{transformFn:it,paths:[{path:`catalogItems.catalogOverrideFields.image.urlExpirationDate`},{path:`customItems.attributes.image.urlExpirationDate`},{path:`customItems.attributes.serviceProperties.scheduledDate`},{path:`customItems.attributes.serviceProperties.endDate`},{path:`customItems.attributes.subscriptionInfo.subscriptionSettings.startDate`}]}]);return{entityFqdn:`wix.ecom.v2.cart`,method:`POST`,methodFqn:`wix.ecom.cart.v2.CurrentCartService.AddLineItemsToCurrentCart`,packageName:js,migrationOptions:{optInTransformResponse:!0},url:As({protoPath:`/v2/carts/current/add-line-items`,data:n,host:t}),data:n,transformResponse:e=>P(e,[{transformFn:N,paths:[{path:`cart.createdDate`},{path:`cart.updatedDate`},{path:`cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate`},{path:`cart.lineItems.attributes.image.urlExpirationDate`},{path:`cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate`},{path:`cart.lineItems.attributes.serviceProperties.scheduledDate`},{path:`cart.lineItems.attributes.serviceProperties.endDate`}]},{transformFn:hn,paths:[{path:`cart.lineItems.source.catalogOverrideFields.physicalProperties.weight`},{path:`cart.lineItems.attributes.physicalProperties.weight`},{path:`cart.deliveryInfo.address.geocode.latitude`},{path:`cart.deliveryInfo.address.geocode.longitude`},{path:`cart.paymentInfo.billingAddress.geocode.latitude`},{path:`cart.paymentInfo.billingAddress.geocode.longitude`},{path:`cart.legacyFields.discounts.merchantDiscount.percentage`},{path:`cart.tcAppliedDiscounts.merchantDiscount.percentage`}]}])}}return t}async function Ns(e){let{httpClient:t,sideEffects:n}=arguments[1],r=Ms(P(j({catalogItems:e?.catalogItems,customItems:e?.customItems}),[{transformFn:$o,paths:[{path:`catalogItems.catalogOverrideFields.image`},{path:`customItems.attributes.image`}]},{transformFn:xs,paths:[{path:`customItems.attributes.url`}]}]));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),M(P(e.data,[{transformFn:es,paths:[{path:`cart.lineItems.source.catalogOverrideFields.image`},{path:`cart.lineItems.attributes.image`}]},{transformFn:Ss,paths:[{path:`cart.lineItems.attributes.url`}]},{transformFn:_n,paths:[{path:`cart.deliveryInfo.address`},{path:`cart.paymentInfo.billingAddress`}]}]))}catch(e){let t=F(e,{spreadPathsToArguments:{},explicitPathsToArguments:{catalogItems:`$[0].catalogItems`,customItems:`$[0].customItems`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Ps(e){return t=>Ns(t,{httpClient:e})}var Fs=zt(Ps),Is=`BACK_IN_STOCK_NOTIFICATION_REQUEST_ALREADY_EXISTS`;function Ls(e){return e?.details?.applicationError?.code??`UNKNOWN`}function Rs(e){return{code:Ls(e),message:e?.message}}async function zs(e){let{productId:t,variantId:n,email:r,name:i,price:a,imageUrl:o}=e;try{return await bs({catalogReference:{catalogItemId:t,appId:$r,...n?{options:{variantId:n}}:{}},email:r},{name:i,price:String(a),...o?{image:o}:{}}),`created`}catch(e){if(Ls(e)===Is)return`already-subscribed`;throw Rs(e)}}var Bs=`https://static.wixstatic.com/media`,Vs=/image:\/\/v1\/([^/#]+)/;function Hs(e){return e?e.match(Vs)?.[1]??null:null}function Us(e){if(!e)return;if(/^https?:\/\//i.test(e))return e;let t=Hs(e);return t?`${Bs}/${t}`:void 0}var Ws=e=>e.media.type===`image`;function Gs(e,t){let n=t.choices[e.id];return e.choices.find(e=>e.choiceId===n)}function Ks(e,t){let n=e.options.map(e=>Gs(e,t)?.mediaIds).filter(e=>!!(e&&e.length>0));if(n.length===0)return;let r=n.reduce((e,t)=>e.filter(e=>t.includes(e))),i=r.length>0?r:n.flat(),a=new Map;for(let t of e.media??[])Ws(t)&&a.set(t.id,t);for(let e of i){let t=a.get(e)?.media.src;if(t)return t}}function qs(e,t){let n=[t?Ks(e,t):void 0,e.media?.find(Ws)?.media.src];for(let e of n){let t=Us(e);if(t)return t}}function Js(e,r){let i=t(t=>r?zs({productId:e.id,variantId:r.id,email:t,name:e.name??``,price:Eo(r),imageUrl:qs(e,r)}):Promise.reject(Error(`Cannot create a back-in-stock notification without a selected variant`)),[e,r]);return n(()=>({handleNotifyMe:i}),[i])}function Ys(e,t){return n(()=>({id:e.id,name:e.name,description:e.description,ribbons:e.ribbons,breadcrumbs:e.breadcrumbs,mainCategoryId:e.mainCategoryId,categories:e.categories,infoSections:e.infoSections,sku:t?.sku,discountRules:e.discountRuleNames?.map(e=>({name:e}))}),[e,t])}function Xs(e){if(!e)return;let t=``;e?.filename&&(t=`/${encodeURIComponent(e.filename)}`);let n=``;if(e.posters?.length){let[t,r]=e.posters,i=r||t,a=i.id||``;if(!a&&i.url){let e=i.url.lastIndexOf(`/`);e!==-1&&(a=i.url.substring(e+1))}a&&(n=`#posterUri=${a}&posterWidth=${i.width}&posterHeight=${i.height}`)}return e.id?`wix:video://v1/${e.id}${t}${n}`:e.url}function Zs(e){return Vt(Object.assign(e,{domainToMappings:{"manage._base_domain_":[{srcPath:`/inventory`,destPath:``}],"api._api_base_domain_":[{srcPath:`/inventory`,destPath:``}],_:[{srcPath:`/_api/inventory`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/inventory`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/inventory`,destPath:``}],"create.editorx":[{srcPath:`/_api/inventory`,destPath:``}],"www.wixapis.com":[{srcPath:`/stores/v3/inventory-items`,destPath:`/v3/inventory-items`},{srcPath:`/stores/v3/bulk/inventory-items`,destPath:`/v3/bulk/inventory-items`}],"*.dev.wix-code.com":[{srcPath:`/_api/inventory`,destPath:``}],"editor.wixapps.net":[{srcPath:`/_api/inventory`,destPath:``}]}}))}var Qs=`@wix/auto_sdk_stores_inventory-items-v-3`;function $s(e){function t({host:t}){return{entityFqdn:`wix.stores.catalog.v3.inventory_item`,method:`GET`,methodFqn:`com.wix.stores.catalog.inventory.api.v3.InventoryService.QueryInventoryItems`,packageName:Qs,migrationOptions:{optInTransformResponse:!0},url:Zs({protoPath:`/v3/inventory-items/query`,data:e,host:t}),params:Bt(e,!0),transformResponse:e=>P(e,[{transformFn:N,paths:[{path:`inventoryItems.createdDate`},{path:`inventoryItems.updatedDate`}]}]),fallback:[{method:`POST`,url:Zs({protoPath:`/v3/inventory-items/query`,data:e,host:t}),data:e}]}}return t}var X=(e=>(e.OUT_OF_STOCK=`OUT_OF_STOCK`,e.IN_STOCK=`IN_STOCK`,e.PREORDER=`PREORDER`,e))(X||{});function ec(){let{httpClient:e,sideEffects:t}=arguments[0];return Fo({func:async n=>{let r=$s(n);t?.onSiteCall?.();try{let n=await e.request(r);return t?.onSuccess?.(n),n}catch(e){throw t?.onError?.(e),e}},requestTransformer:e=>{let t=[e,{}];return j({...t?.[1],query:t?.[0]})},responseTransformer:({data:e})=>{let t=M(P(e,[]));return{items:t?.inventoryItems,pagingMetadata:t?.pagingMetadata}},errorTransformer:e=>{throw F(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1})},pagingMethod:`CURSOR`,transformationPaths:{}})}async function tc(e){let{httpClient:t,sideEffects:n}=arguments[1],r=$s(j({query:e}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),M(e.data)}catch(e){let t=F(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1},[`query`]);throw n?.onError?.(e),t}}({...Bo()}),{...ds()};function nc(e){return()=>ec({httpClient:e})}function rc(e){return t=>tc(t,{httpClient:e})}var ic=b(`wix.stores.catalog.v3.inventory_item_created`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`metadata.eventTime`}]}])))(),ac=b(`wix.stores.catalog.v3.inventory_item_deleted`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`metadata.eventTime`}]}])))(),oc=b(`wix.stores.catalog.v3.inventory_item_stock_status_updated`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`metadata.eventTime`}]}])))(),sc=b(`wix.stores.catalog.v3.inventory_item_updated`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`metadata.eventTime`},{path:`modifiedFields.createdDate`},{path:`modifiedFields.updatedDate`}]}])))(),cc=b(`wix.stores.catalog.v3.inventory_item_updated_with_reason`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`data.currentEntity.createdDate`},{path:`data.currentEntity.updatedDate`},{path:`metadata.eventTime`}]}])))();function lc(e){let t=Xo({builderQueryFunction:()=>nc(e)(),typedQueryFunction:t=>rc(e)(t),hasOptionsParameter:!1});function n(e){return t(...arguments)}return n}var uc=zt(lc);I(ic),I(ac),I(oc),I(sc),I(cc);function dc(e){return Vt(Object.assign(e,{domainToMappings:{"api._api_base_domain_":[{srcPath:`/stores-catalog-orchestrator`,destPath:``}],"manage._base_domain_":[{srcPath:`/stores`,destPath:``}],"www.wixapis.com":[{srcPath:`/stores/v3/products`,destPath:`/v3/products`},{srcPath:`/stores/v3/bulk/products`,destPath:`/v3/bulk/products`},{srcPath:`/stores/v3/products-with-inventory`,destPath:`/v3/products-with-inventory`},{srcPath:`/stores/v3/bulk/products-with-inventory`,destPath:`/v3/bulk/products-with-inventory`},{srcPath:`/stores/v3/all-products-category`,destPath:`/v3/all-products-category`}],"www._base_domain_":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"create.editorx":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"editor.wixapps.net":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"*.dev.wix-code.com":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],_:[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}]}}))}var fc=`@wix/auto_sdk_stores_products-v-3`;function pc(e){function t({host:t}){return{entityFqdn:`wix.stores.catalog.v3.product`,method:`GET`,methodFqn:`wix.stores.catalog.v3.CatalogApi.GetProduct`,packageName:fc,migrationOptions:{optInTransformResponse:!0},url:dc({protoPath:`/v3/products/{productId}`,data:e,host:t}),params:Bt(e),transformResponse:e=>P(e,[{transformFn:N,paths:[{path:`product.createdDate`},{path:`product.updatedDate`},{path:`product.description.metadata.createdTimestamp`},{path:`product.description.metadata.updatedTimestamp`},{path:`product.media.main.image.urlExpirationDate`},{path:`product.media.main.video.urlExpirationDate`},{path:`product.media.main.video.resolutions.urlExpirationDate`},{path:`product.media.main.video.resolutions.poster.urlExpirationDate`},{path:`product.media.main.video.posters.urlExpirationDate`},{path:`product.media.itemsInfo.items.image.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.resolutions.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.resolutions.poster.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.posters.urlExpirationDate`},{path:`product.options.choicesSettings.choices.image.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.image.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate`},{path:`product.options.choicesSettings.choices.displayImage.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.image.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.image.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.displayImage.urlExpirationDate`},{path:`product.infoSections.description.metadata.createdTimestamp`},{path:`product.infoSections.description.metadata.updatedTimestamp`},{path:`product.variantsInfo.variants.media.image.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.resolutions.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.resolutions.poster.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.posters.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.image.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.resolutions.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.resolutions.poster.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.posters.urlExpirationDate`}]},{transformFn:hn,paths:[{path:`product.physicalProperties.pricePerUnit.quantity`},{path:`product.physicalProperties.shippingWeightRange.minValue`},{path:`product.physicalProperties.shippingWeightRange.maxValue`},{path:`product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`product.variantsInfo.variants.revenueDetails.profitMargin`},{path:`product.subscriptionDetails.subscriptions.discount.percentOff`},{path:`product.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`product.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`product.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`product.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`product.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`product.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`product.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`product.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`product.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`product.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`product.description.nodes.galleryData.items.image.media.duration`},{path:`product.description.nodes.galleryData.items.video.media.duration`},{path:`product.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`product.description.nodes.galleryData.options.item.ratio`},{path:`product.description.nodes.imageData.image.duration`},{path:`product.description.nodes.imageData.crop.x`},{path:`product.description.nodes.imageData.crop.y`},{path:`product.description.nodes.imageData.crop.width`},{path:`product.description.nodes.imageData.crop.height`},{path:`product.description.nodes.mapData.mapSettings.lat`},{path:`product.description.nodes.mapData.mapSettings.lng`},{path:`product.description.nodes.pollData.poll.image.duration`},{path:`product.description.nodes.pollData.poll.options.image.duration`},{path:`product.description.nodes.pollData.design.poll.background.image.duration`},{path:`product.description.nodes.appEmbedData.image.duration`},{path:`product.description.nodes.videoData.video.duration`},{path:`product.description.nodes.videoData.thumbnail.duration`},{path:`product.description.nodes.audioData.audio.duration`},{path:`product.description.nodes.audioData.coverImage.duration`},{path:`product.description.nodes.layoutData.backgroundImage.media.duration`},{path:`product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`product.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`product.description.nodes.layoutData.backdropImage.media.duration`},{path:`product.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`product.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`product.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`product.description.nodes.layoutData.background.gradient.centerX`},{path:`product.description.nodes.layoutData.background.gradient.centerY`},{path:`product.description.nodes.layoutData.background.gradient.stops.position`},{path:`product.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`product.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`product.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`product.description.nodes.shapeData.shape.duration`},{path:`product.description.nodes.cardData.background.gradient.centerX`},{path:`product.description.nodes.cardData.background.gradient.centerY`},{path:`product.description.nodes.cardData.background.gradient.stops.position`},{path:`product.description.nodes.cardData.backgroundImage.media.duration`},{path:`product.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`product.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`product.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`product.description.nodes.tocData.fontSize`},{path:`product.description.nodes.tocData.itemSpacing`},{path:`product.description.nodes.smartBlockCellData.shape.duration`},{path:`product.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`product.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`product.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`product.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`product.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`product.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`product.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`product.infoSections.description.nodes.imageData.image.duration`},{path:`product.infoSections.description.nodes.imageData.crop.x`},{path:`product.infoSections.description.nodes.imageData.crop.y`},{path:`product.infoSections.description.nodes.imageData.crop.width`},{path:`product.infoSections.description.nodes.imageData.crop.height`},{path:`product.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`product.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`product.infoSections.description.nodes.pollData.poll.image.duration`},{path:`product.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`product.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`product.infoSections.description.nodes.appEmbedData.image.duration`},{path:`product.infoSections.description.nodes.videoData.video.duration`},{path:`product.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`product.infoSections.description.nodes.audioData.audio.duration`},{path:`product.infoSections.description.nodes.audioData.coverImage.duration`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`product.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`product.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`product.infoSections.description.nodes.shapeData.shape.duration`},{path:`product.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`product.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`product.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`product.infoSections.description.nodes.tocData.fontSize`},{path:`product.infoSections.description.nodes.tocData.itemSpacing`},{path:`product.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`product.variantsInfo.variants.physicalProperties.weight`},{path:`product.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`product.minVariantPriceInfo.weight`}]}])}}return t}var mc=(e=>(e.FREE_TEXT=`FREE_TEXT`,e.TEXT_CHOICES=`TEXT_CHOICES`,e.SWATCH_CHOICES=`SWATCH_CHOICES`,e))(mc||{}),hc=(e=>(e.IN_STOCK=`IN_STOCK`,e.OUT_OF_STOCK=`OUT_OF_STOCK`,e.PARTIALLY_OUT_OF_STOCK=`PARTIALLY_OUT_OF_STOCK`,e))(hc||{}),gc=(e=>(e.ALL_VARIANTS=`ALL_VARIANTS`,e.NO_VARIANTS=`NO_VARIANTS`,e.SOME_VARIANTS=`SOME_VARIANTS`,e))(gc||{}),_c=(e=>(e.URL=`URL`,e.CURRENCY=`CURRENCY`,e.INFO_SECTION=`INFO_SECTION`,e.MERCHANT_DATA=`MERCHANT_DATA`,e.PLAIN_DESCRIPTION=`PLAIN_DESCRIPTION`,e.INFO_SECTION_PLAIN_DESCRIPTION=`INFO_SECTION_PLAIN_DESCRIPTION`,e.SUBSCRIPTION_PRICES_INFO=`SUBSCRIPTION_PRICES_INFO`,e.BREADCRUMBS_INFO=`BREADCRUMBS_INFO`,e.WEIGHT_MEASUREMENT_UNIT_INFO=`WEIGHT_MEASUREMENT_UNIT_INFO`,e.VARIANT_OPTION_CHOICE_NAMES=`VARIANT_OPTION_CHOICE_NAMES`,e.MEDIA_ITEMS_INFO=`MEDIA_ITEMS_INFO`,e.DESCRIPTION=`DESCRIPTION`,e.DIRECT_CATEGORIES_INFO=`DIRECT_CATEGORIES_INFO`,e.ALL_CATEGORIES_INFO=`ALL_CATEGORIES_INFO`,e.INFO_SECTION_DESCRIPTION=`INFO_SECTION_DESCRIPTION`,e.THUMBNAIL=`THUMBNAIL`,e.PRODUCT_CHOICES_MEDIA_REFERENCES=`PRODUCT_CHOICES_MEDIA_REFERENCES`,e.PRODUCT_CHOICES_DISPLAY_IMAGE=`PRODUCT_CHOICES_DISPLAY_IMAGE`,e.MIN_PRICE_VARIANT=`MIN_PRICE_VARIANT`,e.DISCOUNT_INFO=`DISCOUNT_INFO`,e))(_c||{});async function vc(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=pc(j({productId:e,fields:t?.fields},[]));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),M(P(e.data,[{transformFn:Ss,paths:[{path:`product.url`}]},{transformFn:es,paths:[{path:`product.media.main.image`},{path:`product.media.itemsInfo.items.image`},{path:`product.options.choicesSettings.choices.image`},{path:`product.options.choicesSettings.choices.displayImage`},{path:`product.options.choicesSettings.choices.linkedMedia.image`},{path:`product.modifiers.choicesSettings.choices.image`},{path:`product.modifiers.choicesSettings.choices.displayImage`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`product.variantsInfo.variants.media.image`},{path:`product.variantSummary.minPriceVariant.media.image`}]},{transformFn:Xs,paths:[{path:`product.media.main.video`},{path:`product.media.itemsInfo.items.video`},{path:`product.options.choicesSettings.choices.linkedMedia.video`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`product.variantsInfo.variants.media.video`},{path:`product.variantSummary.minPriceVariant.media.video`}]}]),[`product.description`,`product.infoSections.description`])?.product}catch(e){let t=F(e,{spreadPathsToArguments:{},explicitPathsToArguments:{productId:`$[0]`,fields:`$[1].fields`},singleArgumentUnchanged:!1},[`productId`,`options`]);throw r?.onError?.(e),t}}({...ds()}),{...Bo()};function yc(e){return(t,n)=>vc(t,n,{httpClient:e})}var bc=b(`wix.stores.catalog.v3.product_created`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.description.metadata.createdTimestamp`},{path:`entity.description.metadata.updatedTimestamp`},{path:`entity.infoSections.description.metadata.createdTimestamp`},{path:`entity.infoSections.description.metadata.updatedTimestamp`},{path:`metadata.eventTime`}]},{transformFn:Ss,paths:[{path:`entity.url`}]},{transformFn:hn,paths:[{path:`entity.physicalProperties.pricePerUnit.quantity`},{path:`entity.physicalProperties.shippingWeightRange.minValue`},{path:`entity.physicalProperties.shippingWeightRange.maxValue`},{path:`entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantsInfo.variants.revenueDetails.profitMargin`},{path:`entity.subscriptionDetails.subscriptions.discount.percentOff`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`entity.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`entity.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.description.nodes.galleryData.items.image.media.duration`},{path:`entity.description.nodes.galleryData.items.video.media.duration`},{path:`entity.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.description.nodes.galleryData.options.item.ratio`},{path:`entity.description.nodes.imageData.image.duration`},{path:`entity.description.nodes.imageData.crop.x`},{path:`entity.description.nodes.imageData.crop.y`},{path:`entity.description.nodes.imageData.crop.width`},{path:`entity.description.nodes.imageData.crop.height`},{path:`entity.description.nodes.mapData.mapSettings.lat`},{path:`entity.description.nodes.mapData.mapSettings.lng`},{path:`entity.description.nodes.pollData.poll.image.duration`},{path:`entity.description.nodes.pollData.poll.options.image.duration`},{path:`entity.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.description.nodes.appEmbedData.image.duration`},{path:`entity.description.nodes.videoData.video.duration`},{path:`entity.description.nodes.videoData.thumbnail.duration`},{path:`entity.description.nodes.audioData.audio.duration`},{path:`entity.description.nodes.audioData.coverImage.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.description.nodes.shapeData.shape.duration`},{path:`entity.description.nodes.cardData.background.gradient.centerX`},{path:`entity.description.nodes.cardData.background.gradient.centerY`},{path:`entity.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.tocData.fontSize`},{path:`entity.description.nodes.tocData.itemSpacing`},{path:`entity.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`entity.infoSections.description.nodes.imageData.image.duration`},{path:`entity.infoSections.description.nodes.imageData.crop.x`},{path:`entity.infoSections.description.nodes.imageData.crop.y`},{path:`entity.infoSections.description.nodes.imageData.crop.width`},{path:`entity.infoSections.description.nodes.imageData.crop.height`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`entity.infoSections.description.nodes.pollData.poll.image.duration`},{path:`entity.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`entity.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.infoSections.description.nodes.appEmbedData.image.duration`},{path:`entity.infoSections.description.nodes.videoData.video.duration`},{path:`entity.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`entity.infoSections.description.nodes.audioData.audio.duration`},{path:`entity.infoSections.description.nodes.audioData.coverImage.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.infoSections.description.nodes.shapeData.shape.duration`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.tocData.fontSize`},{path:`entity.infoSections.description.nodes.tocData.itemSpacing`},{path:`entity.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.variantsInfo.variants.physicalProperties.weight`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`entity.minVariantPriceInfo.weight`}]},{transformFn:es,paths:[{path:`entity.media.main.image`},{path:`entity.media.itemsInfo.items.image`},{path:`entity.options.choicesSettings.choices.image`},{path:`entity.options.choicesSettings.choices.displayImage`},{path:`entity.options.choicesSettings.choices.linkedMedia.image`},{path:`entity.modifiers.choicesSettings.choices.image`},{path:`entity.modifiers.choicesSettings.choices.displayImage`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`entity.variantsInfo.variants.media.image`},{path:`entity.variantSummary.minPriceVariant.media.image`}]},{transformFn:Xs,paths:[{path:`entity.media.main.video`},{path:`entity.media.itemsInfo.items.video`},{path:`entity.options.choicesSettings.choices.linkedMedia.video`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`entity.variantsInfo.variants.media.video`},{path:`entity.variantSummary.minPriceVariant.media.video`}]}])))(),xc=b(`wix.stores.catalog.v3.product_deleted`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.description.metadata.createdTimestamp`},{path:`entity.description.metadata.updatedTimestamp`},{path:`entity.infoSections.description.metadata.createdTimestamp`},{path:`entity.infoSections.description.metadata.updatedTimestamp`},{path:`metadata.eventTime`}]},{transformFn:Ss,paths:[{path:`entity.url`}]},{transformFn:hn,paths:[{path:`entity.physicalProperties.pricePerUnit.quantity`},{path:`entity.physicalProperties.shippingWeightRange.minValue`},{path:`entity.physicalProperties.shippingWeightRange.maxValue`},{path:`entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantsInfo.variants.revenueDetails.profitMargin`},{path:`entity.subscriptionDetails.subscriptions.discount.percentOff`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`entity.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`entity.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.description.nodes.galleryData.items.image.media.duration`},{path:`entity.description.nodes.galleryData.items.video.media.duration`},{path:`entity.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.description.nodes.galleryData.options.item.ratio`},{path:`entity.description.nodes.imageData.image.duration`},{path:`entity.description.nodes.imageData.crop.x`},{path:`entity.description.nodes.imageData.crop.y`},{path:`entity.description.nodes.imageData.crop.width`},{path:`entity.description.nodes.imageData.crop.height`},{path:`entity.description.nodes.mapData.mapSettings.lat`},{path:`entity.description.nodes.mapData.mapSettings.lng`},{path:`entity.description.nodes.pollData.poll.image.duration`},{path:`entity.description.nodes.pollData.poll.options.image.duration`},{path:`entity.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.description.nodes.appEmbedData.image.duration`},{path:`entity.description.nodes.videoData.video.duration`},{path:`entity.description.nodes.videoData.thumbnail.duration`},{path:`entity.description.nodes.audioData.audio.duration`},{path:`entity.description.nodes.audioData.coverImage.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.description.nodes.shapeData.shape.duration`},{path:`entity.description.nodes.cardData.background.gradient.centerX`},{path:`entity.description.nodes.cardData.background.gradient.centerY`},{path:`entity.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.tocData.fontSize`},{path:`entity.description.nodes.tocData.itemSpacing`},{path:`entity.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`entity.infoSections.description.nodes.imageData.image.duration`},{path:`entity.infoSections.description.nodes.imageData.crop.x`},{path:`entity.infoSections.description.nodes.imageData.crop.y`},{path:`entity.infoSections.description.nodes.imageData.crop.width`},{path:`entity.infoSections.description.nodes.imageData.crop.height`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`entity.infoSections.description.nodes.pollData.poll.image.duration`},{path:`entity.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`entity.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.infoSections.description.nodes.appEmbedData.image.duration`},{path:`entity.infoSections.description.nodes.videoData.video.duration`},{path:`entity.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`entity.infoSections.description.nodes.audioData.audio.duration`},{path:`entity.infoSections.description.nodes.audioData.coverImage.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.infoSections.description.nodes.shapeData.shape.duration`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.tocData.fontSize`},{path:`entity.infoSections.description.nodes.tocData.itemSpacing`},{path:`entity.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.variantsInfo.variants.physicalProperties.weight`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`entity.minVariantPriceInfo.weight`}]},{transformFn:es,paths:[{path:`entity.media.main.image`},{path:`entity.media.itemsInfo.items.image`},{path:`entity.options.choicesSettings.choices.image`},{path:`entity.options.choicesSettings.choices.displayImage`},{path:`entity.options.choicesSettings.choices.linkedMedia.image`},{path:`entity.modifiers.choicesSettings.choices.image`},{path:`entity.modifiers.choicesSettings.choices.displayImage`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`entity.variantsInfo.variants.media.image`},{path:`entity.variantSummary.minPriceVariant.media.image`}]},{transformFn:Xs,paths:[{path:`entity.media.main.video`},{path:`entity.media.itemsInfo.items.video`},{path:`entity.options.choicesSettings.choices.linkedMedia.video`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`entity.variantsInfo.variants.media.video`},{path:`entity.variantSummary.minPriceVariant.media.video`}]}])))(),Sc=b(`wix.stores.catalog.v3.product_updated`,!0,e=>M(P(e,[{transformFn:N,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.description.metadata.createdTimestamp`},{path:`entity.description.metadata.updatedTimestamp`},{path:`entity.infoSections.description.metadata.createdTimestamp`},{path:`entity.infoSections.description.metadata.updatedTimestamp`},{path:`metadata.eventTime`},{path:`modifiedFields.createdDate`},{path:`modifiedFields.updatedDate`},{path:`modifiedFields.description.metadata.createdTimestamp`},{path:`modifiedFields.description.metadata.updatedTimestamp`},{path:`modifiedFields.infoSections.description.metadata.createdTimestamp`},{path:`modifiedFields.infoSections.description.metadata.updatedTimestamp`}]},{transformFn:Ss,paths:[{path:`entity.url`},{path:`modifiedFields.url`}]},{transformFn:hn,paths:[{path:`entity.physicalProperties.pricePerUnit.quantity`},{path:`entity.physicalProperties.shippingWeightRange.minValue`},{path:`entity.physicalProperties.shippingWeightRange.maxValue`},{path:`entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantsInfo.variants.revenueDetails.profitMargin`},{path:`entity.subscriptionDetails.subscriptions.discount.percentOff`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`entity.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`entity.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.description.nodes.galleryData.items.image.media.duration`},{path:`entity.description.nodes.galleryData.items.video.media.duration`},{path:`entity.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.description.nodes.galleryData.options.item.ratio`},{path:`entity.description.nodes.imageData.image.duration`},{path:`entity.description.nodes.imageData.crop.x`},{path:`entity.description.nodes.imageData.crop.y`},{path:`entity.description.nodes.imageData.crop.width`},{path:`entity.description.nodes.imageData.crop.height`},{path:`entity.description.nodes.mapData.mapSettings.lat`},{path:`entity.description.nodes.mapData.mapSettings.lng`},{path:`entity.description.nodes.pollData.poll.image.duration`},{path:`entity.description.nodes.pollData.poll.options.image.duration`},{path:`entity.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.description.nodes.appEmbedData.image.duration`},{path:`entity.description.nodes.videoData.video.duration`},{path:`entity.description.nodes.videoData.thumbnail.duration`},{path:`entity.description.nodes.audioData.audio.duration`},{path:`entity.description.nodes.audioData.coverImage.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.description.nodes.shapeData.shape.duration`},{path:`entity.description.nodes.cardData.background.gradient.centerX`},{path:`entity.description.nodes.cardData.background.gradient.centerY`},{path:`entity.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.tocData.fontSize`},{path:`entity.description.nodes.tocData.itemSpacing`},{path:`entity.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`entity.infoSections.description.nodes.imageData.image.duration`},{path:`entity.infoSections.description.nodes.imageData.crop.x`},{path:`entity.infoSections.description.nodes.imageData.crop.y`},{path:`entity.infoSections.description.nodes.imageData.crop.width`},{path:`entity.infoSections.description.nodes.imageData.crop.height`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`entity.infoSections.description.nodes.pollData.poll.image.duration`},{path:`entity.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`entity.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.infoSections.description.nodes.appEmbedData.image.duration`},{path:`entity.infoSections.description.nodes.videoData.video.duration`},{path:`entity.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`entity.infoSections.description.nodes.audioData.audio.duration`},{path:`entity.infoSections.description.nodes.audioData.coverImage.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.infoSections.description.nodes.shapeData.shape.duration`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.tocData.fontSize`},{path:`entity.infoSections.description.nodes.tocData.itemSpacing`},{path:`entity.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.variantsInfo.variants.physicalProperties.weight`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`entity.minVariantPriceInfo.weight`},{path:`modifiedFields.physicalProperties.pricePerUnit.quantity`},{path:`modifiedFields.physicalProperties.shippingWeightRange.minValue`},{path:`modifiedFields.physicalProperties.shippingWeightRange.maxValue`},{path:`modifiedFields.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`modifiedFields.variantsInfo.variants.revenueDetails.profitMargin`},{path:`modifiedFields.subscriptionDetails.subscriptions.discount.percentOff`},{path:`modifiedFields.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`modifiedFields.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`modifiedFields.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`modifiedFields.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`modifiedFields.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`modifiedFields.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`modifiedFields.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`modifiedFields.description.nodes.galleryData.items.image.media.duration`},{path:`modifiedFields.description.nodes.galleryData.items.video.media.duration`},{path:`modifiedFields.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`modifiedFields.description.nodes.galleryData.options.item.ratio`},{path:`modifiedFields.description.nodes.imageData.image.duration`},{path:`modifiedFields.description.nodes.imageData.crop.x`},{path:`modifiedFields.description.nodes.imageData.crop.y`},{path:`modifiedFields.description.nodes.imageData.crop.width`},{path:`modifiedFields.description.nodes.imageData.crop.height`},{path:`modifiedFields.description.nodes.mapData.mapSettings.lat`},{path:`modifiedFields.description.nodes.mapData.mapSettings.lng`},{path:`modifiedFields.description.nodes.pollData.poll.image.duration`},{path:`modifiedFields.description.nodes.pollData.poll.options.image.duration`},{path:`modifiedFields.description.nodes.pollData.design.poll.background.image.duration`},{path:`modifiedFields.description.nodes.appEmbedData.image.duration`},{path:`modifiedFields.description.nodes.videoData.video.duration`},{path:`modifiedFields.description.nodes.videoData.thumbnail.duration`},{path:`modifiedFields.description.nodes.audioData.audio.duration`},{path:`modifiedFields.description.nodes.audioData.coverImage.duration`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.media.duration`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.media.duration`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`modifiedFields.description.nodes.layoutData.background.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.background.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.background.gradient.stops.position`},{path:`modifiedFields.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`modifiedFields.description.nodes.shapeData.shape.duration`},{path:`modifiedFields.description.nodes.cardData.background.gradient.centerX`},{path:`modifiedFields.description.nodes.cardData.background.gradient.centerY`},{path:`modifiedFields.description.nodes.cardData.background.gradient.stops.position`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.media.duration`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.description.nodes.tocData.fontSize`},{path:`modifiedFields.description.nodes.tocData.itemSpacing`},{path:`modifiedFields.description.nodes.smartBlockCellData.shape.duration`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`modifiedFields.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`modifiedFields.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`modifiedFields.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`modifiedFields.infoSections.description.nodes.imageData.image.duration`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.x`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.y`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.width`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.height`},{path:`modifiedFields.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`modifiedFields.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`modifiedFields.infoSections.description.nodes.pollData.poll.image.duration`},{path:`modifiedFields.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`modifiedFields.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`modifiedFields.infoSections.description.nodes.appEmbedData.image.duration`},{path:`modifiedFields.infoSections.description.nodes.videoData.video.duration`},{path:`modifiedFields.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`modifiedFields.infoSections.description.nodes.audioData.audio.duration`},{path:`modifiedFields.infoSections.description.nodes.audioData.coverImage.duration`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.shapeData.shape.duration`},{path:`modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.tocData.fontSize`},{path:`modifiedFields.infoSections.description.nodes.tocData.itemSpacing`},{path:`modifiedFields.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`modifiedFields.variantsInfo.variants.physicalProperties.weight`},{path:`modifiedFields.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`modifiedFields.minVariantPriceInfo.weight`}]},{transformFn:es,paths:[{path:`entity.media.main.image`},{path:`entity.media.itemsInfo.items.image`},{path:`entity.options.choicesSettings.choices.image`},{path:`entity.options.choicesSettings.choices.displayImage`},{path:`entity.options.choicesSettings.choices.linkedMedia.image`},{path:`entity.modifiers.choicesSettings.choices.image`},{path:`entity.modifiers.choicesSettings.choices.displayImage`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`entity.variantsInfo.variants.media.image`},{path:`entity.variantSummary.minPriceVariant.media.image`},{path:`modifiedFields.media.main.image`},{path:`modifiedFields.media.itemsInfo.items.image`},{path:`modifiedFields.options.choicesSettings.choices.image`},{path:`modifiedFields.options.choicesSettings.choices.displayImage`},{path:`modifiedFields.options.choicesSettings.choices.linkedMedia.image`},{path:`modifiedFields.modifiers.choicesSettings.choices.image`},{path:`modifiedFields.modifiers.choicesSettings.choices.displayImage`},{path:`modifiedFields.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`modifiedFields.variantsInfo.variants.media.image`},{path:`modifiedFields.variantSummary.minPriceVariant.media.image`}]},{transformFn:Xs,paths:[{path:`entity.media.main.video`},{path:`entity.media.itemsInfo.items.video`},{path:`entity.options.choicesSettings.choices.linkedMedia.video`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`entity.variantsInfo.variants.media.video`},{path:`entity.variantSummary.minPriceVariant.media.video`},{path:`modifiedFields.media.main.video`},{path:`modifiedFields.media.itemsInfo.items.video`},{path:`modifiedFields.options.choicesSettings.choices.linkedMedia.video`},{path:`modifiedFields.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`modifiedFields.variantsInfo.variants.media.video`},{path:`modifiedFields.variantSummary.minPriceVariant.media.video`}]}])))(),Cc=zt(yc);I(bc),I(xc),I(Sc);function wc(e){return Ec(e)??99999}function Tc(e,t){return Math.min(e,Math.max(t,1))}function Ec(e){if(!e||!e.trackQuantity)return;let{availabilityStatus:t,inventoryQuantity:n,preorderInfo:r}=e,i=t===`PREORDER`?r?.quantity:n;if(i!=null)return Math.max(0,i)}function Dc(e){let{availabilityStatus:t,preorderAvailability:n}=e??{},r=t!==hc.OUT_OF_STOCK;return{isInStock:r,isPreOrderState:n===gc.ALL_VARIANTS||n===gc.SOME_VARIANTS&&!r}}function Oc(e,t){return t?{isInStock:t.availabilityStatus===X.IN_STOCK,isPreOrderState:t.availabilityStatus===X.PREORDER}:Dc(e.inventory)}function kc(e,t){return n(()=>{let{isInStock:n,isPreOrderState:r}=Oc(e,t);return{isInStock:n,isPreOrderState:r,preOrderMessage:r?t?.preorderInfo?.message:void 0,remainingItemCount:Ec(t)}},[e.inventory,t])}function Ac(e){return{type:`image`,src:e.url,width:e.width,height:e.height,...e.name===void 0?{}:{title:e.name},...e.alt===void 0?{}:{parameters:{alt:e.alt}}}}var jc=`11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png`,Mc={uri:jc,url:`https://static.wixstatic.com/media/${jc}`,width:460,height:460},Nc=[Ac(Mc)];function Pc(e,t,n){let r=Lc(e,Fc(e,t,n));return r.length>0?r:e.media??[]}function Fc(e,t,n){let r=e.options.flatMap(e=>Ic(e.choices,t[e.id])),i=Object.values(e.modifiers).flatMap(e=>Ic(e.choices,n[e.id]));return[...new Set([...r,...i])]}function Ic(e,t){return e?.find(e=>e.choiceId===t)?.mediaIds??[]}function Lc(e,t){let n=new Map((e.media??[]).map(e=>[e.id,e]));return t.flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function Rc(e){return e.map(e=>e.id).join(`|`)}function zc(e){return e.length>0?e.map(e=>e.media):Nc}function Bc({product:e,selectedOptions:i,selectedModifiers:a}){let o=n(()=>zc(e.media??[]),[e.media]),s=e.mainMedia??Mc,c=n(()=>Pc(e,i,a),[e,i,a]),l=n(()=>zc(c),[c]),u=Rc(c),[d,f]=r(u),[p,m]=r(0);d!==u&&(f(u),m(0));let h=t(e=>m(e),[]);return n(()=>({allMedia:o,mainMedia:s,media:l,selectedMediaIndex:p,selectMedia:h}),[o,s,l,p,h])}function Vc(e){return Object.entries(e).map(([e,t])=>({optionId:e,choiceId:t}))}function Hc(e){return Object.entries(e).map(([e,t])=>({modifierId:e,value:t}))}function Uc(e,t,r,i=!1){let{selectedVariant:a}=t,o=Ys(e,a),s=kc(e,a),c=Bc({product:e,selectedOptions:t.selectedOptions,selectedModifiers:t.selectedModifiers}),l=Js(e,a),{getPageAbsoluteUrl:u}=ni(),d=n(()=>{if(!e.slug)return;let t=u(U.PRODUCT_PAGE,e.slug);return t?{href:t}:void 0},[e.slug,u]);return n(()=>{let{selectedVariant:e,setHasAttemptedSubmit:n,isSelectionValid:a,selectedOptions:u,selectedModifiers:f,selectedSubscriptionPlanId:p,quantity:m,productGrouping:h,...g}=t;return{...o,link:d,...r,...g,buyerSelections:{options:Vc(u),modifiers:Hc(f),subscriptionPlanId:p,quantity:m},...s,...c,...l,isBackInStockEnabled:i}},[o,d,r,t,s,c,l,i])}var Wc=`one-time`,Gc=H(`@wix/site-service-locale`),Kc=H,qc=Kc(`@wix/viewer-service-multilingual`);function Jc(){let e=c(),t=l(Gc),n;try{n=e(qc)}catch{}return n?.multilingualEnabled&&n.currentLocale?.regionalFormat||t.locale}var Yc=e=>{let t=e?.maximumFractionDigits??2;return(e=>e?.toFixed(t))},Xc=(e,t,n)=>{let r=new Intl.NumberFormat(t,{style:`currency`,currency:e,...n});return(e=>{if(e!=null)return r.format(e)})};function Zc(e,t,n){return e?Xc(e,t,n):Yc(n)}function Qc(e,t){let r=Jc();return n(()=>Zc(e,r,t),[e,r,t])}function Z(e,t){return e===void 0?void 0:{amount:e,formattedAmount:t(e)}}function $c(e,t,n){return{id:e.id,name:e.name,isOneTimePurchase:!1,description:e.description,currentPrice:Z(t.currentSellingPrice,n),originalPrice:Z(t.priceBeforeDiscount,n),frequency:e.frequency,interval:e.interval,duration:e.billingCycles}}function el(e){return e===void 0?void 0:{description:e.description}}function tl(e,t){return{currentSellingPrice:Z(e.currentSellingPrice,t),priceBeforeDiscount:Z(e.priceBeforeDiscount,t),pricePerUnit:el(e.pricePerUnit)}}function nl(e,t){return{minCurrentSellingPrice:Z(e.minCurrentSellingPrice,t),maxCurrentSellingPrice:Z(e.maxCurrentSellingPrice,t),minPriceBeforeDiscount:Z(e.minPriceBeforeDiscount,t),maxPriceBeforeDiscount:Z(e.maxPriceBeforeDiscount,t),minPricePerUnit:el(e.minPricePerUnit),maxPricePerUnit:el(e.maxPricePerUnit)}}function rl(e,t,n,r){if(e.length===0)return[];let i=e.map(({subscription:e,price:t})=>$c(e,t,r));return t?[{id:Wc,name:`One-time purchase`,isOneTimePurchase:!0,currentPrice:Z(n.currentSellingPrice,r)},...i]:i}function il({product:e,userInputs:t,hasLoadedVariants:r}){let{selectedVariant:i,selectedSubscriptionPlanId:a}=t,o=Qc(e.currency);return n(()=>{let t=wo(e,i,r),n={...tl(To(t,a),o),...nl(t.productPriceRange,o)},s=rl(t.subscriptionPlanPrices,e.subscriptionDetails.allowOneTimePurchases,t.productPrice,o);return{currency:e.currency,pricing:n,subscriptionPlans:s}},[e,i,a,r,o])}var al=function(e){return e.PRODUCT_BY_SLUG=`product-by-slug`,e.PRODUCT_BY_ID=`product-by-id`,e.PRODUCT_ITEM=`product-item`,e}({});function ol(e){let{isInStock:t,isPreOrderState:n}=Dc(e);return n?X.PREORDER:t?X.IN_STOCK:X.OUT_OF_STOCK}function sl(e){let{minPriceVariant:t}=e,n=e.options.length===0||e.options.length===1&&e.options[0].choices.length===1;return!t||!n?{variants:[],inventoryItems:[]}:{variants:[t],inventoryItems:[{variantId:t.id,availabilityStatus:ol(e.inventory),trackQuantity:!1}]}}var cl=e=>Number.parseFloat(e?.amount),ll=e=>e?.amount==null?void 0:cl(e);function ul(e){return e.filter(e=>e.visible!==!1).map(dl)}var dl=e=>{let t=Object.fromEntries((e.choices??[]).map(e=>{let t=e.optionChoiceIds;return[t?.optionId,t?.choiceId]}));return{id:e._id,sku:e.sku??void 0,choices:t,price:pl(e),subscriptionPrices:ml(e)}};function fl(e){return e?.description==null?void 0:{description:e.description}}var pl=e=>{let t=e.price;return{actualPrice:cl(t?.actualPrice),compareAtPrice:ll(t?.compareAtPrice),priceAfterDiscount:ll(t?.priceAfterDiscount),pricePerUnit:fl(e.physicalProperties?.pricePerUnit)}},ml=e=>(e.subscriptionPricesInfo?.subscriptionPrices??[]).map(e=>({subscriptionId:e.subscriptionId,price:cl(e.price)}));function hl(e){return e.map(e=>({variantId:e.variantId??``,availabilityStatus:e.availabilityStatus,quantity:e.quantity??void 0,trackQuantity:e.trackQuantity??!1,preorderInfo:e.preorderInfo?{message:e.preorderInfo.message??void 0,quantity:e.preorderInfo.quantity??void 0}:void 0}))}async function gl(e,t){return hl((await uc().eq(`productId`,e).eq(`locationId`,t).find()).items??[])}var _l=[_c.SUBSCRIPTION_PRICES_INFO,_c.DISCOUNT_INFO];async function vl(e,t){let[n,r]=await Promise.all([Cc(e,{fields:_l}),gl(e,t)]);return{variants:ul(n.variantsInfo?.variants??[]),inventoryItems:r}}function yl(e,n){let[i,a]=r(!1),{data:o,isFetching:s}=Zr({queryKey:[`product-variants`,e,n],queryFn:()=>vl(e,n),enabled:i,staleTime:1/0,retry:!1});return{variantsData:o,isLoadingVariants:s,requestVariants:t(()=>{a(!0)},[])}}function bl(e,t,r){let{variantsData:i,isLoadingVariants:a,requestVariants:o}=yl(e.id,t),{variants:s,inventoryItems:c}=n(()=>i??sl(e),[i,e]);return{product:n(()=>({...e,variants:s}),[e,s]),inventoryItems:c,productGroupData:r,hasLoadedVariants:n(()=>i!==void 0,[i]),isLoadingVariants:a,requestVariants:o}}var xl={type:`invalid-purchase`,message:`This item can't be purchased.`};function Sl(e){let t=e;return{type:`cart`,message:t?.message,details:t?.details}}var Cl=H(`@wix/site-service-lightbox`),wl=H(`@wix/site-service-router`),Tl=H(`@wix/site-service-editor-context`),El=H(`@wix/site-service-pages`),Dl=e=>{if(!e)return``;let t=new URLSearchParams(e).toString();return t?`?${t}`:``},Ol=(e,t,n)=>{let r=`./${e.replace(/^\//,``)}`;return n?r:new URL(r,`${t.replace(/\/$/,``)}/`).href},kl=()=>{let{navigateTo:e}=l(wl),{open:n}=l(Cl),r=l(Qr),i=l(Tl),a=l(El),{getPageRelativeUrl:o,getPageAbsoluteUrl:s}=ni();return{navigateToPage:t(async(t,n)=>{try{let a=r.appSectionRelativeUrl(ei,t);if(!a)return!1;let o=`${a}${Dl(n)}`;return await e({href:Ol(o,r.siteUrl,i.previewMode)}),!0}catch{return!1}},[e,r,i]),navigateToProductPage:t(async t=>{try{let n=i.previewMode?o(U.PRODUCT_PAGE,t):s(U.PRODUCT_PAGE,t);if(!n)throw Error(`Failed to resolve app section relative URL for the product page`);await e({href:n})}catch(e){console.error(`navigateToProductPage: failed to navigate to product "${t}"`,e)}},[e,i,o,s]),openLightbox:t(async e=>{try{let t=ti[e],r=Object.entries(a.pages).find(([,n])=>n.popup&&(n.appPageId===e||n.appPageId===t))?.[0];return r?(await n({pageId:r}),!0):!1}catch{return!1}},[n,a])}};async function Al(e){await Fs({catalogItems:[e]})}var jl=Kc(`@wix/site-service-public-api-caller`),Ml=()=>{let e=c();return{reloadCart:t(async()=>{if(typeof window<`u`)try{await e(jl).callPublicApi(ei,`cart.reloadCart`,[])}catch{}},[e])}},Nl=function(e){return e.IDLE=`idle`,e.IN_PROGRESS=`in-progress`,e.SUCCESS=`success`,e}({}),Pl=function(e){return e.NONE=`none`,e.NAVIGATE_TO_CART=`navigate-to-cart`,e.OPEN_SIDE_CART=`open-side-cart`,e}({}),Fl=()=>{let[e,n]=r(Nl.IDLE),{navigateToPage:i,openLightbox:a}=kl(),{reloadCart:o}=Ml(),s=t(async e=>{switch(e){case Pl.NAVIGATE_TO_CART:await i(U.CART);return;case Pl.OPEN_SIDE_CART:await a(U.SIDE_CART);return;case Pl.NONE:default:return}},[i,a]);return{addToCart:t(async(e,t)=>{n(Nl.IN_PROGRESS);try{await Al(e)}catch(e){return n(Nl.IDLE),{ok:!1,error:Sl(e)}}try{await o(),n(Nl.SUCCESS),await s(t),setTimeout(()=>n(Nl.IDLE),2e3)}catch{n(Nl.IDLE)}return{ok:!0}},[o,s]),addToCartState:e,reloadCart:o}};async function Il(e){let t=await ks({cart:{source:{channelType:Es.WEB}},catalogItems:[e]});if(!t._id)throw Error(`missing checkout id`);return t._id}var Ll=function(e){return e.IDLE=`idle`,e.IN_PROGRESS=`in-progress`,e}({}),Rl=()=>{let{navigateToPage:e}=kl(),[n,i]=r(Ll.IDLE);return{buyNowState:n,buyNow:t(async t=>{i(Ll.IN_PROGRESS);try{let n=await Il(t);return await e(U.CHECKOUT,{checkoutId:n})?{ok:!0}:{ok:!1,error:Sl(Error(`Failed to navigate to checkout`))}}catch(e){return{ok:!1,error:Sl(e)}}finally{i(Ll.IDLE)}},[e])}};function zl(e){let{product:t,selectedVariant:n,userSelections:r,isPreOrder:i}=e;return{catalogReference:{appId:$r,catalogItemId:t.id,options:Bl({product:t,selectedVariant:n,userSelections:r,isPreOrder:i})},quantity:r.quantity}}var Bl=({product:e,selectedVariant:t,userSelections:n,isPreOrder:r})=>{let i=Vl(e,t.choices),{choiceBasedModifiers:a,customTextFields:o}=Hl(e,n.selectedModifiers),s={...i,...a},{selectedSubscriptionPlanId:c}=n,l={variantId:t.id,options:s};return Object.keys(o).length>0&&(l.customTextFields=o),Ul(c)&&(l.subscriptionOptionId=c),r&&(l.preOrderRequested=!0),l},Vl=(e,t)=>{let n={};for(let[r,i]of Object.entries(t)){let t=e.options.find(e=>e.id===r),a=t?.choices.find(e=>e.choiceId===i);t&&a&&(n[t.key]=a.key)}return n},Hl=(e,t)=>{let n={},r={};for(let i of Object.values(e.modifiers))if(i.modifierRenderType===mc.FREE_TEXT){let e=i.freeTextSettings?.key;e&&(r[e]=t[i.id]??``)}else{let e=t[i.id],r=i.choices?.find(t=>t.choiceId===e);r&&(n[i.key]=r.key)}return{choiceBasedModifiers:n,customTextFields:r}},Ul=e=>e!==void 0&&e!==`one-time`;function Wl(e,r,i){let{selectedVariant:a,selectedModifiers:o,selectedSubscriptionPlanId:s,quantity:c,isSelectionValid:l,setHasAttemptedSubmit:u}=r,{addToCart:d,addToCartState:f}=Fl(),{buyNow:p,buyNowState:m}=Rl(),h=i.isPreOrderState||i.isInStock,g=t(async t=>!h||(u(!0),!l||!a)?{ok:!1,error:xl}:d(zl({product:e,selectedVariant:a,userSelections:{selectedModifiers:o,selectedSubscriptionPlanId:s,quantity:c},isPreOrder:i.isPreOrderState}),t??Pl.NONE),[h,i.isPreOrderState,l,u,e,a,o,s,c,d]),_=t(async()=>!h||(u(!0),!l||!a)?{ok:!1,error:xl}:p(zl({product:e,selectedVariant:a,userSelections:{selectedModifiers:o,selectedSubscriptionPlanId:s,quantity:c},isPreOrder:i.isPreOrderState})),[h,i.isPreOrderState,l,u,e,a,o,s,c,p]);return n(()=>({addToCartState:f,buyNowState:m,handleAddToCart:g,handleBuyNow:_}),[f,m,g,_])}var Gl=(e,t)=>e.every(e=>!e.mandatory||Kl(e,t[e.id])),Kl=(e,t)=>e.modifierRenderType===mc.FREE_TEXT?!!t:e.choices?.some(e=>e.choiceId===t),Q=function(e){return e.DIRECT_ADD=`direct-add`,e.NAVIGATE_TO_PRODUCT_PAGE=`navigate-to-product-page`,e}({});function ql(e,t){return Jl(e,t)?Q.NAVIGATE_TO_PRODUCT_PAGE:Q.DIRECT_ADD}var Jl=(e,t)=>e.subscriptionDetails.subscriptions.length>0||!Yl(e,t),Yl=(e,t)=>e.options.length===0&&Object.keys(e.modifiers).length===0||t.selectedVariant!==null&&Gl(Object.values(t.modifiers),t.selectedModifiers);function Xl(e,r){let{navigateToProductPage:i}=kl(),{addToCartState:a,buyNowState:o,handleAddToCart:s,handleBuyNow:c}=Wl(e,r,kc(e,r.selectedVariant)),l=ql(e,r),u=t(async()=>e.slug?(await i(e.slug),{ok:!0}):{ok:!1,error:xl},[e.slug,i]),d=t(e=>{switch(l){case Q.DIRECT_ADD:return s(e);case Q.NAVIGATE_TO_PRODUCT_PAGE:return u()}},[l,s,u]),f=t(()=>{switch(l){case Q.DIRECT_ADD:return c();case Q.NAVIGATE_TO_PRODUCT_PAGE:return u()}},[l,c,u]);return n(()=>({addToCartState:a,buyNowState:o,handleAddToCart:d,handleBuyNow:f}),[a,o,d,f])}function Zl(e){return Object.values(e).toSorted().join(`_`)}function Ql(e){let t=new Map;for(let n of e)t.set(Zl(n.choices),n);return t}function $l(e,t,n){let r=Object.keys(n).length>0,i={};for(let a of e){i[a.id]={};for(let e of a.choices){if(!r){i[a.id][e.choiceId]={isInStock:e.inStock??!0,isVisible:e.visible??!0};continue}if(e.inStock===!1&&e.visible===!1){i[a.id][e.choiceId]={isInStock:!1,isVisible:!1};continue}let{isInStock:o,isVisible:s}=eu({...n,[a.id]:e.choiceId},t);i[a.id][e.choiceId]={isInStock:o,isVisible:s}}}return i}function eu(e,t){let n=!1,r=!1;for(let i of t.values())if(Object.entries(e).every(([e,t])=>i.choices[e]===t)&&(r=!0,(i.availabilityStatus===X.IN_STOCK||i.availabilityStatus===X.PREORDER)&&(n=!0),n))break;return{isInStock:n,isVisible:r}}function tu(e,t){let n=new Map;for(let e of t)n.set(e.variantId,e);return e.map(e=>{let t=n.get(e.id);return{...e,availabilityStatus:t?.availabilityStatus,preorderInfo:t?.preorderInfo,inventoryQuantity:t?.quantity,trackQuantity:t?.trackQuantity}})}function nu({product:e,selections:t,selectedVariant:n}){let r={options:ru(e.options,t.selectedOptions,n),modifiers:au(e.modifiers,t.selectedModifiers),quantity:iu(t.quantity,n),subscriptionPlanId:ou(e.subscriptionDetails,t.selectedSubscriptionPlanId)};return{valid:Object.values(r.options).length===0&&Object.values(r.modifiers).length===0&&!r.quantity&&!r.subscriptionPlanId,fields:r}}function ru(e,t,n){if(n!==null)return{};let r={};for(let n of e)t[n.id]||(r[n.id]=`missing`);return r}function iu(e,t){if(e<1)return`below-min`;if(e>wc(t))return`above-max`}function au(e,t){let n=Object.values(e).filter(e=>e.mandatory&&!Kl(e,t[e.id]));return Object.fromEntries(n.map(e=>[e.id,`missing`]))}function ou(e,t){if(e.subscriptions.length!==0)return t?t===`one-time`?e.allowOneTimePurchases?void 0:`missing`:su(e,t)?void 0:`missing`:`missing`}function su(e,t){return e.subscriptions.some(e=>e.id===t)}var $=function(e){return e.PRODUCT_OPTION=`PRODUCT_OPTION`,e.MODIFIER=`MODIFIER`,e}({});function cu(e,t){if(!t)return;let n=t.members.find(t=>t.productId===e.id);if(!n)return;let r={groupingCustomizationId:t.groupingCustomizationId,currentProductChoiceId:n.choice.choiceId,members:t.members};if(t.customizationType===$.PRODUCT_OPTION)return e.options.find(({id:e})=>e===t.groupingCustomizationId)?{...r,customizationType:$.PRODUCT_OPTION}:void 0;if(e.modifiers[t.groupingCustomizationId])return{...r,customizationType:$.MODIFIER}}function lu(e,t){return e.members.find(e=>e.choice.choiceId===t)}function uu(e,t,n){return!!e&&t===e.groupingCustomizationId&&n!==e.currentProductChoiceId}function du(e,t){if(!t)return;if(t.customizationType===$.PRODUCT_OPTION){let n=e.options.find(({id:e})=>e===t.groupingCustomizationId);if(!n)return;let r=fu(n,t);return{options:e.options.map(e=>e.id===n.id?r:e)}}let n=e.modifiers[t.groupingCustomizationId];if(!n)return;let r=pu(n,t);return{modifiers:{...e.modifiers,[t.groupingCustomizationId]:r}}}function fu(e,t){return{...e,isGroupedOption:!0,choices:t.members.map(e=>({...e.choice,inStock:e.inventoryAvailabilityStatus!==`OUT_OF_STOCK`}))}}function pu(e,t){return{...e,choices:t.members.map(({choice:e})=>e)}}function mu(e,t){if(!t||t.customizationType!==$.PRODUCT_OPTION)return e;let n=Object.fromEntries(t.members.map(e=>[e.choice.choiceId,{isInStock:e.inventoryAvailabilityStatus!==`OUT_OF_STOCK`,isVisible:!0}]));return{...e,[t.groupingCustomizationId]:{...n,...e[t.groupingCustomizationId]}}}function hu(e,r){let i=n(()=>cu(e,r?.productGroup),[e,r?.productGroup]);return{productGrouping:i,selectGroupSiblingChoice:t(e=>{if(!i||e===i.currentProductChoiceId)return;let t=lu(i,e);t&&r?.selectProductGroupMember(t.productId)},[i,r?.selectProductGroupMember]),productCustomizations:n(()=>du(e,i),[e,i]),addGroupChoicesAvailability:t(e=>mu(e,i),[i]),initialSelection:n(()=>{if(!i)return{options:{},modifiers:{}};let{customizationType:t,groupingCustomizationId:n,currentProductChoiceId:r}=i;if(t===$.MODIFIER&&e.modifiers[n].mandatory===!1)return{options:{},modifiers:{}};let a={[n]:r};return t===$.PRODUCT_OPTION?{options:a,modifiers:{}}:{options:{},modifiers:a}},[i,e.modifiers])}}function gu({product:e,inventoryItems:i,productGroupData:a,hasLoadedVariants:o=!0}){let s=hu(e,a),{productGrouping:c,selectGroupSiblingChoice:l,addGroupChoicesAvailability:u}=s,[d,f]=r(()=>s.initialSelection.options),[p,m]=r(()=>s.initialSelection.modifiers),[h,g]=r(void 0),[_,v]=r(1),[y,b]=r(!1),x=n(()=>Ql(tu(e.variants,i)),[e.variants,i]),S=n(()=>{let t=new Map;return n=>{let r=Zl(n),i=t.get(r);if(i)return i;let a=u($l(e.options,x,n));return t.set(r,a),a}},[x,e.options,u])(o?d:{}),C=n(()=>Object.keys(d).length===e.options.length?x.get(Zl(d))??null:null,[x,d,e.options.length]),w=t((e,t)=>{if(d[e]!==t){if(uu(c,e,t)){l(t);return}f(n=>({...n,[e]:t})),v(1)}},[d,c,l]),T=t((e,t)=>{if(uu(c,e,t)){l(t);return}m(n=>n[e]===t?n:{...n,[e]:t})},[c,l]),E=t(e=>{m(t=>{if(!(e in t))return t;let{[e]:n,...r}=t;return r})},[]),D=t(e=>{g(e)},[]),O=n(()=>wc(C),[C]),k=n(()=>Tc(_,O),[_,O]),ee=t(e=>{v(e)},[]),te=n(()=>nu({product:e,selections:{selectedOptions:d,selectedModifiers:p,selectedSubscriptionPlanId:h,quantity:k},selectedVariant:C}),[e,d,p,h,k,C]),ne=s.productCustomizations?.options??e.options,re=s.productCustomizations?.modifiers??e.modifiers;return n(()=>({options:ne,modifiers:re,quantity:k,selectedOptions:d,selectedModifiers:p,selectedSubscriptionPlanId:h,selectedVariant:C,selectedVariantId:C?.id??null,selectionsAvailability:S,maxPurchasableQuantity:O,isSelectionValid:te.valid,selectionValidationErrors:te.fields,hasAttemptedSubmit:y,setHasAttemptedSubmit:b,selectOption:w,selectModifier:T,clearModifierSelection:E,selectSubscriptionPlan:D,selectQuantity:ee,productGrouping:c}),[ne,re,k,d,p,h,C,S,O,te,y,w,T,E,D,ee,c])}function _u({product:e,inventoryItems:r,productGroupData:i,hasLoadedVariants:a,requestVariants:o}){let s=gu({product:e,inventoryItems:r,productGroupData:i,hasLoadedVariants:a}),{selectOption:c,selectModifier:l,selectSubscriptionPlan:u,selectQuantity:d,productGrouping:f,...p}=s,m=t((e,t)=>{uu(f,e,t)||o(),c(e,t)},[o,c,f]),h=t((e,t)=>{uu(f,e,t)||o(),l(e,t)},[o,l,f]),g=t(e=>{o(),d(e)},[o,d]);return n(()=>({...p,productGrouping:f,selectOption:m,selectModifier:h,selectSubscriptionPlan:u,selectQuantity:g}),[s,m,h,u,g])}var vu={subscriptionPlans:null,description:null,infoSections:null};function yu(){return s()}function bu({product:e,defaultLocationId:t,productGroupData:r}){let i=bl(e,t,r),a=_u(i),o=Xl(i.product,a),s=il({product:i.product,userInputs:a,hasLoadedVariants:i.hasLoadedVariants}),c=Uc(i.product,a,s);return n(()=>({source:al.PRODUCT_ITEM,...c,...o,...vu}),[c,o])}function xu({productItem:e,children:t}){let n=bu(e);return a(o,{value:n,children:t})}function Su({productItem:e,children:t}){let[n]=r(()=>new Pr);return e===void 0?a(i,{children:t}):a(Lr,{client:n,children:a(xu,{productItem:e,children:t},e.product.id)})}var Cu=jn(`890cc5ff-b951-47bc-86ed-4dc139f4ff0d`);export{Su as ProductItemContextProvider,Su as default,Cu as injectAccessTokenGetter,yu as useProductItemContext,bu as useProductItemContextValue};
2
- //# sourceMappingURL=context-provider-890cc5ff-b951-47bc-86ed-4dc139f4ff0d-yeO5crVP.js.map
1
+ import*as e from"react";import{useCallback as t,useMemo as n,useState as r}from"react";import{Fragment as i,jsx as a}from"react/jsx-runtime";import o,{useProductContext as s}from"@wix/stores/product-context-provider";import{useGetService as c,useService as l}from"@wix/services-manager-react";var u=Object.create,d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,m=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,g=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=p(t),a=0,o=i.length,s;a<o;a++)s=i[a],!h.call(e,s)&&s!==n&&d(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=f(t,s))||r.enumerable});return e},v=(e,t,n)=>(n=e==null?{}:u(m(e)),_(t||!e||!e.__esModule||!h.call(e,`default`)?d(n,`default`,{value:e,enumerable:!0}):n,e)),y={};function b(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var x=e=>{switch(e){case`get`:case`GET`:return`GET`;case`post`:case`POST`:return`POST`;case`put`:case`PUT`:return`PUT`;case`delete`:case`DELETE`:return`DELETE`;case`patch`:case`PATCH`:return`PATCH`;case`head`:case`HEAD`:return`HEAD`;case`options`:case`OPTIONS`:return`OPTIONS`;default:throw Error(`Unknown method: ${e}`)}},S=e=>t=>async n=>{let r,i=t=>{if(r=e(n)(t),r.url===void 0)throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);let{method:i,url:a,params:o}=r;return{...r,method:x(i),url:a,data:r.data,params:o}};try{let e=await t.request(i);if(r===void 0)throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);let n=Array.isArray(r.transformResponse)?r.transformResponse:[r.transformResponse],a=e.data;return n.forEach(t=>{t&&(a=t(e.data,e.headers))}),a}catch(e){throw typeof e==`object`&&e&&`response`in e&&typeof e.response==`object`&&e.response!==null&&`data`in e.response?e.response.data:e}},C=e=>e.__isAmbassador?!0:!!e().__isAmbassador,w=`__metadata`,T=`edge.wixapis.com`,E=class extends Error{message;response;constructor(e,t){super(e),this.message=e,this.response=t}async details(){let e=await this.response.json();return D(this.response.status,e?.message,e?.details,{requestId:this.response.headers.get(`X-Wix-Request-Id`),details:e})}},D=(e,t,n,r)=>({details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t,requestId:r?.requestId}),O=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},k=e=>e&&typeof e==`object`&&!Array.isArray(e),ee=e=>e.__type===`host`;function te(e,t){return e.create(t)}var ne=`x-wix-bi-gateway`;function re(e,t,n){return{[ne]:ie({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function ie(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function ae(e){let t=globalThis.__wix_context__,n={client:y.client,elevatedClient:y.elevatedClient},r;globalThis.__wix_context__=void 0,y.client=void 0,y.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,y.client=n.client,y.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var oe={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function se(e){return fe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ce=/([\p{Ll}\d])(\p{Lu})/gu,le=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ue=`$1\0$2`,de=/[^\p{L}\d]+/giu;function fe(e){let t=e.trim();t=t.replace(ce,ue).replace(le,ue),t=t.replace(de,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var pe=e=>`validationError`in(e.response?.data?.details??{}),me=e=>`applicationError`in(e.response?.data?.details??{}),he=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function ge(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(pe(e))return _e(e,t,n);if(me(e))return ye(e);if(he(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:se(n),data:{}},requestId:e.requestId};return ve(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return be(e)}var _e=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=xe(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return ve(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},ve=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),ye=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??se(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return ve(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},be=e=>ve(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:se(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),xe=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Se(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Se(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Se=(e,t)=>{let n=Ce(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ce=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function we(e,t,n,r,i,a,o,s,c,l,u){return ae(()=>e({request:async e=>{let i=e({host:s?.HTTPHost||`www.wixapis.com`}),a=i;a.method===`GET`&&a.fallback?.length&&(a.params?.toString().length??0)>4e3&&(a=i.fallback[0]);let o=s?.HTTPHost??`www.wixapis.com`,u=`https://${l?T:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=re(i,t,c),o={method:a.method,...a.data&&{body:JSON.stringify(a.data)},headers:{...e}},s=await n(u,o);if(s.status!==200){let e=null;try{e=await s.json()}catch{}let t=Ee(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=ge(t);throw r?.handleError(n,{requestOptions:{url:a.url,method:a.method,entityFqdn:i.entityFqdn,methodFqn:i.methodFqn}}),t}let l=await s.json();return{data:a.migrationOptions?.optInTransformResponse&&a.transformResponse?Array.isArray(a.transformResponse)?a.transformResponse[0](l):a.transformResponse(l):l,headers:s.headers,status:s.status,statusText:s.statusText}}catch(e){throw e.message?.includes(`fetch is not defined`)&&console.error(`Node.js v18+ is required`),e}},fetchWithAuth:n,wixAPIFetch:i,getActiveToken:a,getAuthHeaders:o},{validateRequestSchema:u}))}var Te=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Ee=(e,t,n,r)=>new Te({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),De=`.`;function Oe(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=ke(t),i=e;for(let e=0;e<r.length;e++){let t=r[e];if(e===r.length-1){i[t]=n;break}let a=r[e+1];(!(t in i)||i[t]==null||typeof i[t]!=`object`||i[t]===null)&&(i[t]=typeof a==`number`?[]:{}),i=i[t]}return e}function ke(e){return Array.isArray(e)?e:e.split(De).map(e=>Ae(e)?Number(e):e)}function Ae(e){return/^\d+$/.test(e)}function je(e){let t={};for(let[n,r]of Object.entries(e))Me(n)||Oe(t,ke(n),r);return t}function Me(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Ne=class{BRACKET_PATTERN=/\[(\d+)\]/g;NUMERIC_PATTERN=/^\d+$/;ESCAPED_DOT_PATTERN=/\\\./g;ESCAPED_LEFT_BRACKET_PATTERN=/\\\[/g;ESCAPED_RIGHT_BRACKET_PATTERN=/\\\]/g;SPLIT_PATTERN=/\.|\[(\d+)\]/g;DOT_BEFORE_BRACKET_PATTERN=/\.\[/g;ESCAPED_DOT_PLACEHOLDER=`__DOT__`;ESCAPED_RIGHT_BRACKET_PLACEHOLDER=`__RB__`;ESCAPED_LEFT_BRACKET_PLACEHOLDER=`__LB__`;modifiedFields;cleanedModifiedFields;constructor(e){this.modifiedFields=e}replaceEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PATTERN,this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN,this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN,this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER)}restoreEscapedCharacters(e){return e.replace(this.ESCAPED_DOT_PLACEHOLDER,`\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER,`\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER,`\\[`)}unflatten(){return this.cleanedModifiedFields=Object.fromEntries(Object.entries(this.modifiedFields).map(([e,t])=>[this.replaceEscapedCharacters(this.bracketToDotNotation(e)),t])),je(this.cleanedModifiedFields)}flatten(e){let t={};for(let n of Object.keys(this.cleanedModifiedFields)){let r=this.splitPath(n),i=this.navigatePath(e,r);t={...t,...i}}return Object.fromEntries(Object.entries(t).map(([e,t])=>[this.restoreEscapedCharacters(e),t]))}splitPath(e){let t=[],n=0,r=Array.from(e.matchAll(this.SPLIT_PATTERN));for(let i of r)i.index>n&&t.push(e.substring(n,i.index)),i[1]&&t.push(i[1]),n=i.index+i[0].length;return n<e.length&&t.push(e.substring(n)),t}navigatePath(e,t){let n=e,r=[],i=e=>{if(!Array.isArray(n))throw Error(`Expected array at path ${this.buildPathString(r)}, but got ${typeof n}`);r.push(`[${e}]`),n=n[parseInt(e,10)]},a=(e,t)=>{let i=e in oe?oe[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Le(e);if(a&&a in t){r.push(a),n=t[a];return}throw Error(`Cannot find key '${e}' or its transformations at path ${this.buildPathString(r)}`)},o=(e,t)=>{r.push(e),n=t[e]};for(let e of t){if(this.NUMERIC_PATTERN.test(e)){i(e);continue}if(typeof n!=`object`||!n)throw Error(`Cannot access property '${e}' on ${typeof n} at path ${this.buildPathString(r)}`);let t=n;if(e in n){o(e,t);continue}a(e,t)}return{[this.buildPathString(r)]:n}}buildPathString(e){return e.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN,`[`)}bracketToDotNotation(e){return e.replace(this.BRACKET_PATTERN,(t,n,r)=>r>0&&e[r-1]===`\\`?t:`.`+n)}};function Pe(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Fe(n);if(!r)return null;let{unflattenedModifiedFields:i,modifiedFieldsManipulator:a}=r;e={...e,modifiedFields:i};let o=t(e),s=o?.modifiedFields;if(!s)return null;let c=Ie(s,a);return c===null?null:(o.modifiedFields=c,o)}function Fe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Ne(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Ie(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Le(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function Re(){return{emit(e,...t){for(let n=0,r=this.events[e]||[],i=r.length;n<i;n++)r[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}}var ze=e=>e.__type===`event-definition`;function Be(e,t,n,r){let i;if(e.isDomainEvent){let{deletedEvent:e,actionEvent:t,createdEvent:a,updatedEvent:o,...s}=n,c={...r,...s};i=e?e?.deletedEntity?{entity:e?.deletedEntity,metadata:c}:{metadata:c}:t?{data:t.body,metadata:c}:o?{entity:o.currentEntity,metadata:c,...o.modifiedFields?{modifiedFields:o.modifiedFields}:{}}:{entity:a?.entity,metadata:c}}else i={data:n,metadata:r};let a=e.transformations??(e=>e),o=i,s=i;if(s.modifiedFields){let e=s.modifiedFields;if(typeof e==`object`&&e&&!Array.isArray(e)){o=structuredClone(i);let e=Pe(s,a);if(e)return t(e)}}return t(a(o))}function Ve(e){let t=new Map,n=Re();return{initModule(e){return r=>{let i=t.get(e.type)??[];i.push({eventDefinition:e,handler:r}),t.set(e.type,i),n.emit(`registered`,e)}},client:{...n,getRegisteredEvents:()=>t,async process(e,n={expectedEvents:[]}){let{eventType:r,identity:i,instanceId:a,payload:o,accountInfo:s}=await this.parseJWT(e),c=[...n.expectedEvents,...Array.from(t.keys()).map(e=>({type:e}))];if(c.length>0&&!c.some(({type:e})=>e===r))throw Error(`Unexpected event type: ${r}. Expected one of: ${c.map(e=>e.type).join(`, `)}`);let l=t.get(r)??[];return await Promise.all(l.map(({eventDefinition:e,handler:t})=>Be(e,t,o,{instanceId:a,identity:i,accountInfo:s}))),{instanceId:a,eventType:r,payload:o,identity:i,accountInfo:s}},async processRequest(e,t){let n=await e.text();return this.process(n,t)},async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`string`)throw Error(`Unexpected type of JWT data: expected string, got ${typeof r.data}`);let a=JSON.parse(r.data),o=a.eventType,s=a.accountInfo,c=a.instanceId,l=a.identity?JSON.parse(a.identity):void 0;return{instanceId:c,eventType:o,payload:JSON.parse(a.data),identity:l,accountInfo:s}},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async executeHandlers(e){let n=Array.from(t.keys()).map(e=>({type:e}));if(n.length>0&&!n.some(({type:t})=>t===e.eventType))throw Error(`Unexpected event type: ${e.eventType}. Expected one of: ${n.map(e=>e.type).join(`, `)}`);let r=t.get(e.eventType)??[];await Promise.all(r.map(({eventDefinition:t,handler:n})=>Be(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:b(`AppInstalled`)(),AppRemoved:b(`AppRemoved`)()}}}}var He=e=>e.__type===`service-plugin-definition`;function Ue(e){let t=new Map,n=Re();return{initModule(e){return r=>{let i=t.get(e.componentType.toLowerCase())??[];i.push({servicePluginDefinition:e,implementation:r}),t.set(e.componentType.toLowerCase(),i),n.emit(`registered`,e)}},client:{...n,getRegisteredServicePlugins:()=>t,async parseJWT(t){let n=e();if(!n.decodeJWT)throw Error(`decodeJWT is not supported by the authentication strategy`);let{decoded:r,valid:i}=await n.decodeJWT(t,!0);if(!i)throw Error(`JWT is not valid`);if(typeof r.data!=`object`||r.data===null||!(`metadata`in r.data)||typeof r.data.metadata!=`object`||r.data.metadata===null||!(`appExtensionType`in r.data.metadata)||typeof r.data.metadata.appExtensionType!=`string`)throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);return r.data},async process(e){let t=await this.parseJWT(e.body);return this.executeHandler(t,e.url)},async parseRequest(e){let t=await e.text();return this.parseJWT(t)},async processRequest(e){let t=await this.parseRequest(e);return this.processParsedRequest(t,e.url)},async processParsedRequest(e,t){try{let n=await this.executeHandler(e,t);return Response.json(n)}catch(e){if(e.errorType===`SPI`&&e.applicationCode&&e.httpCode)return Response.json({applicationError:{code:e.applicationCode,data:e.data}},{status:e.httpCode});throw e}},async executeHandler(e,n){let r=e.metadata.appExtensionType.toLowerCase(),i=t.get(r)??[];if(i.length===0)throw Error(`No service plugin implementations found for component type ${r}`);if(i.length>1)throw Error(`Multiple service plugin implementations found for component type ${r}. This is currently not supported`);let{implementation:a,servicePluginDefinition:o}=i[0],s=o.methods.find(e=>n.endsWith(e.primaryHttpMappingPath));if(!s)throw Error(`Unexpect request: request url did not match any method: `+n);let c=a[s.name];if(!c)throw Error(`Got request for service plugin method ${s.name} but no implementation was provided. Available methods: ${Object.keys(a).join(`, `)}`);return s.transformations.toREST(await c(s.transformations.fromREST(e)))}}}}var A=`X-Wix-Consistent`;function We(e){let t=e.headers||{Authorization:``},n={getAuthHeaders:e=>Promise.resolve({headers:{}})},r=e.auth,i=typeof r==`function`?r:()=>r??n,a=()=>i().getAuthHeaders(e.host),o=()=>e.fetch??fetch,s=async(n,r)=>{let i=o(),s=await a(),c={...r?.headers??{},...s.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[A]:t[A]}:{}},l=e.host?.getErrorHandler?.();try{if(typeof n==`string`||n instanceof URL){let e=await i(n,{...r,headers:c});l?.handleError(e,{requestOptions:{url:n.toString(),method:r?.method}});let a=Ge(e);return a&&(t[A]=a),e}{for(let[e,t]of Object.entries(c))typeof t==`string`&&n.headers.set(e,t);let e=await i(n,r);l?.handleError(e,{requestOptions:{url:n.url,method:r?.method}});let a=Ge(e);return a&&(t[A]=a),e}}catch(e){throw l?.handleError(e,{requestOptions:{url:typeof n==`string`||n instanceof URL?n.toString():n.url,method:r?.method}}),e}},{client:c,initModule:l}=Ue(i),{client:u,initModule:d}=Ve(i),f=async(n,r)=>{let i=o(),s=await a(),c=O(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[A]:t[A]}:{}}}),u=Ge(l);return u&&(t[A]=u),l},p=(t,n)=>{if(ze(t))return d(t);if(He(t))return l(t);if(ee(t)&&e.host)return te(t,e.host);if(typeof t==`function`){if(`__type`in t&&t.__type===`wix_spi_error`)return t;let r=e.host?.apiBaseUrl??`www.wixapis.com`,o=e.useCDN===void 0?i().shouldUseCDN:e.useCDN;return we(ae(()=>C(t))?S(t):t,n??{},f,e.host?.getErrorHandler?.(),(e,t)=>{let n=new URL(e,`https://${r}`);return n.host=r,n.protocol=`https`,f(n.toString(),t)},i().getActiveToken,async()=>a(),{HTTPHost:r},e.host?.name,o,e.validateRequestSchema)}return k(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[w])])):t},m=e=>{for(let n in e)t[n]=e[n]};return{...e.modules?p(e.modules):{},get auth(){let t=i();return t.getAuthHeaders=t.getAuthHeaders.bind(void 0,e.host),t},setHeaders:m,use:p,enableContext(e,t={elevated:!1}){e===`global`?globalThis.__wix_context__==null?t.elevated?globalThis.__wix_context__={elevatedClient:this}:globalThis.__wix_context__={client:this}:t.elevated?globalThis.__wix_context__.elevatedClient=this:globalThis.__wix_context__.client=this:t.elevated?y.elevatedClient=this:y.client=this},fetch:(t,n)=>{let r=e.host?.apiBaseUrl??`www.wixapis.com`,i=new URL(t,`https://${r}`);return i.host=r,i.protocol=`https`,f(i.toString(),n)},fetchWithAuth:s,async graphql(t,n,r={apiVersion:`alpha`}){let i=e?.host?.apiBaseUrl??`www.wixapis.com`,a=await f(`https://${i}/graphql/${r.apiVersion}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:t,variables:n})});if(a.status!==200)throw new E(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:u,servicePlugins:c}}function Ge(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var Ke=`wix:`,qe={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},Je={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`},Ye=`items`,Xe=`pagingMetadata`,Ze=qe;function Qe(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}function $e(e,{transformSystemFields:t=!0}={}){return t?Qe(e,Ze):e}var et=`sort.fieldName`;function tt(e,t,n){return(e===et||e.endsWith(`.${et}`))&&typeof t==`string`?Qe(t,n):t}function nt(e,t,n){let r=e=>n.includes(e),i=(e,n)=>{if(Array.isArray(e))e.forEach(e=>{i(e,n)});else if(typeof e==`object`&&e){let a=e;Object.keys(a).forEach(e=>{let o=n===``?e:`${n}.${e}`;if(r(o))return;let s=rt(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=tt(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function rt(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function it(e,t=[]){return nt(e,qe,t)}function j(e,t=[]){return nt(e,Je,t)}function at(e){return e?.toISOString()}function M(e){return e?new Date(e):void 0}var ot=new WeakMap;function st(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function ct(e,t){let n=e.get(t);return n||(n=st(),e.set(t,n)),n}function lt(e,t){return t===`*`?(e.anyField??=st(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,ct(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,ct(e.fields,t))}function ut(e){let t=st();for(let n of e){let e=n.path.split(`.`).reduce(lt,t);e.leaves??=[],e.leaves.push(n)}return t}function dt(e){let t=ot.get(e);return t||(t=ut(e),ot.set(e,t)),t}function ft(e){return typeof e==`object`&&!!e}function pt(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?ft(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function mt(e,t,n){ft(e)&&_t(e,t,n)}function ht(e,t,n){for(let[r,i]of t){if(!(r in e))continue;if(i.leaves)for(let t of i.leaves)e[r]=pt(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>mt(e,i,n)):mt(t,i,n)}}function gt(e,t,n){for(let[r,i]of t){let t=e[r];ft(t)&&Object.values(t).forEach(e=>mt(e,i,n))}}function _t(e,{fields:t,mapFields:n,anyField:r},i){t&&ht(e,t,i),n&&gt(e,n,i),r&&Object.values(e).forEach(e=>mt(e,r,i))}function N(e,t){if(!ft(e))return e;for(let{paths:n,transformFn:r}of t)_t(e,dt(n),r);return e}function vt(e,t){let{protocol:n}=new URL(e);return n===`${t}:`?`${Ke}${e}`:e}function yt(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function bt(e){return Tt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var xt=/([\p{Ll}\d])(\p{Lu})/gu,St=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Ct=`$1\0$2`,wt=/[^\p{L}\d]+/giu;function Tt(e){let t=e.trim();t=t.replace(xt,Ct).replace(St,Ct),t=t.replace(wt,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}var Et=e=>`validationError`in(e.response?.data?.details??{}),Dt=e=>`applicationError`in(e.response?.data?.details??{}),Ot=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function P(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(Et(e))return kt(e,t,n);if(Dt(e))return jt(e);if(Ot(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:bt(n),data:{}},requestId:e.requestId};return At(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return Mt(e)}var kt=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=Nt(t,a,n)?.sort((e,t)=>e.field<t.field?-1:1),s=`INVALID_ARGUMENT: ${o?.map(({field:e,description:t})=>`"${e}" ${t}`)?.join(`, `)}`,c={validationError:{fieldViolations:o},requestId:i};return At(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},At=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),jt=e=>{let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i=e.response?.data?.details?.applicationError?.description??n,a=e.response?.data?.details?.applicationError?.code??bt(n),o=e.response?.data?.details?.applicationError?.data??{},s=r===i?r:`${r}: ${i}`,c={applicationError:{description:i,code:a,data:o},requestId:e.requestId};return At(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},Mt=e=>At(e,{message:e.requestId?`System error occurred, request-id: ${e.requestId}`:`System error occurred: ${JSON.stringify(e)}`,extraProperties:{requestId:e.requestId,status:e.response?.status,code:bt(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),Nt=({spreadPathsToArguments:e,explicitPathsToArguments:t,singleArgumentUnchanged:n},r,i)=>{let a={...e,...t},o=Object.keys(a);return r?.filter(e=>!r.some(t=>t.field.length>e.field.length&&t.field.startsWith(e.field)&&o.includes(t.field))).map(e=>{let r=t[e.field];if(r)return{...e,field:Pt(r,i)};let s=o?.sort((e,t)=>t.length-e.length)?.find(t=>e.field.startsWith(t));if(s){let t=a[s];if(t)return{...e,field:e.field.replace(s,Pt(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},Pt=(e,t)=>{let n=Ft(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Ft=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function It(){let e=typeof $wixContext<`u`&&$wixContext.initWixModules?$wixContext.initWixModules:globalThis.__wix_context__!==void 0&&globalThis.__wix_context__.initWixModules?globalThis.__wix_context__.initWixModules:void 0;if(e)return{initWixModules(t,n){return Lt(()=>e(t,n))},fetchWithAuth(){throw Error(`fetchWithAuth is not available in this context`)},graphql(){throw Error(`graphql is not available in this context`)}};let t=typeof $wixContext<`u`?$wixContext.client:y.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:y.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:y.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:y.elevatedClient;if(t||n)return{initWixModules(e,r){if(r){if(!n)throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);return Lt(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return Lt(()=>t.use(e))},fetchWithAuth:(e,n)=>{if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.fetchWithAuth(e,n)},getAuth(){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.auth},async graphql(e,n,r){if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return t.graphql(e,n,r)}}}function Lt(e){let t=globalThis.__wix_context__,n={client:y.client,elevatedClient:y.elevatedClient},r;globalThis.__wix_context__=void 0,y.client=void 0,y.elevatedClient=void 0,typeof $wixContext<`u`&&(r={client:$wixContext?.client,elevatedClient:$wixContext?.elevatedClient},delete $wixContext.client,delete $wixContext.elevatedClient);try{return e()}finally{globalThis.__wix_context__=t,y.client=n.client,y.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function Rt(e,t){return((...n)=>{let r=It();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function zt(e){let t=((...t)=>{let n=It();return n?n.initWixModules(e).apply(void 0,t):()=>({slug:e.type})});return t.__type=e.__type,t.type=e.type,t.isDomainEvent=e.isDomainEvent,t.transformations=e.transformations,t}function Bt(e,t=!1){return Rt(e,t)}function Vt(e,t){let n=Ut(e),r=Object.entries(n).some(([e,t])=>e.includes(`.`)||Array.isArray(t)&&t.some(e=>typeof e==`object`));return t&&r?new URLSearchParams({".r":Gt(JSON.stringify(e))}):Object.entries(n).reduce((e,[t,n])=>((Array.isArray(n)?n:[n]).forEach(r=>{r==null||Array.isArray(n)&&typeof r==`object`||e.append(t,r)}),e),new URLSearchParams)}function Ht(e){let t=an(nn(e.host),e.domainToMappings);return mn(dn(e.protoPath,e.data||{}),t)}function Ut(e,t=``){let n={};return Object.entries(e).forEach(([e,r])=>{let i=typeof r==`object`&&!!r&&!Array.isArray(r),a=Wt(t,e);if(i){let e=Ut(r,a);Object.assign(n,e)}else n[a]=r}),n}function Wt(e,t){return`${e}${e?`.`:``}${t}`}var Gt=e=>{let t=new TextEncoder().encode(e);return(typeof btoa<`u`?btoa(String.fromCodePoint(...t)):Buffer.from(e,`utf-8`).toString(`base64`)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)},Kt=[`wix.com`,`editorx.com`],qt=`_`,Jt=`*.`,Yt=RegExp(`\\.(${Kt.join(`|`)})$`),Xt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Zt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Qt=`dev.wix-code.com`,$t=/{(.*)}/,en=RegExp(`\\.(${Xt.join(`|`)})$`),tn=RegExp(`.*\\.${Qt}$`);function nn(e){return rn(e).replace(Yt,`._base_domain_`).replace(en,`._api_base_domain_`).replace(tn,`*.dev.wix-code.com`)}function rn(e){return Zt[e]??e}function an(e,t){let n=t[e];if(n)return n;let r=on(e,t)??sn(e,t);if(!r){if(ln(e)){let e=t[un];if(e)return e}let n=t[qt];if(n)return n}return r??[]}function on(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function sn(e,t){let[n]=Object.entries(t).filter(([t])=>cn(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function cn(e,t){if(!t.startsWith(Jt))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function ln(e){return!!e.match(/\._base_domain_$/)}var un=`www._base_domain_`;function dn(e,t){return e.split(`/`).map(e=>fn(e,t)).join(`/`)}function fn(e,t){let n=e.match($t)||[],r=n[1];return r?pn(t,r,e,e.replace(n[0],``)):e}function pn(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function mn(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function F(e){return zt(e)}function hn(e){return isFinite(e)?e:e.toString()}function gn(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}function _n(e){return e&&yt({city:e.city,hint:e.hint,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,formattedAddress:e.formatted,geocode:e.location,addressLine:e.addressLine1,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine}})}function vn(e){return e&&yt({formatted:e.formattedAddress,location:e.geocode,addressLine1:e.addressLine,addressLine2:e.addressLine2,streetAddress:e.streetAddress&&{name:e.streetAddress.name,number:e.streetAddress.number,apt:e.streetAddress.apt,formattedAddressLine:e.streetAddress.formattedAddressLine},hint:e.hint,city:e.city,subdivision:e.subdivision,country:e.country,postalCode:e.postalCode,countryFullname:e.countryFullname,subdivisionFullname:e.subdivisionFullname})}var yn=`x-wix-linguist`,bn=`00000000-0000-0000-0000-000000000000`,xn=`false`,Sn=()=>{let e=Tn(`language`),t=Tn(`locale`);if(e)return{[yn]:[e,t||e,xn,bn].join(`|`)}};function Cn(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var wn=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,Tn=e=>wn()?.[e],En=({createHost:e})=>({__type:`host`,create:e=>({}),host:t=>{let{applicationId:n,componentId:r}=t??{},i=typeof window<`u`?window.wixEmbedsAPI:void 0,a=e(t),o=On();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:Tn(`language`),locale:Tn(`locale`),get passThroughHeaders(){return Sn()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&Dn()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=Cn();return{getAuthHeaders:async()=>{if(!e&&n&&(e=await i),!e)throw Error(`Failed to resolve auth token`);return{headers:{Authorization:await e()}}},getAccessTokenInjector:()=>(n=!0,e=>{r(e)})}}});function Dn(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function On(){let e=(typeof window<`u`?window.wixEmbedsAPI:void 0)?.getExternalBaseUrl?.();if(!e)return;let t=new URL(e);return t?.pathname&&t.pathname!==`/`?`${t.hostname}${t.pathname}`:t.hostname}var kn=({clientSdk:e,applicationId:t})=>({invoke:async({namespace:n,method:r,args:i})=>{if(!e)throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);return e.invoke({namespace:n,method:r,args:i,applicationId:t,accessToken:`accessToken`})},getAccessToken:()=>{throw Error(`Not implemented`)},observeState:()=>({disconnect:()=>{}})}),An=En({createHost:function(e){let t=(typeof $wixContext<`u`?$wixContext.clientSdk:void 0)??e?.clientSdk??(typeof window<`u`?window?.clientSdk:void 0),{applicationId:n}=e||{};if(!n)throw Error(`"createHost" was called without a required field "applicationId"`);return{channel:kn({clientSdk:t,applicationId:n}),close:()=>{}}}}),jn=(e,t)=>{let n=An.host({applicationId:e,componentId:t}),r=An.auth();return We({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},Mn=e=>jn(`215238eb-22a5-4c36-9e7b-e7c08025e04e`,e),Nn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pn=new class extends Nn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Fn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},I=new class{#e=Fn;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function In(e){setTimeout(e,0)}var Ln=typeof window>`u`||`Deno`in globalThis;function L(){}function Rn(e,t){return typeof e==`function`?e(t):e}function zn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Bn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function R(e,t){return typeof e==`function`?e(t):e}function z(e,t){return typeof e==`function`?e(t):e}function Vn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Un(o,t.options))return!1}else if(!Gn(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Hn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Wn(t.options.mutationKey)!==Wn(a))return!1}else if(!Gn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Un(e,t){return(t?.queryKeyHashFn||Wn)(e)}function Wn(e){return JSON.stringify(e,(e,t)=>Xn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Gn(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Gn(e[n],t[n])):!1}var Kn=Object.prototype.hasOwnProperty;function qn(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Yn(e)&&Yn(t);if(!r&&!(Xn(e)&&Xn(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Kn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=qn(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Jn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Yn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xn(e){if(!Zn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Zn(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Zn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Qn(e){return new Promise(t=>{I.setTimeout(t,e)})}function $n(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:qn(e,t)}function er(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function tr(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nr=Symbol();function rr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===nr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ir(e,t){return typeof e==`function`?e(...t):!!e}function ar(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var or=(()=>{let e=()=>Ln;return{isServer(){return e()},setIsServer(t){e=t}}})();function sr(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var cr=In;function lr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=cr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var B=lr(),ur=new class extends Nn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function dr(e){return Math.min(1e3*2**e,3e4)}function fr(e){return(e??`online`)!==`online`||ur.isOnline()}var pr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function mr(e){let t=!1,n=0,r,i=sr(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new pr(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Pn.isFocused()&&(e.networkMode===`always`||ur.isOnline())&&e.canRun(),u=()=>fr(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(or.isServer()?0:3),o=e.retryDelay??dr,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Qn(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var hr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zn(this.gcTime)&&(this.#e=I.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(or.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(I.clearTimeout(this.#e),this.#e=void 0)}};function gr(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ar(e,()=>t.signal,()=>n=!0)},u=rr(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?tr:er;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?vr:_r,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:_r(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function _r(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function vr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var yr=class extends hr{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Sr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Sr(this.options);e.data!==void 0&&(this.setState(xr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=$n(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(L).catch(L):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>z(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>R(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Bn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=rr(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?gr(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=mr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof pr&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof pr){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...br(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...xr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),B.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function br(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function xr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Sr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Cr=class extends Nn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=sr(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Tr(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Er(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Er(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof z(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Jn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Dr(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||z(this.options.enabled,this.#t)!==z(t.enabled,this.#t)||R(this.options.staleTime,this.#t)!==R(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||z(this.options.enabled,this.#t)!==z(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return kr(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(L)),t}#g(){this.#b();let e=R(this.options.staleTime,this.#t);if(or.isServer()||this.#r.isStale||!zn(e))return;let t=Bn(this.#r.dataUpdatedAt,e)+1;this.#d=I.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!or.isServer()&&z(this.options.enabled,this.#t)!==!1&&zn(this.#p)&&this.#p!==0&&(this.#f=I.setInterval(()=>{(this.options.refetchIntervalInBackground||Pn.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(I.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(I.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Tr(e,t),o=i&&Dr(e,n,t,r);(a||o)&&(l={...l,...br(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=$n(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=$n(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Or(e,t),refetch:this.refetch,promise:this.#o,isEnabled:z(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=sr();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Jn(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){B.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function wr(e,t){return z(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||z(t.retryOnMount,e)!==!1)}function Tr(e,t){return wr(e,t)||e.state.data!==void 0&&Er(e,t,t.refetchOnMount)}function Er(e,t,n){if(z(t.enabled,e)!==!1&&R(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Or(e,t)}return!1}function Dr(e,t,n,r){return(e!==t||z(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Or(e,n)}function Or(e,t){return z(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}function kr(e,t){return!Jn(e.getCurrentResult(),t)}var Ar=class extends hr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||jr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=mr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),B.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function jr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Mr=class extends Nn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ar({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Nr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Nr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Nr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Nr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){B.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Hn(t,e))}findAll(e={}){return this.getAll().filter(t=>Hn(e,t))}notify(e){B.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return B.batch(()=>Promise.all(e.map(e=>e.continue().catch(L))))}};function Nr(e){return e.options.scope?.id}var Pr=class extends Nn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Un(r,t),a=this.get(i);return a||(a=new yr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){B.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Vn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Vn(e,t)):t}notify(e){B.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){B.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){B.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Pr,this.#t=e.mutationCache||new Mr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Pn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ur.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(R(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Rn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return B.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;B.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return B.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=B.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(L).catch(L)}invalidateQueries(e,t={}){return B.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=B.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(L)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(L)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(R(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(L).catch(L)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(L).catch(L)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ur.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Wn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Gn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Wn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Gn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Un(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===nr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ir=e.createContext(void 0),Lr=t=>{let n=e.useContext(Ir);if(t)return t;if(!n)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return n},Rr=({client:t,children:n})=>(e.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),a(Ir.Provider,{value:t,children:n})),zr=e.createContext(!1),Br=()=>e.useContext(zr);zr.Provider;function Vr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hr=e.createContext(Vr()),Ur=()=>e.useContext(Hr),Wr=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ir(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Gr=t=>{e.useEffect(()=>{t.clearReset()},[t])},Kr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ir(n,[e.error,r])),qr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Jr=(e,t)=>e.isLoading&&e.isFetching&&!t,Yr=(e,t)=>e?.suspense&&t.isPending,Xr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zr(t,n,r){let i=Br(),a=Ur(),o=Lr(r),s=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash),l=t.subscribed!==!1;s._optimisticResults=i?`isRestoring`:l?`optimistic`:void 0,qr(s),Wr(s,a,c),Gr(a);let u=!o.getQueryCache().get(s.queryHash),[d]=e.useState(()=>new n(o,s)),f=d.getOptimisticResult(s),p=!i&&l;if(e.useSyncExternalStore(e.useCallback(e=>{let t=p?d.subscribe(B.batchCalls(e)):L;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),e.useEffect(()=>{d.setOptions(s)},[s,d]),Yr(s,f))throw Xr(s,d,a);if(Kr({result:f,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!or.isServer()&&Jr(f,i)&&(u?Xr(s,d,a):c?.promise)?.catch(L).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function Qr(e,t){return Zr(e,Cr,t)}function V(e){return e}var $r=V(`@wix/site-service-url`),ei=`215238eb-22a5-4c36-9e7b-e7c08025e04e`,ti=`1380b703-ce81-ff05-f115-39571d94dfcd`;`${ei}`,`${ei}`;var H=function(e){return e.SIDE_CART=`ecom_side_cart`,e.CART=`shopping_cart`,e.CHECKOUT=`checkout`,e.PRODUCT_PAGE=`product-page-builder`,e.CATEGORY_PAGE=`category-page-builder`,e}({}),ni={ecom_side_cart:`52b042d1-9e32-450e-88b9-b1abee4242f8`},ri=()=>{let e=l($r),n=t((t,n)=>{let r=e.appSectionRelativeUrl(ei,t,!0);if(r)return`./${r.replace(/^\//,``).replace(/\/$/,``)}/${encodeURIComponent(n)}`},[e]);return{getPageRelativeUrl:n,getPageAbsoluteUrl:t((t,r)=>{let i=n(t,r);if(i)return new URL(i,`${e.siteUrl.replace(/\/$/,``)}/`).href},[n,e])}},ii=g(((e,t)=>{t.exports=typeof window==`object`&&window&&window.Object===Object&&window})),U=g(((e,t)=>{var n=ii(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),ai=g(((e,t)=>{t.exports=U().Symbol})),oi=g(((e,t)=>{var n=ai(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),si=g(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),ci=g(((e,t)=>{var n=ai(),r=oi(),i=si(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),li=g(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),ui=g(((e,t)=>{var n=ci(),r=li(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),di=g(((e,t)=>{var n=ui();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),fi=g(((e,t)=>{function n(e,t){return e>t}t.exports=n})),pi=g(((e,t)=>{function n(e){return e}t.exports=n})),mi=g(((e,t)=>{var n=di(),r=fi(),i=pi();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),hi=g(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),gi=g(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),_i=g(((e,t)=>{var n=gi();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),vi=g(((e,t)=>{var n=_i(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),yi=g(((e,t)=>{var n=_i();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),bi=g(((e,t)=>{var n=_i();function r(e){return n(this.__data__,e)>-1}t.exports=r})),xi=g(((e,t)=>{var n=_i();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Si=g(((e,t)=>{var n=hi(),r=vi(),i=yi(),a=bi(),o=xi();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Ci=g(((e,t)=>{var n=Si();function r(){this.__data__=new n,this.size=0}t.exports=r})),wi=g(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),Ti=g(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),Ei=g(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Di=g(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Oi=g(((e,t)=>{var n=ci(),r=Di(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),ki=g(((e,t)=>{t.exports=U()[`__core-js_shared__`]})),Ai=g(((e,t)=>{var n=ki(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),ji=g(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Mi=g(((e,t)=>{var n=Oi(),r=Ai(),i=Di(),a=ji(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Ni=g(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),W=g(((e,t)=>{var n=Mi(),r=Ni();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Pi=g(((e,t)=>{t.exports=W()(U(),`Map`)})),Fi=g(((e,t)=>{t.exports=W()(Object,`create`)})),Ii=g(((e,t)=>{var n=Fi();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Li=g(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Ri=g(((e,t)=>{var n=Fi(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),zi=g(((e,t)=>{var n=Fi(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Bi=g(((e,t)=>{var n=Fi(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Vi=g(((e,t)=>{var n=Ii(),r=Li(),i=Ri(),a=zi(),o=Bi();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Hi=g(((e,t)=>{var n=Vi(),r=Si(),i=Pi();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Ui=g(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Wi=g(((e,t)=>{var n=Ui();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Gi=g(((e,t)=>{var n=Wi();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Ki=g(((e,t)=>{var n=Wi();function r(e){return n(this,e).get(e)}t.exports=r})),qi=g(((e,t)=>{var n=Wi();function r(e){return n(this,e).has(e)}t.exports=r})),Ji=g(((e,t)=>{var n=Wi();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Yi=g(((e,t)=>{var n=Hi(),r=Gi(),i=Ki(),a=qi(),o=Ji();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Xi=g(((e,t)=>{var n=Si(),r=Pi(),i=Yi(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),Zi=g(((e,t)=>{var n=Si(),r=Ci(),i=wi(),a=Ti(),o=Ei(),s=Xi();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Qi=g(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),$i=g(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),ea=g(((e,t)=>{var n=Yi(),r=Qi(),i=$i();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),ta=g(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),na=g(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),ra=g(((e,t)=>{var n=ea(),r=ta(),i=na(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),ia=g(((e,t)=>{t.exports=U().Uint8Array})),aa=g(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),oa=g(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),sa=g(((e,t)=>{var n=ai(),r=ia(),i=gi(),a=ra(),o=aa(),s=oa(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),ca=g(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),G=g(((e,t)=>{t.exports=Array.isArray})),la=g(((e,t)=>{var n=ca(),r=G();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),ua=g(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),da=g(((e,t)=>{function n(){return[]}t.exports=n})),fa=g(((e,t)=>{var n=ua(),r=da(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),pa=g(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),ma=g(((e,t)=>{var n=ci(),r=li(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),ha=g(((e,t)=>{var n=ma(),r=li(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),ga=g(((e,t)=>{function n(){return!1}t.exports=n})),_a=g(((e,t)=>{var n=U(),r=ga(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),va=g(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),ya=g(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),ba=g(((e,t)=>{var n=ci(),r=ya(),i=li(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function ee(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=ee})),xa=g(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Sa=g(((e,t)=>{var n=ii(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),Ca=g(((e,t)=>{var n=ba(),r=xa(),i=Sa(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),wa=g(((e,t)=>{var n=pa(),r=ha(),i=G(),a=_a(),o=va(),s=Ca(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),Ta=g(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),Ea=g(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Da=g(((e,t)=>{t.exports=Ea()(Object.keys,Object)})),Oa=g(((e,t)=>{var n=Ta(),r=Da(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),ka=g(((e,t)=>{var n=Oi(),r=ya();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),Aa=g(((e,t)=>{var n=wa(),r=Oa(),i=ka();function a(e){return i(e)?n(e):r(e)}t.exports=a})),ja=g(((e,t)=>{var n=la(),r=fa(),i=Aa();function a(e){return n(e,i,r)}t.exports=a})),Ma=g(((e,t)=>{var n=ja(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),Na=g(((e,t)=>{t.exports=W()(U(),`DataView`)})),Pa=g(((e,t)=>{t.exports=W()(U(),`Promise`)})),Fa=g(((e,t)=>{t.exports=W()(U(),`Set`)})),Ia=g(((e,t)=>{t.exports=W()(U(),`WeakMap`)})),La=g(((e,t)=>{var n=Na(),r=Pi(),i=Pa(),a=Fa(),o=Ia(),s=ci(),c=ji(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),Ra=g(((e,t)=>{var n=Zi(),r=ra(),i=sa(),a=Ma(),o=La(),s=G(),c=_a(),l=Ca(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),za=g(((e,t)=>{var n=Ra(),r=li();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),Ba=g(((e,t)=>{var n=Zi(),r=za(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),Va=g(((e,t)=>{var n=Di();function r(e){return e===e&&!n(e)}t.exports=r})),Ha=g(((e,t)=>{var n=Va(),r=Aa();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),Ua=g(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),Wa=g(((e,t)=>{var n=Ba(),r=Ha(),i=Ua();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Ga=g(((e,t)=>{var n=G(),r=ui(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Ka=g(((e,t)=>{var n=Yi(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),qa=g(((e,t)=>{var n=Ka(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Ja=g(((e,t)=>{var n=qa(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Ya=g(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Xa=g(((e,t)=>{var n=ai(),r=Ya(),i=G(),a=ui(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),Za=g(((e,t)=>{var n=Xa();function r(e){return e==null?``:n(e)}t.exports=r})),Qa=g(((e,t)=>{var n=G(),r=Ga(),i=Ja(),a=Za();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),$a=g(((e,t)=>{var n=ui(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),eo=g(((e,t)=>{var n=Qa(),r=$a();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),to=g(((e,t)=>{var n=eo();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),no=g(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),ro=g(((e,t)=>{var n=Qa(),r=ha(),i=G(),a=va(),o=ya(),s=$a();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),io=g(((e,t)=>{var n=no(),r=ro();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),ao=g(((e,t)=>{var n=za(),r=to(),i=io(),a=Ga(),o=Va(),s=Ua(),c=$a(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),oo=g(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),so=g(((e,t)=>{var n=eo();function r(e){return function(t){return n(t,e)}}t.exports=r})),co=g(((e,t)=>{var n=oo(),r=so(),i=Ga(),a=$a();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),lo=g(((e,t)=>{var n=Wa(),r=ao(),i=pi(),a=G(),o=co();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),uo=g(((e,t)=>{var n=di(),r=fi(),i=lo();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),fo=g(((e,t)=>{function n(e,t){return e<t}t.exports=n})),po=g(((e,t)=>{var n=di(),r=fo(),i=pi();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),mo=g(((e,t)=>{var n=di(),r=lo(),i=fo();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),ho=v(mi(),1),go=v(uo(),1),_o=v(po(),1),vo=v(mo(),1),yo=({price:e})=>e.actualPrice;function K(e){return e.priceAfterDiscount===void 0?{currentSellingPrice:e.actualPrice,priceBeforeDiscount:e.compareAtPrice,pricePerUnit:e.pricePerUnit}:{currentSellingPrice:e.priceAfterDiscount,priceBeforeDiscount:e.actualPrice,pricePerUnit:e.pricePerUnit}}function bo(e,t){let n=e.subscriptionPrices.find(e=>e.subscriptionId===t);if(!n)throw Error(`Missing subscription price for plan ${t} on variant ${e.id}`);let r=n.price;return{currentSellingPrice:r,priceBeforeDiscount:r<e.price.actualPrice?e.price.actualPrice:void 0}}function xo(e){let t=(0,vo.default)(e,yo),n=(0,go.default)(e,yo),r=e.map(({price:e})=>K(e)),i=K(t.price),a=K(n.price),o=r.flatMap(({priceBeforeDiscount:e})=>e===void 0?[]:[e]);return{minCurrentSellingPrice:i.currentSellingPrice,maxCurrentSellingPrice:a.currentSellingPrice,minPriceBeforeDiscount:(0,_o.default)(o),maxPriceBeforeDiscount:(0,ho.default)(o),minPricePerUnit:i.pricePerUnit,maxPricePerUnit:a.pricePerUnit}}function So(e,t){return e.subscriptionDetails.subscriptions.map(e=>({subscription:e,price:bo(t,e.id)}))}function Co(e){return{productPrice:{currentSellingPrice:void 0},subscriptionPlanPrices:e.subscriptionDetails.subscriptions.map(e=>({subscription:e,price:{currentSellingPrice:void 0}})),productPriceRange:{minCurrentSellingPrice:void 0,maxCurrentSellingPrice:void 0}}}function wo(e){if(!e.minPriceVariant)return Co(e);let t=K(e.minPriceVariant.price),n=e.minPriceVariant.price.priceAfterDiscount!==void 0;return{productPrice:t,subscriptionPlanPrices:e.subscriptionDetails.subscriptions.map(e=>({subscription:e,price:{}})),productPriceRange:{minCurrentSellingPrice:t.currentSellingPrice,maxCurrentSellingPrice:n?void 0:e.priceRange.maxActualPrice,minPriceBeforeDiscount:t.priceBeforeDiscount,maxPriceBeforeDiscount:n?e.priceRange.maxActualPrice:e.priceRange.maxCompareAtPrice,minPricePerUnit:t.pricePerUnit}}}function To(e,t,n){if(!n)return wo(e);let r=(0,vo.default)(e.variants,yo),i=t??r;return i?{productPrice:K(i.price),subscriptionPlanPrices:So(e,i),productPriceRange:xo(e.variants)}:Co(e)}function Eo(e,t){let n=e.subscriptionPlanPrices.find(({subscription:e})=>e.id===t);return n?{currentSellingPrice:n.price.currentSellingPrice,priceBeforeDiscount:n.price.priceBeforeDiscount,pricePerUnit:e.productPrice.pricePerUnit}:e.productPrice}function Do(e){return K(e.price).currentSellingPrice}function Oo(e){return Object.keys(e).length===1&&`$and`in e&&Array.isArray(e.$and)}function ko(e){return Object.keys(e).length===1&&`$or`in e&&Array.isArray(e.$or)}function Ao(e){return Object.keys(e).length===1&&`$not`in e&&typeof e.$not==`object`}function q(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$and:[...Oo(e)?e.$and:[e],...Oo(t)?t.$and:[t]]}}function jo(e,t){return e===void 0||Object.keys(e).length===0?t:t===void 0||Object.keys(t).length===0?e:{$or:[...ko(e)?e.$or:[e],...ko(t)?t.$or:[t]]}}function Mo(e){if(e!==void 0&&Object.keys(e).length!==0)return Ao(e)?e.$not:{$not:e}}var No=class{_items;_fetchNextPage;_fetchPrevPage;_originQuery;_limit;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}){this._items=e,this._fetchNextPage=n,this._fetchPrevPage=r,this._originQuery=t,this._limit=i}get items(){return this._items}get length(){return this._items.length}get pageSize(){return this._limit}get query(){return this._originQuery}async next(){if(!this.hasNext())throw Error(`No next page to fetch`);return await this._fetchNextPage()}async prev(){if(!this.hasPrev())throw Error(`No previous page to fetch`);return await this._fetchPrevPage()}},Po=class extends No{_nextCursor;_prevCursor;cursors;constructor({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i,nextCursor:a,prevCursor:o}){super({items:e,originQuery:t,fetchNextPage:n,fetchPrevPage:r,limit:i}),this._nextCursor=a,this._prevCursor=o,this.cursors={next:a,prev:o}}hasNext(){return!!this._nextCursor}hasPrev(){return!!this._prevCursor}},Fo=class extends No{_totalCount;_offset;_tooManyToCount;constructor({items:e,fetchNextPage:t,fetchPrevPage:n,offset:r,originQuery:i,limit:a,totalCount:o,tooManyToCount:s}){super({items:e,fetchNextPage:t,fetchPrevPage:n,originQuery:i,limit:a}),this._totalCount=o,this._offset=r,this._tooManyToCount=s}get currentPage(){return this._limit===0?void 0:Math.floor(this._offset/this._limit)}get totalPages(){return this._tooManyToCount||this._limit===0?void 0:Math.ceil(this._totalCount/this._limit)}get totalCount(){return this._tooManyToCount?void 0:this._totalCount}hasNext(){return this._limit!==0&&this.currentPage!==void 0&&this.totalPages!==void 0&&this.currentPage<this.totalPages-1}hasPrev(){return!!(this._limit!==0&&this.currentPage&&this.currentPage>0)}};function Io(e){let t=n=>({query:n,async find(){try{let r=e.requestTransformer(e.pagingMethod===`CURSOR`&&n.cursorPaging.cursor?{cursorPaging:n.cursorPaging}:n),i=await e.func(r),{[Ye]:a,[Xe]:o}=e.responseTransformer(i);if(e.pagingMethod===`OFFSET`){let e=n;return new Fo({items:a??[],fetchNextPage:()=>t({...e,paging:{offset:e.paging.offset+e.paging.limit,limit:e.paging.limit}}).find(),fetchPrevPage:()=>t({...n,paging:{offset:Math.max(e.paging.offset-e.paging.limit,0),limit:e.paging.limit}}).find(),offset:e.paging.offset,limit:e.paging.limit,totalCount:o?.total,tooManyToCount:o?.tooManyToCount,originQuery:this})}let s=n.cursorPaging;return new Po({items:a??[],limit:s.limit,originQuery:this,fetchNextPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.next??void 0,limit:s.limit}}).find(),fetchPrevPage:()=>t({...n,cursorPaging:{cursor:o?.cursors?.prev??void 0,limit:s.limit}}).find(),prevCursor:o?.cursors?.prev??void 0,nextCursor:o?.cursors?.next??void 0})}catch(t){throw e.errorTransformer(t)}},skipTo(e){return t({...n,cursorPaging:{cursor:e,limit:n.cursorPaging.limit}})},eq(r,i){let a=i===void 0?null:i,o={[J(e.transformationPaths,r)]:a};return t({...n,filter:q(n.filter,o)})},ne(r,i){let a=i===void 0?null:i,o={[J(e.transformationPaths,r)]:{$ne:a}};return t({...n,filter:q(n.filter,o)})},ge(r,i){let a={[J(e.transformationPaths,r)]:{$gte:i}};return t({...n,filter:q(n.filter,a)})},gt(r,i){let a={[J(e.transformationPaths,r)]:{$gt:i}};return t({...n,filter:q(n.filter,a)})},le(r,i){let a={[J(e.transformationPaths,r)]:{$lte:i}};return t({...n,filter:q(n.filter,a)})},lt(r,i){let a={[J(e.transformationPaths,r)]:{$lt:i}};return t({...n,filter:q(n.filter,a)})},isNotEmpty(e){return this.ne(e,null)},isEmpty(e){return this.eq(e,null)},startsWith(r,i){let a={[J(e.transformationPaths,r)]:{$startsWith:i}};return t({...n,filter:q(n.filter,a)})},endsWith(r,i){let a={[J(e.transformationPaths,r)]:{$endsWith:i}};return t({...n,filter:q(n.filter,a)})},contains(r,i){let a={[J(e.transformationPaths,r)]:{$contains:i}};return t({...n,filter:q(n.filter,a)})},hasSome(r,...i){let a={[J(e.transformationPaths,r)]:{$hasSome:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:q(n.filter,a)})},hasAll(r,...i){let a={[J(e.transformationPaths,r)]:{$hasAll:Array.isArray(i[0])?i[0]:i}};return t({...n,filter:q(n.filter,a)})},between(e,t,n){return this.ge(e,t).lt(e,n)},in(r,i){let a={[J(e.transformationPaths,r)]:{$in:i}};return t({...n,filter:q(n.filter,a)})},exists(r,i=!0){let a={[J(e.transformationPaths,r)]:{$exists:i}};return t({...n,filter:q(n.filter,a)})},or(e){return t({...n,filter:jo(n.filter,e.query.filter)})},and(e){return t({...n,filter:q(n.filter,e.query.filter)})},not(e){return t({...n,filter:Mo(e.query.filter)})},ascending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:J(e.transformationPaths,t),order:`ASC`}))]})},descending(...r){return t({...n,sort:[...n.sort??[],...r.map(t=>({fieldName:J(e.transformationPaths,t),order:`DESC`}))]})},skip(e){return t({...n,paging:{offset:e,limit:`limit`in n.paging?n.paging.limit:50}})},limit(r){if(e.pagingMethod===`CURSOR`){let e=n;return t({...n,cursorPaging:{limit:r,cursor:`cursor`in e.cursorPaging?e.cursorPaging.cursor:void 0}})}let i=n;return t({...n,paging:{limit:r,offset:`offset`in i.paging?i.paging.offset:0}})}});return t({filter:{},...e.pagingMethod===`OFFSET`?{paging:{offset:0,limit:50}}:{cursorPaging:{limit:50}}})}function J(e,t){let n=Object.entries(e).find(([e])=>e===t||t.startsWith(`${e}.`))?.[0];return n?t.replace(n,e[n]):Qe(t,{...e,...Ze})}function Lo(e,t,n={}){let r=(r,i)=>Lo(e,t,{...n,[r]:i}),i=()=>Object.keys(n).length===0?{}:{[$e(e,t)]:n};return{get filter(){return i()},eq:e=>r(`$eq`,e),ne:e=>r(`$ne`,e),gt:e=>r(`$gt`,e),gte:e=>r(`$gte`,e),lt:e=>r(`$lt`,e),lte:e=>r(`$lte`,e),startsWith:e=>r(`$startsWith`,e),endsWith:e=>r(`$endsWith`,e),contains:e=>r(`$contains`,e),in:e=>r(`$in`,e),nin:e=>r(`$nin`,e),hasSome:e=>r(`$hasSome`,e),hasAll:e=>r(`$hasAll`,e),exists:(e=!0)=>r(`$exists`,e),isEmpty:(e=!0)=>r(`$isEmpty`,e),isNotEmpty:()=>r(`$ne`,null)}}function Ro(e){return Object.assign(t=>Lo(t,e),{and:(...e)=>({filter:{$and:e.map(e=>e.filter)}}),or:(...e)=>({filter:{$or:e.map(e=>e.filter)}}),not:e=>({filter:{$not:e.filter}})})}function zo(e){return(t=>({asc:()=>({sort:{fieldName:$e(t,e),order:`ASC`}}),desc:()=>({sort:{fieldName:$e(t,e),order:`DESC`}})}))}function Bo(e){return()=>{let t={},n={withFilter(e){return t={...t,filter:e.filter},n},withFields(...r){return t={...t,fields:r.map(t=>$e(t,e))},n},withSorting(...e){return t={...t,sort:e.map(e=>e.sort)},n},withPaging(e){return t={...t,paging:e},n},build(){return t}};return n}}function Vo(e){return{QueryBuilder:Bo(e),Filter:Ro(e),Sort:zo(e)}}var Ho=`filter`,Uo=`sort`,Wo=`cursorPaging`,Go=`paging`,Ko=[Ho,Uo,Wo],qo=[Ho,Uo,Go];function Jo(e,t){return!e||typeof e!=`object`?!1:t.some(t=>e.hasOwnProperty(t))}function Yo(e){return Jo(e,Ko)}function Xo(e){return Jo(e,qo)}function Zo(e){let{hasOptionsParameter:t}=e;return function(...n){return t?$o(n,e):Qo(n,e)}}function Qo(e,t){return e.length===0?t.builderQueryFunction():t.typedQueryFunction(e[0])}function $o(e,t){switch(e.length){case 0:return t.builderQueryFunction();case 1:return Yo(e[0])||Xo(e[0])?t.typedQueryFunction(e[0]):t.builderQueryFunction(e[0]);default:return t.typedQueryFunction(e[0],e[1])}}function es(e){if(!e)return;let t=vt(e,`image`),{protocol:n,hash:r,pathname:i}=new URL(t),a=new URLSearchParams(r.replace(`#`,``)),o=a.get(`originHeight`),s=a.get(`originWidth`),[c,l]=i.replace(`image://v1/`,``).split(`/`),u=l&&decodeURIComponent(l);if(n===`wix:`){let t={id:c,height:Number(o),width:Number(s)};return u?{...t,altText:u,filename:u,url:e}:t}return{url:e}}function ts(e){if(!e)return;let t=``;return(e.filename||e.altText)&&(t=`/${encodeURIComponent(e.filename||e.altText)}`),e.id?`wix:image://v1/${e.id}${t}#originWidth=${e.width}&originHeight=${e.height}`:e.url}function ns(e){let t={},n={get search(){return t},expression(e){return t={...t,expression:e},n},mode(e){return t={...t,mode:e},n},fields(r){return t={...t,fields:r.map(t=>$e(t,e))},n},fuzzy(e=!0){return t={...t,fuzzy:e},n}};return n}function rs(e){return t=>{let n=ns(e);return t===void 0?n:n.expression(t)}}function is(e){let t={...e,type:`VALUE`,value:{...e.value}},n={get aggregation(){return t},sortBy(e,r){return t={...t,value:{...t.value,sortType:e,sortDirection:r}},n},limit(e){return t={...t,value:{...t.value,limit:e}},n},excludeMissingValues(){return t={...t,value:{...t.value,missingValues:`EXCLUDE`}},n},includeMissingValues(){return t={...t,value:{...t.value,missingValues:`INCLUDE`}},n},includeValues(e){return t={...t,value:{...t.value,includeOptions:{addToBucket:e}}},n}};return n}function as(e){let t={...e,type:`RANGE`,range:{buckets:[]}},n={get aggregation(){return t},withBuckets(...e){return t={...t,range:{buckets:e}},n}};return n}function os(e){let t={...e,type:`DATE_HISTOGRAM`,dateHistogram:{}},n={get aggregation(){return t},interval(e){return t={...t,dateHistogram:{interval:e}},n}};return n}function ss(e){let t={...e,type:`SCALAR`,scalar:{}},n={get aggregation(){return t},type(e){return t={...t,scalar:{type:e}},n}};return n}function cs(e){let t={...e,type:`NESTED`,nested:{nestedAggregations:[]}},n={get aggregation(){return t},addNestedAggregation(e){let r=e.aggregation,i=[...t.nested?.nestedAggregations??[],r];return t={...t,nested:{nestedAggregations:i}},n}};return n}function ls(e,t){let n={name:e},r={get aggregation(){return n},ofType(e){return n={...n,type:e},r},onField(e){return n={...n,fieldPath:$e(e,t)},r},asValueAggregation(){return is(n)},asRangeAggregation(){return as(n)},asDateHistogramAggregation(){return os(n)},asScalarAggregation(){return ss(n)},asNestedAggregation(){return cs(n)}};return r}function us(e){return t=>ls(t,e)}function ds(){return()=>{let e={},t={withFilter(n){return e={...e,filter:n.filter},t},withSearchClause(n){return e={...e,search:n.search},t},withSorting(...n){return e={...e,sort:n.map(e=>e.sort)},t},withAggregation(...n){return e={...e,aggregations:n.map(e=>e.aggregation)},t},withPaging(n){return e={...e,paging:n},t},withTimeZone(n){return e={...e,timeZone:n},t},build(){return e}};return t}}function fs(e){return{SearchBuilder:ds(),Filter:Ro(e),Sort:zo(e),SearchParams:rs(e),Aggregation:us(e)}}function ps(e){return Ht(Object.assign(e,{domainToMappings:{"bo._base_domain_":[{srcPath:`/back-in-stock-service`,destPath:``}],"wixbo.ai":[{srcPath:`/back-in-stock-service`,destPath:``}],"wix-bo.com":[{srcPath:`/back-in-stock-service`,destPath:``}],"www.wixapis.com":[{srcPath:`/back-in-stock-service`,destPath:``}],_:[{srcPath:`/v1/back-in-stock-notification-requests`,destPath:`/v1/back-in-stock-notification-requests`}],"*.dev.wix-code.com":[{srcPath:`/v1/back-in-stock-notification-requests`,destPath:`/v1/back-in-stock-notification-requests`}]}}))}var ms=`@wix/auto_sdk_ecom_back-in-stock-notifications`;function hs(e){function t({host:t}){let n=N(e,[{transformFn:at,paths:[{path:`request.createdDate`},{path:`itemDetails.image.urlExpirationDate`}]},{transformFn:hn,paths:[{path:`itemDetails.image.focalPoint.x`},{path:`itemDetails.image.focalPoint.y`}]}]);return{entityFqdn:`wix.ecom.v1.back_in_stock_notification_request`,method:`POST`,methodFqn:`com.wixpress.ecom.back.in.stock.BackInStockNotificationRequestService.CreateBackInStockNotificationRequest`,packageName:ms,migrationOptions:{optInTransformResponse:!0},url:ps({protoPath:`/v1/back-in-stock-notification-requests`,data:n,host:t}),data:n,transformResponse:e=>N(e,[{transformFn:M,paths:[{path:`request.createdDate`}]}])}}return t}async function gs(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=hs(N(it({request:e,itemDetails:t}),[{transformFn:es,paths:[{path:`itemDetails.image`}]}]));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),j(e.data)?.request}catch(e){let t=P(e,{spreadPathsToArguments:{},explicitPathsToArguments:{request:`$[0]`,itemDetails:`$[1]`},singleArgumentUnchanged:!1},[`request`,`itemDetails`]);throw r?.onError?.(e),t}}({...Vo()});function _s(e){return(t,n)=>gs(t,n,{httpClient:e})}var vs=b(`wix.ecom.v1.back_in_stock_notification_request_created`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`metadata.eventTime`}]}])))(),ys=b(`wix.ecom.v1.back_in_stock_notification_request_deleted`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`undefined.createdDate`},{path:`metadata.eventTime`}]}])))(),bs=b(`wix.ecom.v1.back_in_stock_notification_request_updated`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`metadata.eventTime`}]}])))(),xs=Bt(_s);F(vs),F(ys),F(bs);function Ss(e){if(!e)return;let{pathname:t}=new URL(e);return{relativePath:t,url:e}}function Cs(e){if(e)return e.url}function ws(e){return Ht(Object.assign(e,{domainToMappings:{"api._api_base_domain_":[{srcPath:`/cart-v2`,destPath:``}],_:[{srcPath:`/_api/cart-v2`,destPath:``}],"*.dev.wix-code.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"create.editorx":[{srcPath:`/_api/cart-v2`,destPath:``}],"apps._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"manage._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"bo._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"wixbo.ai":[{srcPath:`/_api/cart-v2`,destPath:``}],"wix-bo.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www.wixapis.com":[{srcPath:`/ecom/v2/carts`,destPath:`/v2/carts`}],"editor.wixapps.net":[{srcPath:`/_api/cart-v2`,destPath:``}]}}))}var Ts=`@wix/auto_sdk_ecom_cart-v-2`;function Es(e){function t({host:t}){let n=N(e,[{transformFn:at,paths:[{path:`cart.createdDate`},{path:`cart.updatedDate`},{path:`cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate`},{path:`cart.lineItems.attributes.image.urlExpirationDate`},{path:`cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate`},{path:`cart.lineItems.attributes.serviceProperties.scheduledDate`},{path:`cart.lineItems.attributes.serviceProperties.endDate`},{path:`catalogItems.catalogOverrideFields.image.urlExpirationDate`},{path:`customItems.attributes.image.urlExpirationDate`},{path:`customItems.attributes.serviceProperties.scheduledDate`},{path:`customItems.attributes.serviceProperties.endDate`},{path:`customItems.attributes.subscriptionInfo.subscriptionSettings.startDate`}]},{transformFn:hn,paths:[{path:`cart.lineItems.source.catalogOverrideFields.physicalProperties.weight`},{path:`cart.lineItems.attributes.physicalProperties.weight`},{path:`cart.deliveryInfo.address.geocode.latitude`},{path:`cart.deliveryInfo.address.geocode.longitude`},{path:`cart.paymentInfo.billingAddress.geocode.latitude`},{path:`cart.paymentInfo.billingAddress.geocode.longitude`},{path:`cart.legacyFields.discounts.merchantDiscount.percentage`},{path:`cart.tcAppliedDiscounts.merchantDiscount.percentage`},{path:`catalogItems.catalogOverrideFields.physicalProperties.weight`},{path:`customItems.attributes.physicalProperties.weight`}]}]);return{entityFqdn:`wix.ecom.v2.cart`,method:`POST`,methodFqn:`wix.ecom.cart.v2.CartService.CreateCart`,packageName:Ts,migrationOptions:{optInTransformResponse:!0},url:ws({protoPath:`/v2/carts`,data:n,host:t}),data:n,transformResponse:e=>N(e,[{transformFn:M,paths:[{path:`cart.createdDate`},{path:`cart.updatedDate`},{path:`cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate`},{path:`cart.lineItems.attributes.image.urlExpirationDate`},{path:`cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate`},{path:`cart.lineItems.attributes.serviceProperties.scheduledDate`},{path:`cart.lineItems.attributes.serviceProperties.endDate`}]},{transformFn:gn,paths:[{path:`cart.lineItems.source.catalogOverrideFields.physicalProperties.weight`},{path:`cart.lineItems.attributes.physicalProperties.weight`},{path:`cart.deliveryInfo.address.geocode.latitude`},{path:`cart.deliveryInfo.address.geocode.longitude`},{path:`cart.paymentInfo.billingAddress.geocode.latitude`},{path:`cart.paymentInfo.billingAddress.geocode.longitude`},{path:`cart.legacyFields.discounts.merchantDiscount.percentage`},{path:`cart.tcAppliedDiscounts.merchantDiscount.percentage`}]}])}}return t}var Ds=(e=>(e.UNSPECIFIED=`UNSPECIFIED`,e.WEB=`WEB`,e.POS=`POS`,e.EBAY=`EBAY`,e.AMAZON=`AMAZON`,e.OTHER_PLATFORM=`OTHER_PLATFORM`,e.WIX_APP_STORE=`WIX_APP_STORE`,e.WIX_INVOICES=`WIX_INVOICES`,e.BACKOFFICE_MERCHANT=`BACKOFFICE_MERCHANT`,e.WISH=`WISH`,e.CLASS_PASS=`CLASS_PASS`,e.GLOBAL_E=`GLOBAL_E`,e.FACEBOOK=`FACEBOOK`,e.ETSY=`ETSY`,e.TIKTOK=`TIKTOK`,e.FAIRE_COM=`FAIRE_COM`,e.PAYPAL_AGENTIC_CHECKOUT=`PAYPAL_AGENTIC_CHECKOUT`,e.STRIPE_AGENTIC_CHECKOUT=`STRIPE_AGENTIC_CHECKOUT`,e.WIX_INVOICES_PLATFORM=`WIX_INVOICES_PLATFORM`,e.UCP_AGENTIC_CHECKOUT=`UCP_AGENTIC_CHECKOUT`,e))(Ds||{});async function Os(e){let{httpClient:t,sideEffects:n}=arguments[1],r=Es(N(it({cart:e?.cart,catalogItems:e?.catalogItems,customItems:e?.customItems,coupons:e?.coupons,deliveryMethod:e?.deliveryMethod,giftCards:e?.giftCards}),[{transformFn:es,paths:[{path:`cart.lineItems.source.catalogOverrideFields.image`},{path:`cart.lineItems.attributes.image`},{path:`catalogItems.catalogOverrideFields.image`},{path:`customItems.attributes.image`}]},{transformFn:Ss,paths:[{path:`cart.lineItems.attributes.url`},{path:`customItems.attributes.url`}]},{transformFn:_n,paths:[{path:`cart.deliveryInfo.address`},{path:`cart.paymentInfo.billingAddress`}]}]));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),j(N(e.data,[{transformFn:ts,paths:[{path:`cart.lineItems.source.catalogOverrideFields.image`},{path:`cart.lineItems.attributes.image`}]},{transformFn:Cs,paths:[{path:`cart.lineItems.attributes.url`}]},{transformFn:vn,paths:[{path:`cart.deliveryInfo.address`},{path:`cart.paymentInfo.billingAddress`}]}]))?.cart}catch(e){let t=P(e,{spreadPathsToArguments:{},explicitPathsToArguments:{cart:`$[0].cart`,catalogItems:`$[0].catalogItems`,customItems:`$[0].customItems`,coupons:`$[0].coupons`,deliveryMethod:`$[0].deliveryMethod`,giftCards:`$[0].giftCards`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function ks(e){return t=>Os(t,{httpClient:e})}var As=Bt(ks);function js(e){return Ht(Object.assign(e,{domainToMappings:{"api._api_base_domain_":[{srcPath:`/cart-v2`,destPath:``}],_:[{srcPath:`/_api/cart-v2`,destPath:``}],"*.dev.wix-code.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"create.editorx":[{srcPath:`/_api/cart-v2`,destPath:``}],"apps._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"manage._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"bo._base_domain_":[{srcPath:`/_api/cart-v2`,destPath:``}],"wixbo.ai":[{srcPath:`/_api/cart-v2`,destPath:``}],"wix-bo.com":[{srcPath:`/_api/cart-v2`,destPath:``}],"www.wixapis.com":[{srcPath:`/ecom/v2/carts`,destPath:`/v2/carts`}],"editor.wixapps.net":[{srcPath:`/_api/cart-v2`,destPath:``}]}}))}var Ms=`@wix/auto_sdk_ecom_current-cart-v-2`;function Ns(e){function t({host:t}){let n=N(e,[{transformFn:hn,paths:[{path:`catalogItems.catalogOverrideFields.physicalProperties.weight`},{path:`customItems.attributes.physicalProperties.weight`}]},{transformFn:at,paths:[{path:`catalogItems.catalogOverrideFields.image.urlExpirationDate`},{path:`customItems.attributes.image.urlExpirationDate`},{path:`customItems.attributes.serviceProperties.scheduledDate`},{path:`customItems.attributes.serviceProperties.endDate`},{path:`customItems.attributes.subscriptionInfo.subscriptionSettings.startDate`}]}]);return{entityFqdn:`wix.ecom.v2.cart`,method:`POST`,methodFqn:`wix.ecom.cart.v2.CurrentCartService.AddLineItemsToCurrentCart`,packageName:Ms,migrationOptions:{optInTransformResponse:!0},url:js({protoPath:`/v2/carts/current/add-line-items`,data:n,host:t}),data:n,transformResponse:e=>N(e,[{transformFn:M,paths:[{path:`cart.createdDate`},{path:`cart.updatedDate`},{path:`cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate`},{path:`cart.lineItems.attributes.image.urlExpirationDate`},{path:`cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate`},{path:`cart.lineItems.attributes.serviceProperties.scheduledDate`},{path:`cart.lineItems.attributes.serviceProperties.endDate`}]},{transformFn:gn,paths:[{path:`cart.lineItems.source.catalogOverrideFields.physicalProperties.weight`},{path:`cart.lineItems.attributes.physicalProperties.weight`},{path:`cart.deliveryInfo.address.geocode.latitude`},{path:`cart.deliveryInfo.address.geocode.longitude`},{path:`cart.paymentInfo.billingAddress.geocode.latitude`},{path:`cart.paymentInfo.billingAddress.geocode.longitude`},{path:`cart.legacyFields.discounts.merchantDiscount.percentage`},{path:`cart.tcAppliedDiscounts.merchantDiscount.percentage`}]}])}}return t}async function Ps(e){let{httpClient:t,sideEffects:n}=arguments[1],r=Ns(N(it({catalogItems:e?.catalogItems,customItems:e?.customItems}),[{transformFn:es,paths:[{path:`catalogItems.catalogOverrideFields.image`},{path:`customItems.attributes.image`}]},{transformFn:Ss,paths:[{path:`customItems.attributes.url`}]}]));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),j(N(e.data,[{transformFn:ts,paths:[{path:`cart.lineItems.source.catalogOverrideFields.image`},{path:`cart.lineItems.attributes.image`}]},{transformFn:Cs,paths:[{path:`cart.lineItems.attributes.url`}]},{transformFn:vn,paths:[{path:`cart.deliveryInfo.address`},{path:`cart.paymentInfo.billingAddress`}]}]))}catch(e){let t=P(e,{spreadPathsToArguments:{},explicitPathsToArguments:{catalogItems:`$[0].catalogItems`,customItems:`$[0].customItems`},singleArgumentUnchanged:!1},[`options`]);throw n?.onError?.(e),t}}function Fs(e){return t=>Ps(t,{httpClient:e})}var Is=Bt(Fs),Ls=`BACK_IN_STOCK_NOTIFICATION_REQUEST_ALREADY_EXISTS`;function Rs(e){return e?.details?.applicationError?.code??`UNKNOWN`}function zs(e){return{code:Rs(e),message:e?.message}}async function Bs(e){let{productId:t,variantId:n,email:r,name:i,price:a,imageUrl:o}=e;try{return await xs({catalogReference:{catalogItemId:t,appId:ei,...n?{options:{variantId:n}}:{}},email:r},{name:i,price:String(a),...o?{image:o}:{}}),`created`}catch(e){if(Rs(e)===Ls)return`already-subscribed`;throw zs(e)}}var Vs=`https://static.wixstatic.com/media`,Hs=/image:\/\/v1\/([^/#]+)/;function Us(e){return e?e.match(Hs)?.[1]??null:null}function Ws(e){if(!e)return;if(/^https?:\/\//i.test(e))return e;let t=Us(e);return t?`${Vs}/${t}`:void 0}var Gs=e=>e.media.type===`image`;function Ks(e,t){let n=t.choices[e.id];return e.choices.find(e=>e.choiceId===n)}function qs(e,t){let n=e.options.map(e=>Ks(e,t)?.mediaIds).filter(e=>!!(e&&e.length>0));if(n.length===0)return;let r=n.reduce((e,t)=>e.filter(e=>t.includes(e))),i=r.length>0?r:n.flat(),a=new Map;for(let t of e.media??[])Gs(t)&&a.set(t.id,t);for(let e of i){let t=a.get(e)?.media.src;if(t)return t}}function Js(e,t){let n=[t?qs(e,t):void 0,e.media?.find(Gs)?.media.src];for(let e of n){let t=Ws(e);if(t)return t}}function Ys(e,r){let i=t(t=>r?Bs({productId:e.id,variantId:r.id,email:t,name:e.name??``,price:Do(r),imageUrl:Js(e,r)}):Promise.reject(Error(`Cannot create a back-in-stock notification without a selected variant`)),[e,r]);return n(()=>({handleNotifyMe:i}),[i])}function Xs(e,t){return n(()=>({id:e.id,name:e.name,description:e.description,ribbons:e.ribbons,breadcrumbs:e.breadcrumbs,mainCategoryId:e.mainCategoryId,categories:e.categories,infoSections:e.infoSections,sku:t?.sku,discountRules:e.discountRuleNames?.map(e=>({name:e}))}),[e,t])}function Zs(e){if(!e)return;let t=``;e?.filename&&(t=`/${encodeURIComponent(e.filename)}`);let n=``;if(e.posters?.length){let[t,r]=e.posters,i=r||t,a=i.id||``;if(!a&&i.url){let e=i.url.lastIndexOf(`/`);e!==-1&&(a=i.url.substring(e+1))}a&&(n=`#posterUri=${a}&posterWidth=${i.width}&posterHeight=${i.height}`)}return e.id?`wix:video://v1/${e.id}${t}${n}`:e.url}function Qs(e){return Ht(Object.assign(e,{domainToMappings:{"manage._base_domain_":[{srcPath:`/inventory`,destPath:``}],"api._api_base_domain_":[{srcPath:`/inventory`,destPath:``}],_:[{srcPath:`/_api/inventory`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/inventory`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/inventory`,destPath:``}],"create.editorx":[{srcPath:`/_api/inventory`,destPath:``}],"www.wixapis.com":[{srcPath:`/stores/v3/inventory-items`,destPath:`/v3/inventory-items`},{srcPath:`/stores/v3/bulk/inventory-items`,destPath:`/v3/bulk/inventory-items`}],"*.dev.wix-code.com":[{srcPath:`/_api/inventory`,destPath:``}],"editor.wixapps.net":[{srcPath:`/_api/inventory`,destPath:``}]}}))}var $s=`@wix/auto_sdk_stores_inventory-items-v-3`;function ec(e){function t({host:t}){return{entityFqdn:`wix.stores.catalog.v3.inventory_item`,method:`GET`,methodFqn:`com.wix.stores.catalog.inventory.api.v3.InventoryService.QueryInventoryItems`,packageName:$s,migrationOptions:{optInTransformResponse:!0},url:Qs({protoPath:`/v3/inventory-items/query`,data:e,host:t}),params:Vt(e,!0),transformResponse:e=>N(e,[{transformFn:M,paths:[{path:`inventoryItems.createdDate`},{path:`inventoryItems.updatedDate`}]}]),fallback:[{method:`POST`,url:Qs({protoPath:`/v3/inventory-items/query`,data:e,host:t}),data:e}]}}return t}var Y=(e=>(e.OUT_OF_STOCK=`OUT_OF_STOCK`,e.IN_STOCK=`IN_STOCK`,e.PREORDER=`PREORDER`,e))(Y||{});function tc(){let{httpClient:e,sideEffects:t}=arguments[0];return Io({func:async n=>{let r=ec(n);t?.onSiteCall?.();try{let n=await e.request(r);return t?.onSuccess?.(n),n}catch(e){throw t?.onError?.(e),e}},requestTransformer:e=>{let t=[e,{}];return it({...t?.[1],query:t?.[0]})},responseTransformer:({data:e})=>{let t=j(N(e,[]));return{items:t?.inventoryItems,pagingMetadata:t?.pagingMetadata}},errorTransformer:e=>{throw P(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1})},pagingMethod:`CURSOR`,transformationPaths:{}})}async function nc(e){let{httpClient:t,sideEffects:n}=arguments[1],r=ec(it({query:e}));n?.onSiteCall?.();try{let e=await t.request(r);return n?.onSuccess?.(e),j(e.data)}catch(e){let t=P(e,{spreadPathsToArguments:{},explicitPathsToArguments:{query:`$[0]`},singleArgumentUnchanged:!1},[`query`]);throw n?.onError?.(e),t}}({...Vo()}),{...fs()};function rc(e){return()=>tc({httpClient:e})}function ic(e){return t=>nc(t,{httpClient:e})}var ac=b(`wix.stores.catalog.v3.inventory_item_created`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`metadata.eventTime`}]}])))(),oc=b(`wix.stores.catalog.v3.inventory_item_deleted`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`metadata.eventTime`}]}])))(),sc=b(`wix.stores.catalog.v3.inventory_item_stock_status_updated`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`metadata.eventTime`}]}])))(),cc=b(`wix.stores.catalog.v3.inventory_item_updated`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`metadata.eventTime`},{path:`modifiedFields.createdDate`},{path:`modifiedFields.updatedDate`}]}])))(),lc=b(`wix.stores.catalog.v3.inventory_item_updated_with_reason`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`data.currentEntity.createdDate`},{path:`data.currentEntity.updatedDate`},{path:`metadata.eventTime`}]}])))();function uc(e){let t=Zo({builderQueryFunction:()=>rc(e)(),typedQueryFunction:t=>ic(e)(t),hasOptionsParameter:!1});function n(e){return t(...arguments)}return n}var dc=Bt(uc);F(ac),F(oc),F(sc),F(cc),F(lc);function fc(e){return Ht(Object.assign(e,{domainToMappings:{"api._api_base_domain_":[{srcPath:`/stores-catalog-orchestrator`,destPath:``}],"manage._base_domain_":[{srcPath:`/stores`,destPath:``}],"www.wixapis.com":[{srcPath:`/stores/v3/products`,destPath:`/v3/products`},{srcPath:`/stores/v3/bulk/products`,destPath:`/v3/bulk/products`},{srcPath:`/stores/v3/products-with-inventory`,destPath:`/v3/products-with-inventory`},{srcPath:`/stores/v3/bulk/products-with-inventory`,destPath:`/v3/bulk/products-with-inventory`},{srcPath:`/stores/v3/all-products-category`,destPath:`/v3/all-products-category`}],"www._base_domain_":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"create.editorx":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"editor.wixapps.net":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],"*.dev.wix-code.com":[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}],_:[{srcPath:`/_api/stores-catalog-orchestrator`,destPath:``}]}}))}var pc=`@wix/auto_sdk_stores_products-v-3`;function mc(e){function t({host:t}){return{entityFqdn:`wix.stores.catalog.v3.product`,method:`GET`,methodFqn:`wix.stores.catalog.v3.CatalogApi.GetProduct`,packageName:pc,migrationOptions:{optInTransformResponse:!0},url:fc({protoPath:`/v3/products/{productId}`,data:e,host:t}),params:Vt(e),transformResponse:e=>N(e,[{transformFn:M,paths:[{path:`product.createdDate`},{path:`product.updatedDate`},{path:`product.description.metadata.createdTimestamp`},{path:`product.description.metadata.updatedTimestamp`},{path:`product.media.main.image.urlExpirationDate`},{path:`product.media.main.video.urlExpirationDate`},{path:`product.media.main.video.resolutions.urlExpirationDate`},{path:`product.media.main.video.resolutions.poster.urlExpirationDate`},{path:`product.media.main.video.posters.urlExpirationDate`},{path:`product.media.itemsInfo.items.image.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.resolutions.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.resolutions.poster.urlExpirationDate`},{path:`product.media.itemsInfo.items.video.posters.urlExpirationDate`},{path:`product.options.choicesSettings.choices.image.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.image.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate`},{path:`product.options.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate`},{path:`product.options.choicesSettings.choices.displayImage.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.image.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.image.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate`},{path:`product.modifiers.choicesSettings.choices.displayImage.urlExpirationDate`},{path:`product.infoSections.description.metadata.createdTimestamp`},{path:`product.infoSections.description.metadata.updatedTimestamp`},{path:`product.variantsInfo.variants.media.image.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.resolutions.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.resolutions.poster.urlExpirationDate`},{path:`product.variantsInfo.variants.media.video.posters.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.image.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.resolutions.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.resolutions.poster.urlExpirationDate`},{path:`product.variantSummary.minPriceVariant.media.video.posters.urlExpirationDate`}]},{transformFn:gn,paths:[{path:`product.physicalProperties.pricePerUnit.quantity`},{path:`product.physicalProperties.shippingWeightRange.minValue`},{path:`product.physicalProperties.shippingWeightRange.maxValue`},{path:`product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`product.variantsInfo.variants.revenueDetails.profitMargin`},{path:`product.subscriptionDetails.subscriptions.discount.percentOff`},{path:`product.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`product.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`product.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`product.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`product.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`product.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`product.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`product.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`product.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`product.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`product.description.nodes.galleryData.items.image.media.duration`},{path:`product.description.nodes.galleryData.items.video.media.duration`},{path:`product.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`product.description.nodes.galleryData.options.item.ratio`},{path:`product.description.nodes.imageData.image.duration`},{path:`product.description.nodes.imageData.crop.x`},{path:`product.description.nodes.imageData.crop.y`},{path:`product.description.nodes.imageData.crop.width`},{path:`product.description.nodes.imageData.crop.height`},{path:`product.description.nodes.mapData.mapSettings.lat`},{path:`product.description.nodes.mapData.mapSettings.lng`},{path:`product.description.nodes.pollData.poll.image.duration`},{path:`product.description.nodes.pollData.poll.options.image.duration`},{path:`product.description.nodes.pollData.design.poll.background.image.duration`},{path:`product.description.nodes.appEmbedData.image.duration`},{path:`product.description.nodes.videoData.video.duration`},{path:`product.description.nodes.videoData.thumbnail.duration`},{path:`product.description.nodes.audioData.audio.duration`},{path:`product.description.nodes.audioData.coverImage.duration`},{path:`product.description.nodes.layoutData.backgroundImage.media.duration`},{path:`product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`product.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`product.description.nodes.layoutData.backdropImage.media.duration`},{path:`product.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`product.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`product.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`product.description.nodes.layoutData.background.gradient.centerX`},{path:`product.description.nodes.layoutData.background.gradient.centerY`},{path:`product.description.nodes.layoutData.background.gradient.stops.position`},{path:`product.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`product.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`product.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`product.description.nodes.shapeData.shape.duration`},{path:`product.description.nodes.cardData.background.gradient.centerX`},{path:`product.description.nodes.cardData.background.gradient.centerY`},{path:`product.description.nodes.cardData.background.gradient.stops.position`},{path:`product.description.nodes.cardData.backgroundImage.media.duration`},{path:`product.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`product.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`product.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`product.description.nodes.tocData.fontSize`},{path:`product.description.nodes.tocData.itemSpacing`},{path:`product.description.nodes.smartBlockCellData.shape.duration`},{path:`product.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`product.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`product.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`product.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`product.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`product.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`product.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`product.infoSections.description.nodes.imageData.image.duration`},{path:`product.infoSections.description.nodes.imageData.crop.x`},{path:`product.infoSections.description.nodes.imageData.crop.y`},{path:`product.infoSections.description.nodes.imageData.crop.width`},{path:`product.infoSections.description.nodes.imageData.crop.height`},{path:`product.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`product.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`product.infoSections.description.nodes.pollData.poll.image.duration`},{path:`product.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`product.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`product.infoSections.description.nodes.appEmbedData.image.duration`},{path:`product.infoSections.description.nodes.videoData.video.duration`},{path:`product.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`product.infoSections.description.nodes.audioData.audio.duration`},{path:`product.infoSections.description.nodes.audioData.coverImage.duration`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`product.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`product.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`product.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`product.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`product.infoSections.description.nodes.shapeData.shape.duration`},{path:`product.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`product.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`product.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`product.infoSections.description.nodes.tocData.fontSize`},{path:`product.infoSections.description.nodes.tocData.itemSpacing`},{path:`product.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`product.variantsInfo.variants.physicalProperties.weight`},{path:`product.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`product.minVariantPriceInfo.weight`}]}])}}return t}var hc=(e=>(e.FREE_TEXT=`FREE_TEXT`,e.TEXT_CHOICES=`TEXT_CHOICES`,e.SWATCH_CHOICES=`SWATCH_CHOICES`,e))(hc||{}),gc=(e=>(e.IN_STOCK=`IN_STOCK`,e.OUT_OF_STOCK=`OUT_OF_STOCK`,e.PARTIALLY_OUT_OF_STOCK=`PARTIALLY_OUT_OF_STOCK`,e))(gc||{}),_c=(e=>(e.ALL_VARIANTS=`ALL_VARIANTS`,e.NO_VARIANTS=`NO_VARIANTS`,e.SOME_VARIANTS=`SOME_VARIANTS`,e))(_c||{}),vc=(e=>(e.URL=`URL`,e.CURRENCY=`CURRENCY`,e.INFO_SECTION=`INFO_SECTION`,e.MERCHANT_DATA=`MERCHANT_DATA`,e.PLAIN_DESCRIPTION=`PLAIN_DESCRIPTION`,e.INFO_SECTION_PLAIN_DESCRIPTION=`INFO_SECTION_PLAIN_DESCRIPTION`,e.SUBSCRIPTION_PRICES_INFO=`SUBSCRIPTION_PRICES_INFO`,e.BREADCRUMBS_INFO=`BREADCRUMBS_INFO`,e.WEIGHT_MEASUREMENT_UNIT_INFO=`WEIGHT_MEASUREMENT_UNIT_INFO`,e.VARIANT_OPTION_CHOICE_NAMES=`VARIANT_OPTION_CHOICE_NAMES`,e.MEDIA_ITEMS_INFO=`MEDIA_ITEMS_INFO`,e.DESCRIPTION=`DESCRIPTION`,e.DIRECT_CATEGORIES_INFO=`DIRECT_CATEGORIES_INFO`,e.ALL_CATEGORIES_INFO=`ALL_CATEGORIES_INFO`,e.INFO_SECTION_DESCRIPTION=`INFO_SECTION_DESCRIPTION`,e.THUMBNAIL=`THUMBNAIL`,e.PRODUCT_CHOICES_MEDIA_REFERENCES=`PRODUCT_CHOICES_MEDIA_REFERENCES`,e.PRODUCT_CHOICES_DISPLAY_IMAGE=`PRODUCT_CHOICES_DISPLAY_IMAGE`,e.MIN_PRICE_VARIANT=`MIN_PRICE_VARIANT`,e.DISCOUNT_INFO=`DISCOUNT_INFO`,e))(vc||{});async function yc(e,t){let{httpClient:n,sideEffects:r}=arguments[2],i=mc(it({productId:e,fields:t?.fields},[]));r?.onSiteCall?.();try{let e=await n.request(i);return r?.onSuccess?.(e),j(N(e.data,[{transformFn:Cs,paths:[{path:`product.url`}]},{transformFn:ts,paths:[{path:`product.media.main.image`},{path:`product.media.itemsInfo.items.image`},{path:`product.options.choicesSettings.choices.image`},{path:`product.options.choicesSettings.choices.displayImage`},{path:`product.options.choicesSettings.choices.linkedMedia.image`},{path:`product.modifiers.choicesSettings.choices.image`},{path:`product.modifiers.choicesSettings.choices.displayImage`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`product.variantsInfo.variants.media.image`},{path:`product.variantSummary.minPriceVariant.media.image`}]},{transformFn:Zs,paths:[{path:`product.media.main.video`},{path:`product.media.itemsInfo.items.video`},{path:`product.options.choicesSettings.choices.linkedMedia.video`},{path:`product.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`product.variantsInfo.variants.media.video`},{path:`product.variantSummary.minPriceVariant.media.video`}]}]),[`product.description`,`product.infoSections.description`])?.product}catch(e){let t=P(e,{spreadPathsToArguments:{},explicitPathsToArguments:{productId:`$[0]`,fields:`$[1].fields`},singleArgumentUnchanged:!1},[`productId`,`options`]);throw r?.onError?.(e),t}}({...fs()}),{...Vo()};function bc(e){return(t,n)=>yc(t,n,{httpClient:e})}var xc=b(`wix.stores.catalog.v3.product_created`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.description.metadata.createdTimestamp`},{path:`entity.description.metadata.updatedTimestamp`},{path:`entity.infoSections.description.metadata.createdTimestamp`},{path:`entity.infoSections.description.metadata.updatedTimestamp`},{path:`metadata.eventTime`}]},{transformFn:Cs,paths:[{path:`entity.url`}]},{transformFn:gn,paths:[{path:`entity.physicalProperties.pricePerUnit.quantity`},{path:`entity.physicalProperties.shippingWeightRange.minValue`},{path:`entity.physicalProperties.shippingWeightRange.maxValue`},{path:`entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantsInfo.variants.revenueDetails.profitMargin`},{path:`entity.subscriptionDetails.subscriptions.discount.percentOff`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`entity.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`entity.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.description.nodes.galleryData.items.image.media.duration`},{path:`entity.description.nodes.galleryData.items.video.media.duration`},{path:`entity.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.description.nodes.galleryData.options.item.ratio`},{path:`entity.description.nodes.imageData.image.duration`},{path:`entity.description.nodes.imageData.crop.x`},{path:`entity.description.nodes.imageData.crop.y`},{path:`entity.description.nodes.imageData.crop.width`},{path:`entity.description.nodes.imageData.crop.height`},{path:`entity.description.nodes.mapData.mapSettings.lat`},{path:`entity.description.nodes.mapData.mapSettings.lng`},{path:`entity.description.nodes.pollData.poll.image.duration`},{path:`entity.description.nodes.pollData.poll.options.image.duration`},{path:`entity.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.description.nodes.appEmbedData.image.duration`},{path:`entity.description.nodes.videoData.video.duration`},{path:`entity.description.nodes.videoData.thumbnail.duration`},{path:`entity.description.nodes.audioData.audio.duration`},{path:`entity.description.nodes.audioData.coverImage.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.description.nodes.shapeData.shape.duration`},{path:`entity.description.nodes.cardData.background.gradient.centerX`},{path:`entity.description.nodes.cardData.background.gradient.centerY`},{path:`entity.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.tocData.fontSize`},{path:`entity.description.nodes.tocData.itemSpacing`},{path:`entity.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`entity.infoSections.description.nodes.imageData.image.duration`},{path:`entity.infoSections.description.nodes.imageData.crop.x`},{path:`entity.infoSections.description.nodes.imageData.crop.y`},{path:`entity.infoSections.description.nodes.imageData.crop.width`},{path:`entity.infoSections.description.nodes.imageData.crop.height`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`entity.infoSections.description.nodes.pollData.poll.image.duration`},{path:`entity.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`entity.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.infoSections.description.nodes.appEmbedData.image.duration`},{path:`entity.infoSections.description.nodes.videoData.video.duration`},{path:`entity.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`entity.infoSections.description.nodes.audioData.audio.duration`},{path:`entity.infoSections.description.nodes.audioData.coverImage.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.infoSections.description.nodes.shapeData.shape.duration`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.tocData.fontSize`},{path:`entity.infoSections.description.nodes.tocData.itemSpacing`},{path:`entity.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.variantsInfo.variants.physicalProperties.weight`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`entity.minVariantPriceInfo.weight`}]},{transformFn:ts,paths:[{path:`entity.media.main.image`},{path:`entity.media.itemsInfo.items.image`},{path:`entity.options.choicesSettings.choices.image`},{path:`entity.options.choicesSettings.choices.displayImage`},{path:`entity.options.choicesSettings.choices.linkedMedia.image`},{path:`entity.modifiers.choicesSettings.choices.image`},{path:`entity.modifiers.choicesSettings.choices.displayImage`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`entity.variantsInfo.variants.media.image`},{path:`entity.variantSummary.minPriceVariant.media.image`}]},{transformFn:Zs,paths:[{path:`entity.media.main.video`},{path:`entity.media.itemsInfo.items.video`},{path:`entity.options.choicesSettings.choices.linkedMedia.video`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`entity.variantsInfo.variants.media.video`},{path:`entity.variantSummary.minPriceVariant.media.video`}]}])))(),Sc=b(`wix.stores.catalog.v3.product_deleted`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.description.metadata.createdTimestamp`},{path:`entity.description.metadata.updatedTimestamp`},{path:`entity.infoSections.description.metadata.createdTimestamp`},{path:`entity.infoSections.description.metadata.updatedTimestamp`},{path:`metadata.eventTime`}]},{transformFn:Cs,paths:[{path:`entity.url`}]},{transformFn:gn,paths:[{path:`entity.physicalProperties.pricePerUnit.quantity`},{path:`entity.physicalProperties.shippingWeightRange.minValue`},{path:`entity.physicalProperties.shippingWeightRange.maxValue`},{path:`entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantsInfo.variants.revenueDetails.profitMargin`},{path:`entity.subscriptionDetails.subscriptions.discount.percentOff`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`entity.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`entity.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.description.nodes.galleryData.items.image.media.duration`},{path:`entity.description.nodes.galleryData.items.video.media.duration`},{path:`entity.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.description.nodes.galleryData.options.item.ratio`},{path:`entity.description.nodes.imageData.image.duration`},{path:`entity.description.nodes.imageData.crop.x`},{path:`entity.description.nodes.imageData.crop.y`},{path:`entity.description.nodes.imageData.crop.width`},{path:`entity.description.nodes.imageData.crop.height`},{path:`entity.description.nodes.mapData.mapSettings.lat`},{path:`entity.description.nodes.mapData.mapSettings.lng`},{path:`entity.description.nodes.pollData.poll.image.duration`},{path:`entity.description.nodes.pollData.poll.options.image.duration`},{path:`entity.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.description.nodes.appEmbedData.image.duration`},{path:`entity.description.nodes.videoData.video.duration`},{path:`entity.description.nodes.videoData.thumbnail.duration`},{path:`entity.description.nodes.audioData.audio.duration`},{path:`entity.description.nodes.audioData.coverImage.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.description.nodes.shapeData.shape.duration`},{path:`entity.description.nodes.cardData.background.gradient.centerX`},{path:`entity.description.nodes.cardData.background.gradient.centerY`},{path:`entity.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.tocData.fontSize`},{path:`entity.description.nodes.tocData.itemSpacing`},{path:`entity.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`entity.infoSections.description.nodes.imageData.image.duration`},{path:`entity.infoSections.description.nodes.imageData.crop.x`},{path:`entity.infoSections.description.nodes.imageData.crop.y`},{path:`entity.infoSections.description.nodes.imageData.crop.width`},{path:`entity.infoSections.description.nodes.imageData.crop.height`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`entity.infoSections.description.nodes.pollData.poll.image.duration`},{path:`entity.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`entity.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.infoSections.description.nodes.appEmbedData.image.duration`},{path:`entity.infoSections.description.nodes.videoData.video.duration`},{path:`entity.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`entity.infoSections.description.nodes.audioData.audio.duration`},{path:`entity.infoSections.description.nodes.audioData.coverImage.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.infoSections.description.nodes.shapeData.shape.duration`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.tocData.fontSize`},{path:`entity.infoSections.description.nodes.tocData.itemSpacing`},{path:`entity.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.variantsInfo.variants.physicalProperties.weight`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`entity.minVariantPriceInfo.weight`}]},{transformFn:ts,paths:[{path:`entity.media.main.image`},{path:`entity.media.itemsInfo.items.image`},{path:`entity.options.choicesSettings.choices.image`},{path:`entity.options.choicesSettings.choices.displayImage`},{path:`entity.options.choicesSettings.choices.linkedMedia.image`},{path:`entity.modifiers.choicesSettings.choices.image`},{path:`entity.modifiers.choicesSettings.choices.displayImage`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`entity.variantsInfo.variants.media.image`},{path:`entity.variantSummary.minPriceVariant.media.image`}]},{transformFn:Zs,paths:[{path:`entity.media.main.video`},{path:`entity.media.itemsInfo.items.video`},{path:`entity.options.choicesSettings.choices.linkedMedia.video`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`entity.variantsInfo.variants.media.video`},{path:`entity.variantSummary.minPriceVariant.media.video`}]}])))(),Cc=b(`wix.stores.catalog.v3.product_updated`,!0,e=>j(N(e,[{transformFn:M,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.description.metadata.createdTimestamp`},{path:`entity.description.metadata.updatedTimestamp`},{path:`entity.infoSections.description.metadata.createdTimestamp`},{path:`entity.infoSections.description.metadata.updatedTimestamp`},{path:`metadata.eventTime`},{path:`modifiedFields.createdDate`},{path:`modifiedFields.updatedDate`},{path:`modifiedFields.description.metadata.createdTimestamp`},{path:`modifiedFields.description.metadata.updatedTimestamp`},{path:`modifiedFields.infoSections.description.metadata.createdTimestamp`},{path:`modifiedFields.infoSections.description.metadata.updatedTimestamp`}]},{transformFn:Cs,paths:[{path:`entity.url`},{path:`modifiedFields.url`}]},{transformFn:gn,paths:[{path:`entity.physicalProperties.pricePerUnit.quantity`},{path:`entity.physicalProperties.shippingWeightRange.minValue`},{path:`entity.physicalProperties.shippingWeightRange.maxValue`},{path:`entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantsInfo.variants.revenueDetails.profitMargin`},{path:`entity.subscriptionDetails.subscriptions.discount.percentOff`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`entity.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`entity.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`entity.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.description.nodes.galleryData.items.image.media.duration`},{path:`entity.description.nodes.galleryData.items.video.media.duration`},{path:`entity.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.description.nodes.galleryData.options.item.ratio`},{path:`entity.description.nodes.imageData.image.duration`},{path:`entity.description.nodes.imageData.crop.x`},{path:`entity.description.nodes.imageData.crop.y`},{path:`entity.description.nodes.imageData.crop.width`},{path:`entity.description.nodes.imageData.crop.height`},{path:`entity.description.nodes.mapData.mapSettings.lat`},{path:`entity.description.nodes.mapData.mapSettings.lng`},{path:`entity.description.nodes.pollData.poll.image.duration`},{path:`entity.description.nodes.pollData.poll.options.image.duration`},{path:`entity.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.description.nodes.appEmbedData.image.duration`},{path:`entity.description.nodes.videoData.video.duration`},{path:`entity.description.nodes.videoData.thumbnail.duration`},{path:`entity.description.nodes.audioData.audio.duration`},{path:`entity.description.nodes.audioData.coverImage.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.description.nodes.shapeData.shape.duration`},{path:`entity.description.nodes.cardData.background.gradient.centerX`},{path:`entity.description.nodes.cardData.background.gradient.centerY`},{path:`entity.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.description.nodes.tocData.fontSize`},{path:`entity.description.nodes.tocData.itemSpacing`},{path:`entity.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`entity.infoSections.description.nodes.imageData.image.duration`},{path:`entity.infoSections.description.nodes.imageData.crop.x`},{path:`entity.infoSections.description.nodes.imageData.crop.y`},{path:`entity.infoSections.description.nodes.imageData.crop.width`},{path:`entity.infoSections.description.nodes.imageData.crop.height`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`entity.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`entity.infoSections.description.nodes.pollData.poll.image.duration`},{path:`entity.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`entity.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`entity.infoSections.description.nodes.appEmbedData.image.duration`},{path:`entity.infoSections.description.nodes.videoData.video.duration`},{path:`entity.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`entity.infoSections.description.nodes.audioData.audio.duration`},{path:`entity.infoSections.description.nodes.audioData.coverImage.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.infoSections.description.nodes.shapeData.shape.duration`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.infoSections.description.nodes.tocData.fontSize`},{path:`entity.infoSections.description.nodes.tocData.itemSpacing`},{path:`entity.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`entity.variantsInfo.variants.physicalProperties.weight`},{path:`entity.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`entity.minVariantPriceInfo.weight`},{path:`modifiedFields.physicalProperties.pricePerUnit.quantity`},{path:`modifiedFields.physicalProperties.shippingWeightRange.minValue`},{path:`modifiedFields.physicalProperties.shippingWeightRange.maxValue`},{path:`modifiedFields.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity`},{path:`modifiedFields.variantsInfo.variants.revenueDetails.profitMargin`},{path:`modifiedFields.subscriptionDetails.subscriptions.discount.percentOff`},{path:`modifiedFields.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity`},{path:`modifiedFields.variantSummary.minPriceVariant.revenueDetails.profitMargin`},{path:`modifiedFields.minVariantPriceInfo.pricePerUnitData.settings.quantity`},{path:`modifiedFields.minVariantPriceInfo.revenueDetails.profitMargin`},{path:`modifiedFields.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`modifiedFields.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`modifiedFields.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`modifiedFields.description.nodes.galleryData.items.image.media.duration`},{path:`modifiedFields.description.nodes.galleryData.items.video.media.duration`},{path:`modifiedFields.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`modifiedFields.description.nodes.galleryData.options.item.ratio`},{path:`modifiedFields.description.nodes.imageData.image.duration`},{path:`modifiedFields.description.nodes.imageData.crop.x`},{path:`modifiedFields.description.nodes.imageData.crop.y`},{path:`modifiedFields.description.nodes.imageData.crop.width`},{path:`modifiedFields.description.nodes.imageData.crop.height`},{path:`modifiedFields.description.nodes.mapData.mapSettings.lat`},{path:`modifiedFields.description.nodes.mapData.mapSettings.lng`},{path:`modifiedFields.description.nodes.pollData.poll.image.duration`},{path:`modifiedFields.description.nodes.pollData.poll.options.image.duration`},{path:`modifiedFields.description.nodes.pollData.design.poll.background.image.duration`},{path:`modifiedFields.description.nodes.appEmbedData.image.duration`},{path:`modifiedFields.description.nodes.videoData.video.duration`},{path:`modifiedFields.description.nodes.videoData.thumbnail.duration`},{path:`modifiedFields.description.nodes.audioData.audio.duration`},{path:`modifiedFields.description.nodes.audioData.coverImage.duration`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.media.duration`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.media.duration`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`modifiedFields.description.nodes.layoutData.background.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.background.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.background.gradient.stops.position`},{path:`modifiedFields.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`modifiedFields.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`modifiedFields.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`modifiedFields.description.nodes.shapeData.shape.duration`},{path:`modifiedFields.description.nodes.cardData.background.gradient.centerX`},{path:`modifiedFields.description.nodes.cardData.background.gradient.centerY`},{path:`modifiedFields.description.nodes.cardData.background.gradient.stops.position`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.media.duration`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.description.nodes.tocData.fontSize`},{path:`modifiedFields.description.nodes.tocData.itemSpacing`},{path:`modifiedFields.description.nodes.smartBlockCellData.shape.duration`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.galleryData.items.image.media.duration`},{path:`modifiedFields.infoSections.description.nodes.galleryData.items.video.media.duration`},{path:`modifiedFields.infoSections.description.nodes.galleryData.items.video.thumbnail.duration`},{path:`modifiedFields.infoSections.description.nodes.galleryData.options.item.ratio`},{path:`modifiedFields.infoSections.description.nodes.imageData.image.duration`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.x`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.y`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.width`},{path:`modifiedFields.infoSections.description.nodes.imageData.crop.height`},{path:`modifiedFields.infoSections.description.nodes.mapData.mapSettings.lat`},{path:`modifiedFields.infoSections.description.nodes.mapData.mapSettings.lng`},{path:`modifiedFields.infoSections.description.nodes.pollData.poll.image.duration`},{path:`modifiedFields.infoSections.description.nodes.pollData.poll.options.image.duration`},{path:`modifiedFields.infoSections.description.nodes.pollData.design.poll.background.image.duration`},{path:`modifiedFields.infoSections.description.nodes.appEmbedData.image.duration`},{path:`modifiedFields.infoSections.description.nodes.videoData.video.duration`},{path:`modifiedFields.infoSections.description.nodes.videoData.thumbnail.duration`},{path:`modifiedFields.infoSections.description.nodes.audioData.audio.duration`},{path:`modifiedFields.infoSections.description.nodes.audioData.coverImage.duration`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.media.duration`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.media.duration`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.background.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.shapeData.shape.duration`},{path:`modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.cardData.background.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.media.duration`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.infoSections.description.nodes.tocData.fontSize`},{path:`modifiedFields.infoSections.description.nodes.tocData.itemSpacing`},{path:`modifiedFields.infoSections.description.nodes.smartBlockCellData.shape.duration`},{path:`modifiedFields.variantsInfo.variants.physicalProperties.weight`},{path:`modifiedFields.variantSummary.minPriceVariant.physicalProperties.weight`},{path:`modifiedFields.minVariantPriceInfo.weight`}]},{transformFn:ts,paths:[{path:`entity.media.main.image`},{path:`entity.media.itemsInfo.items.image`},{path:`entity.options.choicesSettings.choices.image`},{path:`entity.options.choicesSettings.choices.displayImage`},{path:`entity.options.choicesSettings.choices.linkedMedia.image`},{path:`entity.modifiers.choicesSettings.choices.image`},{path:`entity.modifiers.choicesSettings.choices.displayImage`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`entity.variantsInfo.variants.media.image`},{path:`entity.variantSummary.minPriceVariant.media.image`},{path:`modifiedFields.media.main.image`},{path:`modifiedFields.media.itemsInfo.items.image`},{path:`modifiedFields.options.choicesSettings.choices.image`},{path:`modifiedFields.options.choicesSettings.choices.displayImage`},{path:`modifiedFields.options.choicesSettings.choices.linkedMedia.image`},{path:`modifiedFields.modifiers.choicesSettings.choices.image`},{path:`modifiedFields.modifiers.choicesSettings.choices.displayImage`},{path:`modifiedFields.modifiers.choicesSettings.choices.linkedMedia.image`},{path:`modifiedFields.variantsInfo.variants.media.image`},{path:`modifiedFields.variantSummary.minPriceVariant.media.image`}]},{transformFn:Zs,paths:[{path:`entity.media.main.video`},{path:`entity.media.itemsInfo.items.video`},{path:`entity.options.choicesSettings.choices.linkedMedia.video`},{path:`entity.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`entity.variantsInfo.variants.media.video`},{path:`entity.variantSummary.minPriceVariant.media.video`},{path:`modifiedFields.media.main.video`},{path:`modifiedFields.media.itemsInfo.items.video`},{path:`modifiedFields.options.choicesSettings.choices.linkedMedia.video`},{path:`modifiedFields.modifiers.choicesSettings.choices.linkedMedia.video`},{path:`modifiedFields.variantsInfo.variants.media.video`},{path:`modifiedFields.variantSummary.minPriceVariant.media.video`}]}])))(),wc=Bt(bc);F(xc),F(Sc),F(Cc);function Tc(e){return Dc(e)??99999}function Ec(e,t){return Math.min(e,Math.max(t,1))}function Dc(e){if(!e||!e.trackQuantity)return;let{availabilityStatus:t,inventoryQuantity:n,preorderInfo:r}=e,i=t===`PREORDER`?r?.quantity:n;if(i!=null)return Math.max(0,i)}function Oc(e){let{availabilityStatus:t,preorderAvailability:n}=e??{},r=t!==gc.OUT_OF_STOCK;return{isInStock:r,isPreOrderState:n===_c.ALL_VARIANTS||n===_c.SOME_VARIANTS&&!r}}function kc(e,t){return t?{isInStock:t.availabilityStatus===Y.IN_STOCK,isPreOrderState:t.availabilityStatus===Y.PREORDER}:Oc(e.inventory)}function Ac(e,t){return n(()=>{let{isInStock:n,isPreOrderState:r}=kc(e,t);return{isInStock:n,isPreOrderState:r,preOrderMessage:r?t?.preorderInfo?.message:void 0,remainingItemCount:Dc(t)}},[e.inventory,t])}function jc(e){return{type:`image`,src:e.url,width:e.width,height:e.height,...e.name===void 0?{}:{title:e.name},...e.alt===void 0?{}:{parameters:{alt:e.alt}}}}var Mc=`11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png`,Nc={uri:Mc,url:`https://static.wixstatic.com/media/${Mc}`,width:460,height:460},Pc=[jc(Nc)];function Fc(e,t,n){let r=Rc(e,Ic(e,t,n));return r.length>0?r:e.media??[]}function Ic(e,t,n){let r=e.options.flatMap(e=>Lc(e.choices,t[e.id])),i=Object.values(e.modifiers).flatMap(e=>Lc(e.choices,n[e.id]));return[...new Set([...r,...i])]}function Lc(e,t){return e?.find(e=>e.choiceId===t)?.mediaIds??[]}function Rc(e,t){let n=new Map((e.media??[]).map(e=>[e.id,e]));return t.flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function zc(e){return e.map(e=>e.id).join(`|`)}function Bc(e){return e.length>0?e.map(e=>e.media):Pc}function Vc({product:e,selectedOptions:i,selectedModifiers:a}){let o=n(()=>Bc(e.media??[]),[e.media]),s=e.mainMedia??Nc,c=n(()=>Fc(e,i,a),[e,i,a]),l=n(()=>Bc(c),[c]),u=zc(c),[d,f]=r(u),[p,m]=r(0);d!==u&&(f(u),m(0));let h=t(e=>m(e),[]);return n(()=>({allMedia:o,mainMedia:s,media:l,selectedMediaIndex:p,selectMedia:h}),[o,s,l,p,h])}function Hc(e){return Object.entries(e).map(([e,t])=>({optionId:e,choiceId:t}))}function Uc(e){return Object.entries(e).map(([e,t])=>({modifierId:e,value:t}))}function Wc(e,t,r,i=!1){let{selectedVariant:a}=t,o=Xs(e,a),s=Ac(e,a),c=Vc({product:e,selectedOptions:t.selectedOptions,selectedModifiers:t.selectedModifiers}),l=Ys(e,a),{getPageAbsoluteUrl:u}=ri(),d=n(()=>{if(!e.slug)return;let t=u(H.PRODUCT_PAGE,e.slug);return t?{href:t}:void 0},[e.slug,u]);return n(()=>{let{selectedVariant:e,setHasAttemptedSubmit:n,isSelectionValid:a,selectedOptions:u,selectedModifiers:f,selectedSubscriptionPlanId:p,quantity:m,productGrouping:h,...g}=t;return{...o,link:d,...r,...g,buyerSelections:{options:Hc(u),modifiers:Uc(f),subscriptionPlanId:p,quantity:m},...s,...c,...l,isBackInStockEnabled:i}},[o,d,r,t,s,c,l,i])}var Gc=`one-time`,Kc=V(`@wix/site-service-locale`),qc=V,Jc=qc(`@wix/viewer-service-multilingual`);function Yc(){let e=c(),t=l(Kc),n;try{n=e(Jc)}catch{}return n?.multilingualEnabled&&n.currentLocale?.regionalFormat||t.locale}var Xc=e=>{let t=e?.maximumFractionDigits??2;return(e=>e?.toFixed(t))},Zc=(e,t,n)=>{let r=new Intl.NumberFormat(t,{style:`currency`,currency:e,...n});return(e=>{if(e!=null)return r.format(e)})};function Qc(e,t,n){return e?Zc(e,t,n):Xc(n)}function $c(e,t){let r=Yc();return n(()=>Qc(e,r,t),[e,r,t])}function X(e,t){return e===void 0?void 0:{amount:e,formattedAmount:t(e)}}function el(e,t,n){return{id:e.id,name:e.name,isOneTimePurchase:!1,description:e.description,currentPrice:X(t.currentSellingPrice,n),originalPrice:X(t.priceBeforeDiscount,n),frequency:e.frequency,interval:e.interval,duration:e.billingCycles}}function tl(e){return e===void 0?void 0:{description:e.description}}function nl(e,t){return{currentSellingPrice:X(e.currentSellingPrice,t),priceBeforeDiscount:X(e.priceBeforeDiscount,t),pricePerUnit:tl(e.pricePerUnit)}}function rl(e,t){return{minCurrentSellingPrice:X(e.minCurrentSellingPrice,t),maxCurrentSellingPrice:X(e.maxCurrentSellingPrice,t),minPriceBeforeDiscount:X(e.minPriceBeforeDiscount,t),maxPriceBeforeDiscount:X(e.maxPriceBeforeDiscount,t),minPricePerUnit:tl(e.minPricePerUnit),maxPricePerUnit:tl(e.maxPricePerUnit)}}function il(e,t,n,r){if(e.length===0)return[];let i=e.map(({subscription:e,price:t})=>el(e,t,r));return t?[{id:Gc,name:`One-time purchase`,isOneTimePurchase:!0,currentPrice:X(n.currentSellingPrice,r)},...i]:i}function al({product:e,userInputs:t,hasLoadedVariants:r}){let{selectedVariant:i,selectedSubscriptionPlanId:a}=t,o=$c(e.currency);return n(()=>{let t=To(e,i,r),n={...nl(Eo(t,a),o),...rl(t.productPriceRange,o)},s=il(t.subscriptionPlanPrices,e.subscriptionDetails.allowOneTimePurchases,t.productPrice,o);return{currency:e.currency,pricing:n,subscriptionPlans:s}},[e,i,a,r,o])}var ol=function(e){return e.PRODUCT_BY_SLUG=`product-by-slug`,e.PRODUCT_BY_ID=`product-by-id`,e.PRODUCT_ITEM=`product-item`,e}({});function sl(e){let{isInStock:t,isPreOrderState:n}=Oc(e);return n?Y.PREORDER:t?Y.IN_STOCK:Y.OUT_OF_STOCK}function cl(e){let{minPriceVariant:t}=e,n=e.options.length===0||e.options.length===1&&e.options[0].choices.length===1;return!t||!n?{variants:[],inventoryItems:[]}:{variants:[t],inventoryItems:[{variantId:t.id,availabilityStatus:sl(e.inventory),trackQuantity:!1}]}}var ll=e=>Number.parseFloat(e?.amount),ul=e=>e?.amount==null?void 0:ll(e);function dl(e){return e.filter(e=>e.visible!==!1).map(fl)}var fl=e=>{let t=Object.fromEntries((e.choices??[]).map(e=>{let t=e.optionChoiceIds;return[t?.optionId,t?.choiceId]}));return{id:e._id,sku:e.sku??void 0,choices:t,price:ml(e),subscriptionPrices:hl(e)}};function pl(e){return e?.description==null?void 0:{description:e.description}}var ml=e=>{let t=e.price;return{actualPrice:ll(t?.actualPrice),compareAtPrice:ul(t?.compareAtPrice),priceAfterDiscount:ul(t?.priceAfterDiscount),pricePerUnit:pl(e.physicalProperties?.pricePerUnit)}},hl=e=>(e.subscriptionPricesInfo?.subscriptionPrices??[]).map(e=>({subscriptionId:e.subscriptionId,price:ll(e.price)}));function gl(e){return e.map(e=>({variantId:e.variantId??``,availabilityStatus:e.availabilityStatus,quantity:e.quantity??void 0,trackQuantity:e.trackQuantity??!1,preorderInfo:e.preorderInfo?{message:e.preorderInfo.message??void 0,quantity:e.preorderInfo.quantity??void 0}:void 0}))}async function _l(e,t){return gl((await dc().eq(`productId`,e).eq(`locationId`,t).find()).items??[])}var vl=[vc.SUBSCRIPTION_PRICES_INFO,vc.DISCOUNT_INFO];async function yl(e,t){let[n,r]=await Promise.all([wc(e,{fields:vl}),_l(e,t)]);return{variants:dl(n.variantsInfo?.variants??[]),inventoryItems:r}}function bl(){let e=c(),t=l(Kc),n;try{n=e(Jc)}catch{}return n?.multilingualEnabled&&n.currentLocale?.languageCode||t.language}function xl(e,n){let i=bl(),[a,o]=r(!1),{data:s,isFetching:c}=Qr({queryKey:[`product-variants`,i,e,n],queryFn:()=>yl(e,n),enabled:a,staleTime:1/0,retry:!1});return{variantsData:s,isLoadingVariants:c,requestVariants:t(()=>{o(!0)},[])}}function Sl(e,t,r){let{variantsData:i,isLoadingVariants:a,requestVariants:o}=xl(e.id,t),{variants:s,inventoryItems:c}=n(()=>i??cl(e),[i,e]);return{product:n(()=>({...e,variants:s}),[e,s]),inventoryItems:c,productGroupData:r,hasLoadedVariants:n(()=>i!==void 0,[i]),isLoadingVariants:a,requestVariants:o}}var Cl={type:`invalid-purchase`,message:`This item can't be purchased.`};function wl(e){let t=e;return{type:`cart`,message:t?.message,details:t?.details}}var Tl=V(`@wix/site-service-lightbox`),El=V(`@wix/site-service-router`),Dl=V(`@wix/site-service-editor-context`),Ol=V(`@wix/site-service-pages`),kl=e=>{if(!e)return``;let t=new URLSearchParams(e).toString();return t?`?${t}`:``},Al=(e,t,n)=>{let r=`./${e.replace(/^\//,``)}`;return n?r:new URL(r,`${t.replace(/\/$/,``)}/`).href},jl=()=>{let{navigateTo:e}=l(El),{open:n}=l(Tl),r=l($r),i=l(Dl),a=l(Ol),{getPageRelativeUrl:o,getPageAbsoluteUrl:s}=ri();return{navigateToPage:t(async(t,n)=>{try{let a=r.appSectionRelativeUrl(ti,t);if(!a)return!1;let o=`${a}${kl(n)}`;return await e({href:Al(o,r.siteUrl,i.previewMode)}),!0}catch{return!1}},[e,r,i]),navigateToProductPage:t(async t=>{try{let n=i.previewMode?o(H.PRODUCT_PAGE,t):s(H.PRODUCT_PAGE,t);if(!n)throw Error(`Failed to resolve app section relative URL for the product page`);await e({href:n})}catch(e){console.error(`navigateToProductPage: failed to navigate to product "${t}"`,e)}},[e,i,o,s]),openLightbox:t(async e=>{try{let t=ni[e],r=Object.entries(a.pages).find(([,n])=>n.popup&&(n.appPageId===e||n.appPageId===t))?.[0];return r?(await n({pageId:r}),!0):!1}catch{return!1}},[n,a])}};async function Ml(e){await Is({catalogItems:[e]})}var Nl=qc(`@wix/site-service-public-api-caller`),Pl=()=>{let e=c();return{reloadCart:t(async()=>{if(typeof window<`u`)try{await e(Nl).callPublicApi(ti,`cart.reloadCart`,[])}catch{}},[e])}},Z=function(e){return e.IDLE=`idle`,e.IN_PROGRESS=`in-progress`,e.SUCCESS=`success`,e}({}),Fl=function(e){return e.NONE=`none`,e.NAVIGATE_TO_CART=`navigate-to-cart`,e.OPEN_SIDE_CART=`open-side-cart`,e}({}),Il=()=>{let[e,n]=r(Z.IDLE),{navigateToPage:i,openLightbox:a}=jl(),{reloadCart:o}=Pl(),s=t(async e=>{switch(e){case Fl.NAVIGATE_TO_CART:await i(H.CART);return;case Fl.OPEN_SIDE_CART:await a(H.SIDE_CART);return;case Fl.NONE:default:return}},[i,a]);return{addToCart:t(async(e,t)=>{n(Z.IN_PROGRESS);try{await Ml(e)}catch(e){return n(Z.IDLE),{ok:!1,error:wl(e)}}try{await o(),n(Z.SUCCESS),await s(t),setTimeout(()=>n(Z.IDLE),2e3)}catch{n(Z.IDLE)}return{ok:!0}},[o,s]),addToCartState:e,reloadCart:o}};async function Ll(e){let t=await As({cart:{source:{channelType:Ds.WEB}},catalogItems:[e]});if(!t._id)throw Error(`missing checkout id`);return t._id}var Rl=function(e){return e.IDLE=`idle`,e.IN_PROGRESS=`in-progress`,e}({}),zl=()=>{let{navigateToPage:e}=jl(),[n,i]=r(Rl.IDLE);return{buyNowState:n,buyNow:t(async t=>{i(Rl.IN_PROGRESS);try{let n=await Ll(t);return await e(H.CHECKOUT,{checkoutId:n})?{ok:!0}:{ok:!1,error:wl(Error(`Failed to navigate to checkout`))}}catch(e){return{ok:!1,error:wl(e)}}finally{i(Rl.IDLE)}},[e])}};function Bl(e){let{product:t,selectedVariant:n,userSelections:r,isPreOrder:i}=e;return{catalogReference:{appId:ei,catalogItemId:t.id,options:Vl({product:t,selectedVariant:n,userSelections:r,isPreOrder:i})},quantity:r.quantity}}var Vl=({product:e,selectedVariant:t,userSelections:n,isPreOrder:r})=>{let i=Hl(e,t.choices),{choiceBasedModifiers:a,customTextFields:o}=Ul(e,n.selectedModifiers),s={...i,...a},{selectedSubscriptionPlanId:c}=n,l={variantId:t.id,options:s};return Object.keys(o).length>0&&(l.customTextFields=o),Wl(c)&&(l.subscriptionOptionId=c),r&&(l.preOrderRequested=!0),l},Hl=(e,t)=>{let n={};for(let[r,i]of Object.entries(t)){let t=e.options.find(e=>e.id===r),a=t?.choices.find(e=>e.choiceId===i);t&&a&&(n[t.key]=a.key)}return n},Ul=(e,t)=>{let n={},r={};for(let i of Object.values(e.modifiers))if(i.modifierRenderType===hc.FREE_TEXT){let e=i.freeTextSettings?.key;e&&(r[e]=t[i.id]??``)}else{let e=t[i.id],r=i.choices?.find(t=>t.choiceId===e);r&&(n[i.key]=r.key)}return{choiceBasedModifiers:n,customTextFields:r}},Wl=e=>e!==void 0&&e!==`one-time`;function Gl(e,r,i){let{selectedVariant:a,selectedModifiers:o,selectedSubscriptionPlanId:s,quantity:c,isSelectionValid:l,setHasAttemptedSubmit:u}=r,{addToCart:d,addToCartState:f}=Il(),{buyNow:p,buyNowState:m}=zl(),h=i.isPreOrderState||i.isInStock,g=t(async t=>!h||(u(!0),!l||!a)?{ok:!1,error:Cl}:d(Bl({product:e,selectedVariant:a,userSelections:{selectedModifiers:o,selectedSubscriptionPlanId:s,quantity:c},isPreOrder:i.isPreOrderState}),t??Fl.NONE),[h,i.isPreOrderState,l,u,e,a,o,s,c,d]),_=t(async()=>!h||(u(!0),!l||!a)?{ok:!1,error:Cl}:p(Bl({product:e,selectedVariant:a,userSelections:{selectedModifiers:o,selectedSubscriptionPlanId:s,quantity:c},isPreOrder:i.isPreOrderState})),[h,i.isPreOrderState,l,u,e,a,o,s,c,p]);return n(()=>({addToCartState:f,buyNowState:m,handleAddToCart:g,handleBuyNow:_}),[f,m,g,_])}var Kl=(e,t)=>e.every(e=>!e.mandatory||ql(e,t[e.id])),ql=(e,t)=>e.modifierRenderType===hc.FREE_TEXT?!!t:e.choices?.some(e=>e.choiceId===t),Q=function(e){return e.DIRECT_ADD=`direct-add`,e.NAVIGATE_TO_PRODUCT_PAGE=`navigate-to-product-page`,e}({});function Jl(e,t){return Yl(e,t)?Q.NAVIGATE_TO_PRODUCT_PAGE:Q.DIRECT_ADD}var Yl=(e,t)=>e.subscriptionDetails.subscriptions.length>0||!Xl(e,t),Xl=(e,t)=>e.options.length===0&&Object.keys(e.modifiers).length===0||t.selectedVariant!==null&&Kl(Object.values(t.modifiers),t.selectedModifiers);function Zl(e,r){let{navigateToProductPage:i}=jl(),{addToCartState:a,buyNowState:o,handleAddToCart:s,handleBuyNow:c}=Gl(e,r,Ac(e,r.selectedVariant)),l=Jl(e,r),u=t(async()=>e.slug?(await i(e.slug),{ok:!0}):{ok:!1,error:Cl},[e.slug,i]),d=t(e=>{switch(l){case Q.DIRECT_ADD:return s(e);case Q.NAVIGATE_TO_PRODUCT_PAGE:return u()}},[l,s,u]),f=t(()=>{switch(l){case Q.DIRECT_ADD:return c();case Q.NAVIGATE_TO_PRODUCT_PAGE:return u()}},[l,c,u]);return n(()=>({addToCartState:a,buyNowState:o,handleAddToCart:d,handleBuyNow:f}),[a,o,d,f])}function Ql(e){return Object.values(e).toSorted().join(`_`)}function $l(e){let t=new Map;for(let n of e)t.set(Ql(n.choices),n);return t}function eu(e,t,n){let r=Object.keys(n).length>0,i={};for(let a of e){i[a.id]={};for(let e of a.choices){if(!r){i[a.id][e.choiceId]={isInStock:e.inStock??!0,isVisible:e.visible??!0};continue}if(e.inStock===!1&&e.visible===!1){i[a.id][e.choiceId]={isInStock:!1,isVisible:!1};continue}let{isInStock:o,isVisible:s}=tu({...n,[a.id]:e.choiceId},t);i[a.id][e.choiceId]={isInStock:o,isVisible:s}}}return i}function tu(e,t){let n=!1,r=!1;for(let i of t.values())if(Object.entries(e).every(([e,t])=>i.choices[e]===t)&&(r=!0,(i.availabilityStatus===Y.IN_STOCK||i.availabilityStatus===Y.PREORDER)&&(n=!0),n))break;return{isInStock:n,isVisible:r}}function nu(e,t){let n=new Map;for(let e of t)n.set(e.variantId,e);return e.map(e=>{let t=n.get(e.id);return{...e,availabilityStatus:t?.availabilityStatus,preorderInfo:t?.preorderInfo,inventoryQuantity:t?.quantity,trackQuantity:t?.trackQuantity}})}function ru({product:e,selections:t,selectedVariant:n}){let r={options:iu(e.options,t.selectedOptions,n),modifiers:ou(e.modifiers,t.selectedModifiers),quantity:au(t.quantity,n),subscriptionPlanId:su(e.subscriptionDetails,t.selectedSubscriptionPlanId)};return{valid:Object.values(r.options).length===0&&Object.values(r.modifiers).length===0&&!r.quantity&&!r.subscriptionPlanId,fields:r}}function iu(e,t,n){if(n!==null)return{};let r={};for(let n of e)t[n.id]||(r[n.id]=`missing`);return r}function au(e,t){if(e<1)return`below-min`;if(e>Tc(t))return`above-max`}function ou(e,t){let n=Object.values(e).filter(e=>e.mandatory&&!ql(e,t[e.id]));return Object.fromEntries(n.map(e=>[e.id,`missing`]))}function su(e,t){if(e.subscriptions.length!==0)return t?t===`one-time`?e.allowOneTimePurchases?void 0:`missing`:cu(e,t)?void 0:`missing`:`missing`}function cu(e,t){return e.subscriptions.some(e=>e.id===t)}var $=function(e){return e.PRODUCT_OPTION=`PRODUCT_OPTION`,e.MODIFIER=`MODIFIER`,e}({});function lu(e,t){if(!t)return;let n=t.members.find(t=>t.productId===e.id);if(!n)return;let r={groupingCustomizationId:t.groupingCustomizationId,currentProductChoiceId:n.choice.choiceId,members:t.members};if(t.customizationType===$.PRODUCT_OPTION)return e.options.find(({id:e})=>e===t.groupingCustomizationId)?{...r,customizationType:$.PRODUCT_OPTION}:void 0;if(e.modifiers[t.groupingCustomizationId])return{...r,customizationType:$.MODIFIER}}function uu(e,t){return e.members.find(e=>e.choice.choiceId===t)}function du(e,t,n){return!!e&&t===e.groupingCustomizationId&&n!==e.currentProductChoiceId}function fu(e,t){if(!t)return;if(t.customizationType===$.PRODUCT_OPTION){let n=e.options.find(({id:e})=>e===t.groupingCustomizationId);if(!n)return;let r=pu(n,t);return{options:e.options.map(e=>e.id===n.id?r:e)}}let n=e.modifiers[t.groupingCustomizationId];if(!n)return;let r=mu(n,t);return{modifiers:{...e.modifiers,[t.groupingCustomizationId]:r}}}function pu(e,t){return{...e,isGroupedOption:!0,choices:t.members.map(e=>({...e.choice,inStock:e.inventoryAvailabilityStatus!==`OUT_OF_STOCK`}))}}function mu(e,t){return{...e,choices:t.members.map(({choice:e})=>e)}}function hu(e,t){if(!t||t.customizationType!==$.PRODUCT_OPTION)return e;let n=Object.fromEntries(t.members.map(e=>[e.choice.choiceId,{isInStock:e.inventoryAvailabilityStatus!==`OUT_OF_STOCK`,isVisible:!0}]));return{...e,[t.groupingCustomizationId]:{...n,...e[t.groupingCustomizationId]}}}function gu(e,r){let i=n(()=>lu(e,r?.productGroup),[e,r?.productGroup]);return{productGrouping:i,selectGroupSiblingChoice:t(e=>{if(!i||e===i.currentProductChoiceId)return;let t=uu(i,e);t&&r?.selectProductGroupMember(t.productId)},[i,r?.selectProductGroupMember]),productCustomizations:n(()=>fu(e,i),[e,i]),addGroupChoicesAvailability:t(e=>hu(e,i),[i]),initialSelection:n(()=>{if(!i)return{options:{},modifiers:{}};let{customizationType:t,groupingCustomizationId:n,currentProductChoiceId:r}=i;if(t===$.MODIFIER&&e.modifiers[n].mandatory===!1)return{options:{},modifiers:{}};let a={[n]:r};return t===$.PRODUCT_OPTION?{options:a,modifiers:{}}:{options:{},modifiers:a}},[i,e.modifiers])}}function _u({product:e,inventoryItems:i,productGroupData:a,hasLoadedVariants:o=!0}){let s=gu(e,a),{productGrouping:c,selectGroupSiblingChoice:l,addGroupChoicesAvailability:u}=s,[d,f]=r(()=>s.initialSelection.options),[p,m]=r(()=>s.initialSelection.modifiers),[h,g]=r(void 0),[_,v]=r(1),[y,b]=r(!1),x=n(()=>$l(nu(e.variants,i)),[e.variants,i]),S=n(()=>{let t=new Map;return n=>{let r=Ql(n),i=t.get(r);if(i)return i;let a=u(eu(e.options,x,n));return t.set(r,a),a}},[x,e.options,u])(o?d:{}),C=n(()=>Object.keys(d).length===e.options.length?x.get(Ql(d))??null:null,[x,d,e.options.length]),w=t((e,t)=>{if(d[e]!==t){if(du(c,e,t)){l(t);return}f(n=>({...n,[e]:t})),v(1)}},[d,c,l]),T=t((e,t)=>{if(du(c,e,t)){l(t);return}m(n=>n[e]===t?n:{...n,[e]:t})},[c,l]),E=t(e=>{m(t=>{if(!(e in t))return t;let{[e]:n,...r}=t;return r})},[]),D=t(e=>{g(e)},[]),O=n(()=>Tc(C),[C]),k=n(()=>Ec(_,O),[_,O]),ee=t(e=>{v(e)},[]),te=n(()=>ru({product:e,selections:{selectedOptions:d,selectedModifiers:p,selectedSubscriptionPlanId:h,quantity:k},selectedVariant:C}),[e,d,p,h,k,C]),ne=s.productCustomizations?.options??e.options,re=s.productCustomizations?.modifiers??e.modifiers;return n(()=>({options:ne,modifiers:re,quantity:k,selectedOptions:d,selectedModifiers:p,selectedSubscriptionPlanId:h,selectedVariant:C,selectedVariantId:C?.id??null,selectionsAvailability:S,maxPurchasableQuantity:O,isSelectionValid:te.valid,selectionValidationErrors:te.fields,hasAttemptedSubmit:y,setHasAttemptedSubmit:b,selectOption:w,selectModifier:T,clearModifierSelection:E,selectSubscriptionPlan:D,selectQuantity:ee,productGrouping:c}),[ne,re,k,d,p,h,C,S,O,te,y,w,T,E,D,ee,c])}function vu({product:e,inventoryItems:r,productGroupData:i,hasLoadedVariants:a,requestVariants:o}){let s=_u({product:e,inventoryItems:r,productGroupData:i,hasLoadedVariants:a}),{selectOption:c,selectModifier:l,selectSubscriptionPlan:u,selectQuantity:d,productGrouping:f,...p}=s,m=t((e,t)=>{du(f,e,t)||o(),c(e,t)},[o,c,f]),h=t((e,t)=>{du(f,e,t)||o(),l(e,t)},[o,l,f]),g=t(e=>{o(),d(e)},[o,d]);return n(()=>({...p,productGrouping:f,selectOption:m,selectModifier:h,selectSubscriptionPlan:u,selectQuantity:g}),[s,m,h,u,g])}var yu={subscriptionPlans:null,description:null,infoSections:null};function bu(){return s()}function xu({product:e,defaultLocationId:t,productGroupData:r}){let i=Sl(e,t,r),a=vu(i),o=Zl(i.product,a),s=al({product:i.product,userInputs:a,hasLoadedVariants:i.hasLoadedVariants}),c=Wc(i.product,a,s);return n(()=>({source:ol.PRODUCT_ITEM,...c,...o,...yu}),[c,o])}function Su({productItem:e,children:t}){let n=xu(e);return a(o,{value:n,children:t})}function Cu({productItem:e,children:t}){let[n]=r(()=>new Fr);return e===void 0?a(i,{children:t}):a(Rr,{client:n,children:a(Su,{productItem:e,children:t},e.product.id)})}var wu=Mn(`890cc5ff-b951-47bc-86ed-4dc139f4ff0d`);export{Cu as ProductItemContextProvider,Cu as default,wu as injectAccessTokenGetter,bu as useProductItemContext,xu as useProductItemContextValue};
2
+ //# sourceMappingURL=context-provider-890cc5ff-b951-47bc-86ed-4dc139f4ff0d-Cboe183t.js.map