@wix/stores 1.0.977 → 1.0.979

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 (64) hide show
  1. package/build/cjs/context-category-by-id.js +219 -208
  2. package/build/cjs/context-category-by-id.js.map +1 -1
  3. package/build/cjs/context-category-by-slug.js +1203 -1192
  4. package/build/cjs/context-category-by-slug.js.map +1 -1
  5. package/build/cjs/context-category-info.js +259 -249
  6. package/build/cjs/context-category-info.js.map +1 -1
  7. package/build/cjs/context-category-list.js +1 -1
  8. package/build/cjs/context-category-list.js.map +1 -1
  9. package/build/cjs/context-product-by-id.js +40 -32
  10. package/build/cjs/context-product-by-id.js.map +1 -1
  11. package/build/cjs/context-product-by-slug.js +49 -41
  12. package/build/cjs/context-product-by-slug.js.map +1 -1
  13. package/build/cjs/context-product-item.js +1043 -1035
  14. package/build/cjs/context-product-item.js.map +1 -1
  15. package/build/cjs/context-product-list.js +1 -1
  16. package/build/cjs/context-product-list.js.map +1 -1
  17. package/build/cjs/context-product.js +1 -1
  18. package/build/cjs/context-product.js.map +1 -1
  19. package/build/cjs/context-promotion-item.js +1 -1
  20. package/build/cjs/context-promotion-item.js.map +1 -1
  21. package/build/es/context-category-by-id.mjs +219 -208
  22. package/build/es/context-category-by-id.mjs.map +1 -1
  23. package/build/es/context-category-by-slug.mjs +1203 -1192
  24. package/build/es/context-category-by-slug.mjs.map +1 -1
  25. package/build/es/context-category-info.mjs +263 -253
  26. package/build/es/context-category-info.mjs.map +1 -1
  27. package/build/es/context-category-list.mjs +1 -1
  28. package/build/es/context-category-list.mjs.map +1 -1
  29. package/build/es/context-product-by-id.mjs +40 -32
  30. package/build/es/context-product-by-id.mjs.map +1 -1
  31. package/build/es/context-product-by-slug.mjs +49 -41
  32. package/build/es/context-product-by-slug.mjs.map +1 -1
  33. package/build/es/context-product-item.mjs +1043 -1035
  34. package/build/es/context-product-item.mjs.map +1 -1
  35. package/build/es/context-product-list.mjs +1 -1
  36. package/build/es/context-product-list.mjs.map +1 -1
  37. package/build/es/context-product.mjs +1 -1
  38. package/build/es/context-product.mjs.map +1 -1
  39. package/build/es/context-promotion-item.mjs +1 -1
  40. package/build/es/context-promotion-item.mjs.map +1 -1
  41. package/{_sdk-exports → context-runtime}/context-category-by-id/runtime.js +2 -2
  42. package/context-runtime/context-category-by-slug/runtime.js +2 -0
  43. package/context-runtime/context-category-info/runtime.js +2 -0
  44. package/{_sdk-exports → context-runtime}/context-product-by-id/runtime.js +2 -2
  45. package/{_sdk-exports → context-runtime}/context-product-by-slug/runtime.js +2 -2
  46. package/context-runtime/context-product-item/runtime.js +2 -0
  47. package/package.json +4 -4
  48. package/_sdk-exports/context-category-by-slug/runtime.js +0 -2
  49. package/_sdk-exports/context-category-info/runtime.js +0 -2
  50. package/_sdk-exports/context-product-item/runtime.js +0 -2
  51. /package/{_sdk-exports → context-runtime}/context-category-by-id/runtime.d.ts +0 -0
  52. /package/{_sdk-exports → context-runtime}/context-category-by-slug/runtime.d.ts +0 -0
  53. /package/{_sdk-exports → context-runtime}/context-category-info/runtime.d.ts +0 -0
  54. /package/{_sdk-exports → context-runtime}/context-category-list/runtime.d.ts +0 -0
  55. /package/{_sdk-exports → context-runtime}/context-category-list/runtime.js +0 -0
  56. /package/{_sdk-exports → context-runtime}/context-product/runtime.d.ts +0 -0
  57. /package/{_sdk-exports → context-runtime}/context-product/runtime.js +0 -0
  58. /package/{_sdk-exports → context-runtime}/context-product-by-id/runtime.d.ts +0 -0
  59. /package/{_sdk-exports → context-runtime}/context-product-by-slug/runtime.d.ts +0 -0
  60. /package/{_sdk-exports → context-runtime}/context-product-item/runtime.d.ts +0 -0
  61. /package/{_sdk-exports → context-runtime}/context-product-list/runtime.d.ts +0 -0
  62. /package/{_sdk-exports → context-runtime}/context-product-list/runtime.js +0 -0
  63. /package/{_sdk-exports → context-runtime}/context-promotion-item/runtime.d.ts +0 -0
  64. /package/{_sdk-exports → context-runtime}/context-promotion-item/runtime.js +0 -0
