/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@wix/auto_sdk_quick-pages_materialized-pages@1.0.16/build/cjs/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,a)=>{for(var t in a)__defProp(e,t,{get:a[t],enumerable:!0})},__copyProps=(e,a,t,r)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let s of __getOwnPropNames(a))__hasOwnProp.call(e,s)||s===t||__defProp(e,s,{get:()=>a[s],enumerable:!(r=__getOwnPropDesc(a,s))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),index_exports={};__export(index_exports,{AggregationType:()=>AggregationType,Interval:()=>Interval,MissingValues:()=>MissingValues,Mode:()=>Mode,NestedAggregationType:()=>NestedAggregationType,ScalarType:()=>ScalarType,SortDirection:()=>SortDirection,SortOrder:()=>SortOrder,SortType:()=>SortType,Status:()=>Status,Type:()=>Type,WebhookIdentityType:()=>WebhookIdentityType,getMaterializedPage:()=>getMaterializedPage4,searchMaterializedPages:()=>searchMaterializedPages4,utils:()=>utils}),module.exports=__toCommonJS(index_exports);var import_transform_error=require("@wix/sdk-runtime/transform-error"),import_rename_all_nested_keys=require("@wix/sdk-runtime/rename-all-nested-keys"),import_rest_modules=require("@wix/sdk-runtime/rest-modules"),import_float=require("@wix/sdk-runtime/transformations/float"),import_float2=require("@wix/sdk-runtime/transformations/float"),import_timestamp=require("@wix/sdk-runtime/transformations/timestamp"),import_transform_paths=require("@wix/sdk-runtime/transformations/transform-paths"),import_rest_modules2=require("@wix/sdk-runtime/rest-modules");function resolveWixQuickpagesMaterializedpagesV1MaterializedPagesUrl(e){return(0,import_rest_modules2.resolveUrl)(Object.assign(e,{domainToMappings:{"manage._base_domain_":[{srcPath:"/_api/quick-pages/v1/materialized-pages",destPath:"/v1/materialized-pages"}],"www.wixapis.com":[{srcPath:"/quick-pages/v1/materialized-pages",destPath:"/v1/materialized-pages"}]}}))}var PACKAGE_NAME="@wix/auto_sdk_quick-pages_materialized-pages";function getMaterializedPage(e){return function({host:a}){return{entityFqdn:"wix.quickpages.materializedpages.v1.materialized_page",method:"GET",methodFqn:"wix.quickpages.materializedpages.v1.MaterializedPages.GetMaterializedPage",packageName:PACKAGE_NAME,migrationOptions:{optInTransformResponse:!0},url:resolveWixQuickpagesMaterializedpagesV1MaterializedPagesUrl({protoPath:"/v1/materialized-pages/{materializedPageId}",data:e,host:a}),params:(0,import_rest_modules.toURLSearchParams)(e),transformResponse:e=>(0,import_transform_paths.transformPaths)(e,[{transformFn:import_timestamp.transformRESTTimestampToSDKTimestamp,paths:[{path:"materializedPage.createdDate"},{path:"materializedPage.updatedDate"},{path:"materializedPage.publishedDate"},{path:"materializedPage.unpublishedDate"}]}])}}}function searchMaterializedPages(e){return function({host:a}){const t=(0,import_transform_paths.transformPaths)(e,[{transformFn:import_float.transformSDKFloatToRESTFloat,paths:[{path:"search.aggregations.range.buckets.from"},{path:"search.aggregations.range.buckets.to"},{path:"search.aggregations.nested.nestedAggregations.range.buckets.from"},{path:"search.aggregations.nested.nestedAggregations.range.buckets.to"}]}]);return{entityFqdn:"wix.quickpages.materializedpages.v1.materialized_page",method:"POST",methodFqn:"wix.quickpages.materializedpages.v1.MaterializedPages.SearchMaterializedPages",packageName:PACKAGE_NAME,migrationOptions:{optInTransformResponse:!0},url:resolveWixQuickpagesMaterializedpagesV1MaterializedPagesUrl({protoPath:"/v1/materialized-pages/search",data:t,host:a}),data:t,transformResponse:e=>(0,import_transform_paths.transformPaths)(e,[{transformFn:import_timestamp.transformRESTTimestampToSDKTimestamp,paths:[{path:"materializedPages.createdDate"},{path:"materializedPages.updatedDate"},{path:"materializedPages.publishedDate"},{path:"materializedPages.unpublishedDate"}]},{transformFn:import_float2.transformRESTFloatToSDKFloat,paths:[{path:"aggregationData.results.ranges.results.from"},{path:"aggregationData.results.ranges.results.to"},{path:"aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from"},{path:"aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to"},{path:"aggregationData.results.nested.results.results.*.range.from"},{path:"aggregationData.results.nested.results.results.*.range.to"},{path:"aggregationData.results.scalar.value"},{path:"aggregationData.results.groupedByValue.results.nestedResults.scalar.value"},{path:"aggregationData.results.nested.results.results.*.scalar.value"}]}])}}}var import_image=require("@wix/sdk-runtime/transformations/image"),import_transform_paths2=require("@wix/sdk-runtime/transformations/transform-paths"),import_search_builder_utils=require("@wix/sdk-runtime/search-builder-utils"),Status=(e=>(e.UNKNOWN_STATUS="UNKNOWN_STATUS",e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e.SCHEDULED="SCHEDULED",e.ARCHIVED="ARCHIVED",e))(Status||{}),Type=(e=>(e.PATH="PATH",e))(Type||{}),SortOrder=(e=>(e.ASC="ASC",e.DESC="DESC",e))(SortOrder||{}),SortType=(e=>(e.COUNT="COUNT",e.VALUE="VALUE",e))(SortType||{}),SortDirection=(e=>(e.DESC="DESC",e.ASC="ASC",e))(SortDirection||{}),MissingValues=(e=>(e.EXCLUDE="EXCLUDE",e.INCLUDE="INCLUDE",e))(MissingValues||{}),ScalarType=(e=>(e.COUNT_DISTINCT="COUNT_DISTINCT",e.MIN="MIN",e.MAX="MAX",e))(ScalarType||{}),NestedAggregationType=(e=>(e.VALUE="VALUE",e.RANGE="RANGE",e.SCALAR="SCALAR",e.DATE_HISTOGRAM="DATE_HISTOGRAM",e))(NestedAggregationType||{}),Interval=(e=>(e.YEAR="YEAR",e.MONTH="MONTH",e.WEEK="WEEK",e.DAY="DAY",e.HOUR="HOUR",e.MINUTE="MINUTE",e.SECOND="SECOND",e))(Interval||{}),AggregationType=(e=>(e.VALUE="VALUE",e.RANGE="RANGE",e.SCALAR="SCALAR",e.DATE_HISTOGRAM="DATE_HISTOGRAM",e.NESTED="NESTED",e))(AggregationType||{}),Mode=(e=>(e.OR="OR",e.AND="AND",e))(Mode||{}),WebhookIdentityType=(e=>(e.UNKNOWN="UNKNOWN",e.ANONYMOUS_VISITOR="ANONYMOUS_VISITOR",e.MEMBER="MEMBER",e.WIX_USER="WIX_USER",e.APP="APP",e))(WebhookIdentityType||{});async function getMaterializedPage2(e){const{httpClient:a,sideEffects:t}=arguments[1],r=getMaterializedPage((0,import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({materializedPageId:e}));t?.onSiteCall?.();try{const e=await a.request(r);return t?.onSuccess?.(e),(0,import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)((0,import_transform_paths2.transformPaths)(e.data,[{transformFn:import_image.transformRESTImageToSDKImage,paths:[{path:"materializedPage.socialPreviewImage"},{path:"materializedPage.favicon"}]}]))?.materializedPage}catch(e){const a=(0,import_transform_error.transformError)(e,{spreadPathsToArguments:{},explicitPathsToArguments:{materializedPageId:"$[0]"},singleArgumentUnchanged:!1},["materializedPageId"]);throw t?.onError?.(e),a}}async function searchMaterializedPages2(e){const{httpClient:a,sideEffects:t}=arguments[1],r=searchMaterializedPages((0,import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({search:e}));t?.onSiteCall?.();try{const e=await a.request(r);return t?.onSuccess?.(e),(0,import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)((0,import_transform_paths2.transformPaths)(e.data,[{transformFn:import_image.transformRESTImageToSDKImage,paths:[{path:"materializedPages.socialPreviewImage"},{path:"materializedPages.favicon"}]}]))}catch(e){const a=(0,import_transform_error.transformError)(e,{spreadPathsToArguments:{},explicitPathsToArguments:{search:"$[0]"},singleArgumentUnchanged:!1},["search"]);throw t?.onError?.(e),a}}var utils={search:{...(0,import_search_builder_utils.createSearchUtils)()}};function getMaterializedPage3(e){return a=>getMaterializedPage2(a,{httpClient:e})}function searchMaterializedPages3(e){return a=>searchMaterializedPages2(a,{httpClient:e})}var import_rest_modules3=require("@wix/sdk-runtime/rest-modules"),getMaterializedPage4=(0,import_rest_modules3.createRESTModule)(getMaterializedPage3),searchMaterializedPages4=(0,import_rest_modules3.createRESTModule)(searchMaterializedPages3);
//# sourceMappingURL=/sm/cb2a63fff6936817bdf4daf71a2f6b6cb919b93865c8b8923a5eb0c9b901de6e.map