{"version":3,"sources":["jsdelivr-header.js","/npm/@wix/auto_sdk_urls_editor@1.0.32/index.ts","/npm/@wix/auto_sdk_urls_editor@1.0.32/src/editorurls-v2-editor-urls-editor.universal.ts","/npm/@wix/auto_sdk_urls_editor@1.0.32/src/editorurls-v2-editor-urls-editor.http.ts","/npm/@wix/auto_sdk_urls_editor@1.0.32/src/editorurls-v2-editor-urls-editor.public.ts","/npm/@wix/auto_sdk_urls_editor@1.0.32/src/editorurls-v2-editor-urls-editor.context.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8iBCNA,cAAA,GAAA,SAAA,cAAA,CAAA,WAAA,IAAA,WAAA,cAAA,IAAA,iBAAA,OAAA,QAAA,aAAA,eCAA,IAAA,uBAAoD,QAAA,oCACpD,8BAGO,QAAA,2CCJP,oBAAkC,QAAA,iCAClC,qBAA2B,QAAA,iCAI3B,SAAS,uCACP,GAuBA,SAAO,qBAAA,YAAW,OAAO,OAAO,EAAM,CAAE,iBArBf,CACvB,uBAAwB,CACtB,CACE,QAAS,oBACT,SAAU,KAGd,kBAAmB,CACjB,CACE,QAAS,eACT,SAAU,oBAGd,qBAAsB,CACpB,CACE,QAAS,6BACT,SAAU,uBAMlB,CAEA,IAAM,aAAe,4BAGd,SAAS,cAAc,GAqB5B,OApBA,UAAyB,KAAE,IAiBzB,MAhBiB,CACf,WAAY,gCACZ,OAAQ,MACR,UAAW,gDACX,YAAa,aACb,iBAAkB,CAChB,wBAAwB,GAE1B,IAAK,uCAAuC,CAC1C,UAAW,kBACX,KAAM,EACN,SAEF,QAAA,EAAQ,oBAAA,mBAAkB,GAI9B,CAGF,CD3BO,IAAK,WAAL,CAAK,IAEV,EAAA,QAAU,UAEV,EAAA,WAAa,aAKb,EAAA,SAAW,WAEX,EAAA,WAAa,aAEb,EAAA,SAAW,WAKX,EAAA,QAAU,UAEV,EAAA,MAAQ,QAMR,EAAA,WAAa,aAEb,EAAA,WAAa,aA5BH,GAAL,CAAK,YAAA,IAoFZ,eAAsB,eAAc,GAMlC,MAAM,WAAE,EAAA,YAAY,GAAgB,UAAU,GASxC,EAA8C,eAJ9C,EAAU,8BAAA,uCAAsC,CACpD,SAAU,GAAS,YAKrB,GAAa,eACb,IACE,MAAM,QAAe,EAAW,QAAQ,GAGxC,OAFA,GAAa,YAAY,IAEzB,EAAO,8BAAA,yCAAwC,EAAO,KACxD,OAAS,GACP,MAAM,GAAA,EAAmB,uBAAA,gBACvB,EACA,CACE,uBAAwB,CAAC,EACzB,yBAA0B,CAAE,SAAU,iBACtC,yBAAyB,GAE3B,CAAC,YAIH,MAFA,GAAa,UAAU,GAEjB,CACR,CACF,CE7IO,SAAS,eAAc,GAC5B,OAAQ,GACN,eACE,EAEA,CAAE,cAER,CChBA,IAAA,qBAAiC,QAAA,iCAGpB,gBAEK,EAAA,qBAAA,kBAAiB","file":"/npm/@wix/auto_sdk_urls_editor@1.0.32/build/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@wix/auto_sdk_urls_editor@1.0.32/build/cjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export * from './src/editorurls-v2-editor-urls-editor.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixEditorurlsV2EditorUrls from './editorurls-v2-editor-urls-editor.http.js';\n\nexport interface EditorUrls {\n  /**\n   * Editor type.\n   * @readonly\n   */\n  editorType?: EditorTypeWithLiterals;\n  /**\n   * Editor URL.\n   * @maxLength 2048\n   * @format WEB_URL\n   * @readonly\n   */\n  editorUrl?: string | null;\n  /**\n   * Preview URL.\n   * @maxLength 2048\n   * @format WEB_URL\n   * @readonly\n   */\n  previewUrl?: string | null;\n}\n\nexport enum EditorType {\n  /** Unknown editor type. */\n  UNKNOWN = 'UNKNOWN',\n  /** The classic Wix Editor. */\n  WIX_EDITOR = 'WIX_EDITOR',\n  /**\n   * Deprecated. Expected end-of-life date: July 1, 2024.\n   * @internal\n   */\n  EDITOR_X = 'EDITOR_X',\n  /** Wix's editor built for agencies and enterprises. */\n  WIX_STUDIO = 'WIX_STUDIO',\n  /** Wix Harmony editor. */\n  ODEDITOR = 'ODEDITOR',\n  /**\n   * Picasso.\n   * @internal\n   */\n  PICASSO = 'PICASSO',\n  /** Wixel. */\n  WIXEL = 'WIXEL',\n  /**\n   * StudioTwo.\n   * @documentationMaturity preview\n   * @internal\n   */\n  STUDIO_TWO = 'STUDIO_TWO',\n  /** Headless site with no editor. */\n  EDITORLESS = 'EDITORLESS',\n}\n\n/** @enumType */\nexport type EditorTypeWithLiterals =\n  | EditorType\n  | 'UNKNOWN'\n  | 'WIX_EDITOR'\n  | 'WIX_STUDIO'\n  | 'ODEDITOR'\n  | 'WIXEL'\n  | 'EDITORLESS';\n\nexport interface GetEditorUrlsRequest {\n  /**\n   * Optional branch ID to include in generated URLs\n   * @format GUID\n   */\n  branchId?: string | null;\n  /**\n   * Optional editor type override\n   * @internal\n   */\n  editorType?: EditorTypeWithLiterals;\n}\n\nexport interface GetEditorUrlsResponse {\n  /** Editor URL. */\n  urls?: EditorUrls;\n}\n\n/** @docsIgnore */\nexport type GetEditorUrlsApplicationErrors =\n  | {\n      code?: 'UNABLE_TO_EXTRACT_MS_ID';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'SITE_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'EDITOR_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    };\n\n/**\n * Retrieves a site's Editor URLs.\n * @public\n * @permissionId MetaSite.Read\n * @applicableIdentity APP\n * @fqn wix.editorurls.v2.EditorUrlsApi.GetEditorUrls\n */\nexport async function getEditorUrls(options?: GetEditorUrlsOptions): Promise<\n  NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n    __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    branchId: options?.branchId,\n  });\n\n  const reqOpts = ambassadorWixEditorurlsV2EditorUrls.getEditorUrls(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { branchId: '$[0].branchId' },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GetEditorUrlsOptions {\n  /**\n   * Optional branch ID to include in generated URLs\n   * @format GUID\n   */\n  branchId?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEditorurlsV2EditorUrlsApiUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/editor-urls',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/editor-urls',\n        destPath: '/v2/editor-urls',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/editorurls/v2/editor-urls',\n        destPath: '/v2/editor-urls',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_urls_editor';\n\n/** Retrieves a site's Editor URLs. */\nexport function getEditorUrls(payload: object): RequestOptionsFactory<any> {\n  function __getEditorUrls({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.editorurls.v2.editor_urls',\n      method: 'GET' as any,\n      methodFqn: 'wix.editorurls.v2.EditorUrlsApi.GetEditorUrls',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixEditorurlsV2EditorUrlsApiUrl({\n        protoPath: '/v2/editor-urls',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __getEditorUrls;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  GetEditorUrlsApplicationErrors,\n  GetEditorUrlsOptions,\n  GetEditorUrlsResponse,\n  getEditorUrls as universalGetEditorUrls,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/urls' };\n\nexport function getEditorUrls(httpClient: HttpClient): GetEditorUrlsSignature {\n  return (options?: GetEditorUrlsOptions) =>\n    universalGetEditorUrls(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetEditorUrlsSignature {\n  /**\n   * Retrieves a site's Editor URLs.\n   */\n  (options?: GetEditorUrlsOptions): Promise<\n    NonNullablePaths<GetEditorUrlsResponse, `urls.editorType`, 3> & {\n      __applicationErrorsType?: GetEditorUrlsApplicationErrors;\n    }\n  >;\n}\n\nexport {\n  EditorType,\n  EditorUrls,\n  GetEditorUrlsOptions,\n  GetEditorUrlsRequest,\n  GetEditorUrlsResponse,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n","import { getEditorUrls as publicGetEditorUrls } from './editorurls-v2-editor-urls-editor.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getEditorUrls: MaybeContext<\n  BuildRESTFunction<typeof publicGetEditorUrls> & typeof publicGetEditorUrls\n> = /*#__PURE__*/ createRESTModule(publicGetEditorUrls);\n\nexport { EditorType } from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n  EditorUrls,\n  GetEditorUrlsRequest,\n  GetEditorUrlsResponse,\n  GetEditorUrlsOptions,\n} from './editorurls-v2-editor-urls-editor.universal.js';\nexport {\n  EditorTypeWithLiterals,\n  GetEditorUrlsApplicationErrors,\n} from './editorurls-v2-editor-urls-editor.universal.js';\n"]}