@@ -0,0 +1,2 @@
1
+ import{Suspense as e,createContext as t,useCallback as n,useContext as r,useMemo as i}from"react";import{useGetService as a,useService as o}from"@wix/services-manager-react";import{jsx as s}from"react/jsx-runtime";var c={};function l(e,t=!1,n=e=>e){return()=>({__type:`event-definition`,type:e,isDomainEvent:t,transformations:n})}var u=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}`)}},ee=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:u(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}},te=e=>e.__isAmbassador?!0:!!e().__isAmbassador,ne=`__metadata`,re=`edge.wixapis.com`,ie=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}),ae=e=>e?.method&&[`post`,`put`,`patch`].includes(e.method.toLocaleLowerCase())&&e.body?{"Content-Type":`application/json`}:{},oe=e=>e&&typeof e==`object`&&!Array.isArray(e),se=e=>e.__type===`host`;function ce(e,t){return e.create(t)}var f=`x-wix-bi-gateway`;function p(e,t,n){return{[f]:m({environment:`js-sdk${n?`-${n}`:``}`,"package-name":e.packageName??t?.PACKAGE_NAME,"method-fqn":e.methodFqn,entity:e.entityFqdn})}}function m(e){return Object.entries(e).filter(([e,t])=>!!t).map(([e,t])=>`${e}=${t}`).join(`,`)}function h(e){let t=globalThis.__wix_context__,n={client:c.client,elevatedClient:c.elevatedClient},r;globalThis.__wix_context__=void 0,c.client=void 0,c.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,c.client=n.client,c.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}var le={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`};function g(e){return pe(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var ue=/([\p{Ll}\d])(\p{Lu})/gu,de=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,_=`$1\0$2`,fe=/[^\p{L}\d]+/giu;function pe(e){let t=e.trim();t=t.replace(ue,_).replace(de,_),t=t.replace(fe,`\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 me=e=>`validationError`in(e.response?.data?.details??{}),he=e=>`applicationError`in(e.response?.data?.details??{}),ge=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function _e(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(me(e))return ve(e,t,n);if(he(e))return ye(e);if(ge(e)){let t=e.response?.status,n=e.response?.statusText??`UNKNOWN`,r=e.response?.data?.message??n,i={applicationError:{description:n,code:g(n),data:{}},requestId:e.requestId};return v(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return be(e)}var ve=(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 v(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},v=(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??g(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 v(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},be=e=>v(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:g(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:y(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,y(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},y=(e,t)=>{let n=Se(e);return n==null?e:e.replace(`$[${n}]`,t[n])},Se=e=>{let t=e.match(/\$\[(?<argIndex>\d+)\]/);return t&&t.groups&&Number(t.groups.argIndex)};function Ce(e,t,n,r,i,a,o,s,c,l,u){return h(()=>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?re:o}${a.url}`;a.params&&a.params.toString()&&(u+=`?${a.params.toString()}`);try{let e=p(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=Te(s.status,e?.message??s.statusText,e?.details,{requestId:s.headers.get(`X-Wix-Request-Id`),details:e}),n=_e(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 we=class extends Error{response;requestId;constructor(e){super(),this.response=e.response,this.requestId=e.requestId}},Te=(e,t,n,r)=>new we({response:{data:{details:{...!n?.validationError&&{applicationError:{description:t,code:e,data:r}},...n},message:t},status:e},requestId:r?.requestId}),Ee=`.`;function De(e,t,n){if(e==null)throw Error(`Cannot set value on null or undefined`);let r=Oe(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 Oe(e){return Array.isArray(e)?e:e.split(Ee).map(e=>ke(e)?Number(e):e)}function ke(e){return/^\d+$/.test(e)}function Ae(e){let t={};for(let[n,r]of Object.entries(e))je(n)||De(t,Oe(n),r);return t}function je(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Me=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])),Ae(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 le?le[e]:void 0;if(i&&i in t){r.push(i),n=t[i];return}let a=Ie(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 Ne(e,t){let n=e?.modifiedFields;if(!n)return null;let r=Pe(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=Fe(s,a);return c===null?null:(o.modifiedFields=c,o)}function Pe(e){if(typeof e==`object`&&e&&!Array.isArray(e))try{let t=new Me(e);return{unflattenedModifiedFields:t.unflatten(),modifiedFieldsManipulator:t}}catch{return null}return null}function Fe(e,t){if(typeof e==`object`&&e&&!Array.isArray(e))try{return t.flatten(e)}catch{return null}return null}function Ie(e){return e.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():``).replace(/^./,e=>e.toLowerCase())}function b(){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 Le=e=>e.__type===`event-definition`;function x(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=Ne(s,a);if(e)return t(e)}}return t(a(o))}function Re(e){let t=new Map,n=b();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})=>x(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})=>x(t,n,e.payload,{instanceId:e.instanceId,identity:e.identity})))},apps:{AppInstalled:l(`AppInstalled`)(),AppRemoved:l(`AppRemoved`)()}}}}var ze=e=>e.__type===`service-plugin-definition`;function Be(e){let t=new Map,n=b();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 S=`X-Wix-Consistent`;function Ve(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`]?{[S]:t[S]}:{}},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=C(e);return a&&(t[S]=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=C(e);return a&&(t[S]=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:l,initModule:u}=Be(i),{client:re,initModule:d}=Re(i),f=async(n,r)=>{let i=o(),s=await a(),c=ae(r),l=await i(n,{...r,headers:{...c,...t,...s?.headers,...r?.headers,...e.host?.essentials?.passThroughHeaders,...t[`X-Wix-Consistent`]?{[S]:t[S]}:{}}}),u=C(l);return u&&(t[S]=u),l},p=(t,n)=>{if(Le(t))return d(t);if(ze(t))return u(t);if(se(t)&&e.host)return ce(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 Ce(h(()=>te(t))?ee(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 oe(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,p(n,t[ne])])):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?c.elevatedClient=this:c.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 ie(`GraphQL request failed with status ${a.status}`,a);let{data:o,errors:s}=await a.json();return{data:o??{},errors:s}},webhooks:re,servicePlugins:l}}function C(e){return e.headers?.get(`X-Wix-Consistent`)??e.headers?.get(`x-wix-consistent`)}var w={_id:`id`,_createdDate:`createdDate`,_updatedDate:`updatedDate`},He={id:`_id`,createdDate:`_createdDate`,updatedDate:`_updatedDate`},Ue=w;function T(e,t){return e?.split(`.`).map(e=>t?.[e]??e).join(`.`)}function E(e,{transformSystemFields:t=!0}={}){return t?T(e,Ue):e}var D=`sort.fieldName`;function We(e,t,n){return(e===D||e.endsWith(`.${D}`))&&typeof t==`string`?T(t,n):t}function O(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=Ge(e,t);s!==e&&!(s in a)&&(a[s]=a[e],delete a[e]),a[s]=We(o,a[s],t),i(a[s],o)})}};return i(e,``),e}function Ge(e,t){let n;return n=e.includes(`.`)?e.split(`.`).map(e=>t[e]??e).join(`.`):t[e]??e,n}function Ke(e,t=[]){return O(e,w,t)}function k(e,t=[]){return O(e,He,t)}function A(e){return e?new Date(e):void 0}var j=new WeakMap;function M(){return{leaves:void 0,fields:void 0,mapFields:void 0,anyField:void 0}}function qe(e,t){let n=e.get(t);return n||(n=M(),e.set(t,n)),n}function Je(e,t){return t===`*`?(e.anyField??=M(),e.anyField):t.endsWith(`{}`)?(e.mapFields??=new Map,qe(e.mapFields,t.slice(0,-2))):(e.fields??=new Map,qe(e.fields,t))}function Ye(e){let t=M();for(let n of e){let e=n.path.split(`.`).reduce(Je,t);e.leaves??=[],e.leaves.push(n)}return t}function Xe(e){let t=j.get(e);return t||(t=Ye(e),j.set(e,t)),t}function N(e){return typeof e==`object`&&!!e}function Ze(e,{isRepeated:t,isMap:n},r){return t?Array.isArray(e)?e.map(r):e:n?N(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e:r(e)}function P(e,t,n){N(e)&&F(e,t,n)}function Qe(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]=Ze(e[r],t,n);let t=e[r];Array.isArray(t)?t.forEach(e=>P(e,i,n)):P(t,i,n)}}function $e(e,t,n){for(let[r,i]of t){let t=e[r];N(t)&&Object.values(t).forEach(e=>P(e,i,n))}}function F(e,{fields:t,mapFields:n,anyField:r},i){t&&Qe(e,t,i),n&&$e(e,n,i),r&&Object.values(e).forEach(e=>P(e,r,i))}function I(e,t){if(!N(e))return e;for(let{paths:n,transformFn:r}of t)F(e,Xe(n),r);return e}function L(e){return rt(e).map(e=>e.toLocaleUpperCase()).join(`_`)}var et=/([\p{Ll}\d])(\p{Lu})/gu,tt=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,R=`$1\0$2`,nt=/[^\p{L}\d]+/giu;function rt(e){let t=e.trim();t=t.replace(et,R).replace(tt,R),t=t.replace(nt,`\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 it=e=>`validationError`in(e.response?.data?.details??{}),at=e=>`applicationError`in(e.response?.data?.details??{}),ot=e=>(e.response?.status??-1)>=400&&(e.response?.status??-1)<500;function st(e,t={explicitPathsToArguments:{},spreadPathsToArguments:{},singleArgumentUnchanged:!1},n=[]){if(typeof e!=`object`||!e)throw e;if(it(e))return ct(e,t,n);if(at(e))return lt(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:L(n),data:{}},requestId:e.requestId};return z(e,{message:JSON.stringify({message:r,details:i},null,2),extraProperties:{details:i,status:t}})}return ut(e)}var ct=(e,t,n)=>{let r=e.response?.data,i=e.requestId,{fieldViolations:a}=r.details.validationError,o=dt(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 z(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:e.response?.status,requestId:i}})},z=(e,{message:t,extraProperties:n})=>Object.assign(e,{...n,message:t}),lt=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??L(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 z(e,{message:JSON.stringify({message:s,details:c},null,2),extraProperties:{details:c,status:t,requestId:e.requestId}})},ut=e=>z(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:L(e.response?.statusText??`UNKNOWN`),...!e.response&&{runtimeError:e}}}),dt=({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:B(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,B(t,i))}}return n?{...e,field:`${i[0]}.${e.field}`}:e})},B=(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 V(){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 H(()=>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:c.client===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.client:c.client,n=typeof $wixContext<`u`?$wixContext.elevatedClient:c.elevatedClient===void 0?globalThis.__wix_context__===void 0?void 0:globalThis.__wix_context__.elevatedClient:c.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 H(()=>n.use(e))}if(!t)throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);return H(()=>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 H(e){let t=globalThis.__wix_context__,n={client:c.client,elevatedClient:c.elevatedClient},r;globalThis.__wix_context__=void 0,c.client=void 0,c.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,c.client=n.client,c.elevatedClient=n.elevatedClient,typeof $wixContext<`u`&&($wixContext.client=r.client,$wixContext.elevatedClient=r.elevatedClient)}}function pt(e,t){return((...n)=>{let r=V();return r?r.initWixModules(e,t).apply(void 0,n):e.apply(void 0,n)})}function mt(e){let t=((...t)=>{let n=V();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 ht(e,t=!1){return pt(e,t)}function gt(e,t){let n=U(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":yt(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 _t(e){let t=Mt(At(e.host),e.domainToMappings);return Vt(Rt(e.protoPath,e.data||{}),t)}function U(e,t=``){let n={};return Object.entries(e).forEach(([e,r])=>{let i=typeof r==`object`&&!!r&&!Array.isArray(r),a=vt(t,e);if(i){let e=U(r,a);Object.assign(n,e)}else n[a]=r}),n}function vt(e,t){return`${e}${e?`.`:``}${t}`}var yt=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,`_`)},bt=[`wix.com`,`editorx.com`],xt=`_`,St=`*.`,Ct=RegExp(`\\.(${bt.join(`|`)})$`),wt=[`42.wixprod.net`,`uw2-edt-1.wixprod.net`,`virginia-edt.wixprod.net`],Tt={"payments.base44.com":`manage.wix.com`,"create.editorx.com":`editor.editorx.com`},Et=`dev.wix-code.com`,Dt=/{(.*)}/,Ot=RegExp(`\\.(${wt.join(`|`)})$`),kt=RegExp(`.*\\.${Et}$`);function At(e){return jt(e).replace(Ct,`._base_domain_`).replace(Ot,`._api_base_domain_`).replace(kt,`*.dev.wix-code.com`)}function jt(e){return Tt[e]??e}function Mt(e,t){let n=t[e];if(n)return n;let r=Nt(e,t)??Pt(e,t);if(!r){if(It(e)){let e=t[Lt];if(e)return e}let n=t[xt];if(n)return n}return r??[]}function Nt(e,t){return Object.entries(t).find(([t])=>{let[,...n]=e.split(`.`);return n.join(`.`)===t})?.[1]}function Pt(e,t){let[n]=Object.entries(t).filter(([t])=>Ft(e,t)).sort(([e],[t])=>t.length-e.length);if(!n)return;let[,r]=n;return r}function Ft(e,t){if(!t.startsWith(St))return!1;let n=t.slice(1);return e.length>n.length&&e.endsWith(n)}function It(e){return!!e.match(/\._base_domain_$/)}var Lt=`www._base_domain_`;function Rt(e,t){return e.split(`/`).map(e=>zt(e,t)).join(`/`)}function zt(e,t){let n=e.match(Dt)||[],r=n[1];return r?Bt(t,r,e,e.replace(n[0],``)):e}function Bt(e,t,n,r){let i=e;for(let e of t.split(`.`)){if(!i)return n;i=i[e]}return`${i}${r}`}function Vt(e,t){let n=t?.find(t=>e.startsWith(t.destPath));return n?n.srcPath+e.slice(n.destPath.length):e}function W(e){return mt(e)}function G(e){return e===`NaN`?NaN:e===`Infinity`?1/0:e===`-Infinity`?-1/0:e}var Ht=`x-wix-linguist`,Ut=`00000000-0000-0000-0000-000000000000`,Wt=`false`,Gt=()=>{let e=K(`language`),t=K(`locale`);if(e)return{[Ht]:[e,t||e,Wt,Ut].join(`|`)}};function Kt(){let e=null,t=null;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var qt=()=>(typeof window<`u`?window.commonConfig:void 0)??globalThis.commonConfig,K=e=>qt()?.[e],Jt=({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=Xt();return{...a,apiBaseUrl:o,getMonitoringClient:i?.getMonitoringClientFunction?.(n,r),essentials:{language:K(`language`),locale:K(`locale`),get passThroughHeaders(){return Gt()}}}},auth:e=>{let t=typeof window<`u`?window.wixEmbedsAPI:void 0;!e&&Yt()&&(e=t?.getAccessTokenFunction?.());let n=!1,{resolve:r,promise:i}=Kt();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 Yt(){return typeof document<`u`&&document.currentScript?.tagName===`SCRIPT`}function Xt(){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 Zt=({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:()=>{}})}),q=Jt({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:Zt({clientSdk:t,applicationId:n}),close:()=>{}}}}),Qt=(e,t)=>{let n=q.host({applicationId:e,componentId:t}),r=q.auth();return Ve({auth:r,host:n}).enableContext(`module`),r.getAccessTokenInjector()},$t=e=>Qt(`215238eb-22a5-4c36-9e7b-e7c08025e04e`,e);function en(e){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:e.status===`pending`?e:(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}),e)}function J(e){return e}var tn=J(`@wix/site-service-warmup-data`),nn=J(`@wix/site-service-locale`),rn=J(`@wix/viewer-service-multilingual`);function an(){let e=a(),t=o(nn),n;try{n=e(rn)}catch{}return n?.multilingualEnabled&&n.currentLocale?.languageCode||t.language}async function on(e,t,n){let r=typeof window>`u`;if(!r&&e)try{let n=await e.get(t);if(n!==null)return n}catch{}let i=await n();if(r&&e)try{e.set(t,i)}catch{}return i}function sn(e,t){let n=a(),r=an();return i(()=>{let i;try{i=n(tn)}catch{i=null}return on(i,`${e}:${r}`,t)},[r])}function Y(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 X(e,t,n={}){let r=(r,i)=>X(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 cn(e){return Object.assign(t=>X(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 ln(e){return(t=>({asc:()=>({sort:{fieldName:E(t,e),order:`ASC`}}),desc:()=>({sort:{fieldName:E(t,e),order:`DESC`}})}))}function un(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 dn(e){return{QueryBuilder:un(e),Filter:cn(e),Sort:ln(e)}}function fn(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 pn(e){return t=>{let n=fn(e);return t===void 0?n:n.expression(t)}}function mn(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 hn(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 gn(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 _n(e){let t={...e,type:`SCALAR`,scalar:{}},n={get aggregation(){return t},type(e){return t={...t,scalar:{type:e}},n}};return n}function vn(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 yn(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 mn(n)},asRangeAggregation(){return hn(n)},asDateHistogramAggregation(){return gn(n)},asScalarAggregation(){return _n(n)},asNestedAggregation(){return vn(n)}};return r}function bn(e){return t=>yn(t,e)}function xn(){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 Sn(e){return{SearchBuilder:xn(),Filter:cn(e),Sort:ln(e),SearchParams:pn(e),Aggregation:bn(e)}}function Cn(e){return _t(Object.assign(e,{domainToMappings:{"*.dev.wix-code.com":[{srcPath:`/_api/categories`,destPath:``}],"www.wixapis.com":[{srcPath:`/categories/v1/bulk/categories`,destPath:`/v1/bulk/categories`},{srcPath:`/categories/v1/categories`,destPath:`/v1/categories`}],"manage._base_domain_":[{srcPath:`/_api/categories`,destPath:``}],"editor._base_domain_":[{srcPath:`/_api/categories-service`,destPath:``}],"blocks._base_domain_":[{srcPath:`/_api/categories-service`,destPath:``}],"create.editorx":[{srcPath:`/_api/categories-service`,destPath:``}],_:[{srcPath:`/categories/v1/bulk/categories`,destPath:`/v1/bulk/categories`},{srcPath:`/categories/v1/categories`,destPath:`/v1/categories`}]}}))}var wn=`@wix/auto_sdk_categories_categories`;function Tn(e){function t({host:t}){return{entityFqdn:`wix.categories.v1.category`,method:`GET`,methodFqn:`com.wix.categories.api.v1.CategoriesService.GetCategory`,packageName:wn,migrationOptions:{optInTransformResponse:!0},url:Cn({protoPath:`/v1/categories/{categoryId}`,data:e,host:t}),params:gt(e),transformResponse:e=>I(e,[{transformFn:A,paths:[{path:`category.createdDate`},{path:`category.updatedDate`},{path:`category.image.urlExpirationDate`},{path:`category.richContentDescription.metadata.createdTimestamp`},{path:`category.richContentDescription.metadata.updatedTimestamp`}]},{transformFn:G,paths:[{path:`category.richContentDescription.nodes.buttonData.styles.background.gradient.centerX`},{path:`category.richContentDescription.nodes.buttonData.styles.background.gradient.centerY`},{path:`category.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position`},{path:`category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`category.richContentDescription.nodes.galleryData.items.image.media.duration`},{path:`category.richContentDescription.nodes.galleryData.items.video.media.duration`},{path:`category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration`},{path:`category.richContentDescription.nodes.galleryData.options.item.ratio`},{path:`category.richContentDescription.nodes.imageData.image.duration`},{path:`category.richContentDescription.nodes.imageData.crop.x`},{path:`category.richContentDescription.nodes.imageData.crop.y`},{path:`category.richContentDescription.nodes.imageData.crop.width`},{path:`category.richContentDescription.nodes.imageData.crop.height`},{path:`category.richContentDescription.nodes.mapData.mapSettings.lat`},{path:`category.richContentDescription.nodes.mapData.mapSettings.lng`},{path:`category.richContentDescription.nodes.pollData.poll.image.duration`},{path:`category.richContentDescription.nodes.pollData.poll.options.image.duration`},{path:`category.richContentDescription.nodes.pollData.design.poll.background.image.duration`},{path:`category.richContentDescription.nodes.appEmbedData.image.duration`},{path:`category.richContentDescription.nodes.videoData.video.duration`},{path:`category.richContentDescription.nodes.videoData.thumbnail.duration`},{path:`category.richContentDescription.nodes.audioData.audio.duration`},{path:`category.richContentDescription.nodes.audioData.coverImage.duration`},{path:`category.richContentDescription.nodes.layoutData.backgroundImage.media.duration`},{path:`category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`category.richContentDescription.nodes.layoutData.backdropImage.media.duration`},{path:`category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`category.richContentDescription.nodes.layoutData.background.gradient.centerX`},{path:`category.richContentDescription.nodes.layoutData.background.gradient.centerY`},{path:`category.richContentDescription.nodes.layoutData.background.gradient.stops.position`},{path:`category.richContentDescription.nodes.layoutData.backdrop.gradient.centerX`},{path:`category.richContentDescription.nodes.layoutData.backdrop.gradient.centerY`},{path:`category.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position`},{path:`category.richContentDescription.nodes.shapeData.shape.duration`},{path:`category.richContentDescription.nodes.cardData.background.gradient.centerX`},{path:`category.richContentDescription.nodes.cardData.background.gradient.centerY`},{path:`category.richContentDescription.nodes.cardData.background.gradient.stops.position`},{path:`category.richContentDescription.nodes.cardData.backgroundImage.media.duration`},{path:`category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`category.richContentDescription.nodes.tocData.fontSize`},{path:`category.richContentDescription.nodes.tocData.itemSpacing`},{path:`category.richContentDescription.nodes.smartBlockCellData.shape.duration`}]}])}}return t}var Z=(e=>(e.BREADCRUMBS_INFO=`BREADCRUMBS_INFO`,e.DESCRIPTION=`DESCRIPTION`,e.RICH_CONTENT_DESCRIPTION=`RICH_CONTENT_DESCRIPTION`,e))(Z||{});async function En(e,t,n){let{httpClient:r,sideEffects:i}=arguments[3],a=Tn(Ke({categoryId:e,treeReference:t,fields:n?.fields},[]));i?.onSiteCall?.();try{let e=await r.request(a);return i?.onSuccess?.(e),k(I(e.data,[{transformFn:Y,paths:[{path:`category.image`}]}]),[`category.richContentDescription`])?.category}catch(e){let t=st(e,{spreadPathsToArguments:{},explicitPathsToArguments:{categoryId:`$[0]`,treeReference:`$[1]`,fields:`$[2].fields`},singleArgumentUnchanged:!1},[`categoryId`,`treeReference`,`options`]);throw i?.onError?.(e),t}}({...dn()}),{...Sn()};function Dn(e){return(t,n,r)=>En(t,n,r,{httpClient:e})}var On=l(`wix.categories.v1.category_category_moved`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`metadata.eventTime`}]}])))(),kn=l(`wix.categories.v1.category_created`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.richContentDescription.metadata.createdTimestamp`},{path:`entity.richContentDescription.metadata.updatedTimestamp`},{path:`metadata.eventTime`}]},{transformFn:Y,paths:[{path:`entity.image`}]},{transformFn:G,paths:[{path:`entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.richContentDescription.nodes.galleryData.items.image.media.duration`},{path:`entity.richContentDescription.nodes.galleryData.items.video.media.duration`},{path:`entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.richContentDescription.nodes.galleryData.options.item.ratio`},{path:`entity.richContentDescription.nodes.imageData.image.duration`},{path:`entity.richContentDescription.nodes.imageData.crop.x`},{path:`entity.richContentDescription.nodes.imageData.crop.y`},{path:`entity.richContentDescription.nodes.imageData.crop.width`},{path:`entity.richContentDescription.nodes.imageData.crop.height`},{path:`entity.richContentDescription.nodes.mapData.mapSettings.lat`},{path:`entity.richContentDescription.nodes.mapData.mapSettings.lng`},{path:`entity.richContentDescription.nodes.pollData.poll.image.duration`},{path:`entity.richContentDescription.nodes.pollData.poll.options.image.duration`},{path:`entity.richContentDescription.nodes.pollData.design.poll.background.image.duration`},{path:`entity.richContentDescription.nodes.appEmbedData.image.duration`},{path:`entity.richContentDescription.nodes.videoData.video.duration`},{path:`entity.richContentDescription.nodes.videoData.thumbnail.duration`},{path:`entity.richContentDescription.nodes.audioData.audio.duration`},{path:`entity.richContentDescription.nodes.audioData.coverImage.duration`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.media.duration`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.richContentDescription.nodes.layoutData.background.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.background.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.background.gradient.stops.position`},{path:`entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.richContentDescription.nodes.shapeData.shape.duration`},{path:`entity.richContentDescription.nodes.cardData.background.gradient.centerX`},{path:`entity.richContentDescription.nodes.cardData.background.gradient.centerY`},{path:`entity.richContentDescription.nodes.cardData.background.gradient.stops.position`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.media.duration`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.richContentDescription.nodes.tocData.fontSize`},{path:`entity.richContentDescription.nodes.tocData.itemSpacing`},{path:`entity.richContentDescription.nodes.smartBlockCellData.shape.duration`}]}])))(),An=l(`wix.categories.v1.category_deleted`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`undefined.createdDate`},{path:`undefined.updatedDate`},{path:`undefined.richContentDescription.metadata.createdTimestamp`},{path:`undefined.richContentDescription.metadata.updatedTimestamp`},{path:`metadata.eventTime`}]},{transformFn:Y,paths:[{path:`undefined.image`}]},{transformFn:G,paths:[{path:`undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerX`},{path:`undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerY`},{path:`undefined.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.galleryData.items.image.media.duration`},{path:`undefined.richContentDescription.nodes.galleryData.items.video.media.duration`},{path:`undefined.richContentDescription.nodes.galleryData.items.video.thumbnail.duration`},{path:`undefined.richContentDescription.nodes.galleryData.options.item.ratio`},{path:`undefined.richContentDescription.nodes.imageData.image.duration`},{path:`undefined.richContentDescription.nodes.imageData.crop.x`},{path:`undefined.richContentDescription.nodes.imageData.crop.y`},{path:`undefined.richContentDescription.nodes.imageData.crop.width`},{path:`undefined.richContentDescription.nodes.imageData.crop.height`},{path:`undefined.richContentDescription.nodes.mapData.mapSettings.lat`},{path:`undefined.richContentDescription.nodes.mapData.mapSettings.lng`},{path:`undefined.richContentDescription.nodes.pollData.poll.image.duration`},{path:`undefined.richContentDescription.nodes.pollData.poll.options.image.duration`},{path:`undefined.richContentDescription.nodes.pollData.design.poll.background.image.duration`},{path:`undefined.richContentDescription.nodes.appEmbedData.image.duration`},{path:`undefined.richContentDescription.nodes.videoData.video.duration`},{path:`undefined.richContentDescription.nodes.videoData.thumbnail.duration`},{path:`undefined.richContentDescription.nodes.audioData.audio.duration`},{path:`undefined.richContentDescription.nodes.audioData.coverImage.duration`},{path:`undefined.richContentDescription.nodes.layoutData.backgroundImage.media.duration`},{path:`undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.layoutData.backdropImage.media.duration`},{path:`undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.layoutData.background.gradient.centerX`},{path:`undefined.richContentDescription.nodes.layoutData.background.gradient.centerY`},{path:`undefined.richContentDescription.nodes.layoutData.background.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerX`},{path:`undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerY`},{path:`undefined.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.shapeData.shape.duration`},{path:`undefined.richContentDescription.nodes.cardData.background.gradient.centerX`},{path:`undefined.richContentDescription.nodes.cardData.background.gradient.centerY`},{path:`undefined.richContentDescription.nodes.cardData.background.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.cardData.backgroundImage.media.duration`},{path:`undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`undefined.richContentDescription.nodes.tocData.fontSize`},{path:`undefined.richContentDescription.nodes.tocData.itemSpacing`},{path:`undefined.richContentDescription.nodes.smartBlockCellData.shape.duration`}]}])))(),jn=l(`wix.categories.v1.category_item_added_to_category`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`metadata.eventTime`}]}])))(),Mn=l(`wix.categories.v1.category_item_removed_from_category`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`metadata.eventTime`}]}])))(),Nn=l(`wix.categories.v1.category_items_arranged_in_category`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`metadata.eventTime`}]}])))(),Pn=l(`wix.categories.v1.category_updated`,!0,e=>k(I(e,[{transformFn:A,paths:[{path:`entity.createdDate`},{path:`entity.updatedDate`},{path:`entity.richContentDescription.metadata.createdTimestamp`},{path:`entity.richContentDescription.metadata.updatedTimestamp`},{path:`metadata.eventTime`},{path:`modifiedFields.createdDate`},{path:`modifiedFields.updatedDate`},{path:`modifiedFields.richContentDescription.metadata.createdTimestamp`},{path:`modifiedFields.richContentDescription.metadata.updatedTimestamp`}]},{transformFn:Y,paths:[{path:`entity.image`},{path:`modifiedFields.image`}]},{transformFn:G,paths:[{path:`entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX`},{path:`entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY`},{path:`entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position`},{path:`entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`entity.richContentDescription.nodes.galleryData.items.image.media.duration`},{path:`entity.richContentDescription.nodes.galleryData.items.video.media.duration`},{path:`entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration`},{path:`entity.richContentDescription.nodes.galleryData.options.item.ratio`},{path:`entity.richContentDescription.nodes.imageData.image.duration`},{path:`entity.richContentDescription.nodes.imageData.crop.x`},{path:`entity.richContentDescription.nodes.imageData.crop.y`},{path:`entity.richContentDescription.nodes.imageData.crop.width`},{path:`entity.richContentDescription.nodes.imageData.crop.height`},{path:`entity.richContentDescription.nodes.mapData.mapSettings.lat`},{path:`entity.richContentDescription.nodes.mapData.mapSettings.lng`},{path:`entity.richContentDescription.nodes.pollData.poll.image.duration`},{path:`entity.richContentDescription.nodes.pollData.poll.options.image.duration`},{path:`entity.richContentDescription.nodes.pollData.design.poll.background.image.duration`},{path:`entity.richContentDescription.nodes.appEmbedData.image.duration`},{path:`entity.richContentDescription.nodes.videoData.video.duration`},{path:`entity.richContentDescription.nodes.videoData.thumbnail.duration`},{path:`entity.richContentDescription.nodes.audioData.audio.duration`},{path:`entity.richContentDescription.nodes.audioData.coverImage.duration`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.media.duration`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`entity.richContentDescription.nodes.layoutData.background.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.background.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.background.gradient.stops.position`},{path:`entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX`},{path:`entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY`},{path:`entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position`},{path:`entity.richContentDescription.nodes.shapeData.shape.duration`},{path:`entity.richContentDescription.nodes.cardData.background.gradient.centerX`},{path:`entity.richContentDescription.nodes.cardData.background.gradient.centerY`},{path:`entity.richContentDescription.nodes.cardData.background.gradient.stops.position`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.media.duration`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`entity.richContentDescription.nodes.tocData.fontSize`},{path:`entity.richContentDescription.nodes.tocData.itemSpacing`},{path:`entity.richContentDescription.nodes.smartBlockCellData.shape.duration`},{path:`modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.galleryData.items.image.media.duration`},{path:`modifiedFields.richContentDescription.nodes.galleryData.items.video.media.duration`},{path:`modifiedFields.richContentDescription.nodes.galleryData.items.video.thumbnail.duration`},{path:`modifiedFields.richContentDescription.nodes.galleryData.options.item.ratio`},{path:`modifiedFields.richContentDescription.nodes.imageData.image.duration`},{path:`modifiedFields.richContentDescription.nodes.imageData.crop.x`},{path:`modifiedFields.richContentDescription.nodes.imageData.crop.y`},{path:`modifiedFields.richContentDescription.nodes.imageData.crop.width`},{path:`modifiedFields.richContentDescription.nodes.imageData.crop.height`},{path:`modifiedFields.richContentDescription.nodes.mapData.mapSettings.lat`},{path:`modifiedFields.richContentDescription.nodes.mapData.mapSettings.lng`},{path:`modifiedFields.richContentDescription.nodes.pollData.poll.image.duration`},{path:`modifiedFields.richContentDescription.nodes.pollData.poll.options.image.duration`},{path:`modifiedFields.richContentDescription.nodes.pollData.design.poll.background.image.duration`},{path:`modifiedFields.richContentDescription.nodes.appEmbedData.image.duration`},{path:`modifiedFields.richContentDescription.nodes.videoData.video.duration`},{path:`modifiedFields.richContentDescription.nodes.videoData.thumbnail.duration`},{path:`modifiedFields.richContentDescription.nodes.audioData.audio.duration`},{path:`modifiedFields.richContentDescription.nodes.audioData.coverImage.duration`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.media.duration`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdropImage.media.duration`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.layoutData.background.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.shapeData.shape.duration`},{path:`modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.cardData.background.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.cardData.backgroundImage.media.duration`},{path:`modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX`},{path:`modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY`},{path:`modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position`},{path:`modifiedFields.richContentDescription.nodes.tocData.fontSize`},{path:`modifiedFields.richContentDescription.nodes.tocData.itemSpacing`},{path:`modifiedFields.richContentDescription.nodes.smartBlockCellData.shape.duration`}]}])))(),Fn=ht(Dn);W(On),W(kn),W(An),W(jn),W(Mn),W(Nn),W(Pn);function In(e){if(!e)return null;let t=e.match(/image:\/\/v1\/([^/#]+)/);return t?.[1]?t[1]:e.match(/\/media\/([^/]+)/)?.[1]??null}function Ln(e){if(!e)return null;let t=e.match(/#originWidth=(\d+)&originHeight=(\d+)/);return t?{width:parseInt(t[1],10),height:parseInt(t[2],10)}:null}var Rn=e=>`/category/${e}`,zn=e=>({...e,nodes:e.nodes??[]}),Bn=e=>{if(!e)return;let t=Ln(e);return{uri:In(e)??void 0,url:e,width:t?.width,height:t?.height}},Vn=e=>e.filter(e=>e.categoryId).map(e=>{let t=e.categorySlug??``;return{id:e.categoryId??``,name:e.categoryName??``,slug:t,href:Rn(t)}}),Hn=e=>({type:e.type,props:e.props??void 0,meta:e.meta??void 0,children:e.children,custom:e.custom,disabled:e.disabled}),Un=e=>{if(e)return{preventAutoRedirect:e.preventAutoRedirect,keywords:e.keywords?.map(e=>({term:e.term,isMain:e.isMain,origin:e.origin??void 0}))}},Wn=e=>{if(e)return{tags:e.tags?.map(Hn),settings:Un(e.settings)}};function Gn(e){return{id:e._id??``,name:e.name??``,slug:e.slug??``,description:e.description??void 0,itemCounter:e.itemCounter,parentCategoryId:e.parentCategory?._id??void 0,seoData:Wn(e.seoData),richContentDescription:e.richContentDescription?zn(e.richContentDescription):void 0,image:Bn(e.image),breadcrumbs:Vn(e.breadcrumbsInfo?.breadcrumbs??[])}}var Kn={appNamespace:`@wix/stores`,treeKey:null},qn=[Z.BREADCRUMBS_INFO,Z.DESCRIPTION,Z.RICH_CONTENT_DESCRIPTION],Jn=(e,t)=>{if(!e?._id||e.visible===!1)throw Error(t);return Gn(e)};async function Yn(e){return Jn(await Fn(e,Kn,{fields:qn}),`Category not found for id: ${e}`)}var Xn=`wixstores-storefront-builder:category-info-context-data`;function Zn(e){return sn(`${Xn}:${e}`,()=>Yn(e))}var Qn=J(`@wix/site-service-url`),Q=`215238eb-22a5-4c36-9e7b-e7c08025e04e`;`${Q}`,`${Q}`;var $n=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}({}),er=()=>{let e=o(Qn),t=n((t,n)=>{let r=e.appSectionRelativeUrl(Q,t,!0);if(r)return`./${r.replace(/^\//,``).replace(/\/$/,``)}/${encodeURIComponent(n)}`},[e]);return{getPageRelativeUrl:t,getPageAbsoluteUrl:n((n,r)=>{let i=t(n,r);if(i)return new URL(i,`${e.siteUrl.replace(/\/$/,``)}/`).href},[t,e])}};function tr(e){let{getPageAbsoluteUrl:t}=er(),n=i(()=>{if(!e.slug)return;let n=t($n.CATEGORY_PAGE,e.slug);return n?{href:n}:void 0},[e.slug,t]);return i(()=>({id:e.id,name:e.name,slug:e.slug,link:n,description:e.description,richContentDescription:e.richContentDescription,image:e.image,breadcrumbs:e.breadcrumbs}),[e,n])}var $=t(null);$.displayName=`CategoryInfoContext`;function nr(){let e=r($);if(!e)throw Error(`useCategoryInfoContext must be used within a category info context provider`);return e}function rr({categoryPromise:e,children:t}){let n=tr(en(e));return s($.Provider,{value:n,children:t})}function ir({categoryId:t,children:n}){let r=Zn(t);return s(e,{fallback:null,children:s(rr,{categoryPromise:r,children:n})})}function ar({children:e,value:t,categoryId:n}){return t===void 0?n?s(ir,{categoryId:n,children:e},n):null:s($.Provider,{value:t,children:e})}var or=$t(`0d8869b2-7691-4ee2-9d0b-90d72f34edd0`);export{ar as default,or as injectAccessTokenGetter,nr as useCategoryInfoContext};
2
+ //# sourceMappingURL=context-provider-0d8869b2-7691-4ee2-9d0b-90d72f34edd0-B4Fb2oaw.js.map