@widgetic/embed-sdk 2.0.16 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -10
- package/dist/browser/chunks/ABTestManager.js +1 -1
- package/dist/browser/chunks/api.js +1 -1
- package/dist/browser/chunks/core.js +1 -1
- package/dist/browser/chunks/renderers.js +1 -1
- package/dist/browser/chunks/scanner.js +1 -1
- package/dist/browser/chunks/security.js +1 -1
- package/dist/browser/chunks/workflows.js +1 -0
- package/dist/browser/embed-bootstrap.js +1 -1
- package/dist/browser/embed-sdk.js +1 -1
- package/dist/esm/chunks/ABTestManager.js +1 -1
- package/dist/esm/chunks/api.js +1 -1
- package/dist/esm/chunks/core.js +1 -1
- package/dist/esm/chunks/renderers.js +1 -1
- package/dist/esm/chunks/scanner.js +1 -1
- package/dist/esm/chunks/security.js +1 -1
- package/dist/esm/chunks/workflows.js +1 -0
- package/dist/esm/embed-bootstrap.js +1 -1
- package/dist/esm/embed-sdk.js +1 -1
- package/dist/esm/types/abTesting/abVisitor.d.ts +2 -0
- package/dist/esm/types/core/advanced-security-manager.d.ts +3 -0
- package/dist/esm/types/core/autoscale-manager.d.ts +6 -0
- package/dist/esm/types/core/widget-manager.d.ts +8 -43
- package/dist/esm/types/embed-sdk.d.ts +1 -0
- package/dist/esm/types/sdk/embed-sdk.d.ts +1 -0
- package/dist/esm/types/utils/declarative-embed-parser.d.ts +5 -0
- package/dist/esm/types/utils/host-workflow-watch.d.ts +62 -0
- package/dist/esm/types/utils/hydrate-published-host.d.ts +8 -4
- package/dist/esm/types/utils/mount-direct-widget.d.ts +12 -0
- package/dist/esm/types/utils/public-embed-lookup.d.ts +5 -0
- package/dist/esm/types/utils/published-host-bridge.d.ts +10 -0
- package/dist/esm/types/utils/workflow-code-loader.d.ts +14 -0
- package/dist/esm/types/utils/workflow-code-loader.umd.d.ts +32 -0
- package/dist/esm/types/utils/workflow-embed-registry.d.ts +15 -0
- package/dist/esm/types/utils/workflow-page-events.d.ts +41 -0
- package/dist/esm/types/utils/workflow-shared-contract.d.ts +35 -0
- package/dist/esm/types/utils/workflow-shared-services.d.ts +84 -0
- package/dist/esm/types/workflows/umd-entry.d.ts +1 -0
- package/dist/esm/types/workflows/visitor-position.d.ts +32 -0
- package/dist/esm/types/workflows/workflow-autoscale.d.ts +41 -0
- package/dist/esm/types/workflows/workflow-counts.d.ts +65 -0
- package/dist/esm/types/workflows/workflow-host.d.ts +71 -0
- package/dist/esm/types/workflows/workflow-lookup.d.ts +53 -0
- package/dist/esm/types/workflows/workflow-signals.d.ts +34 -0
- package/dist/esm/types/workflows/workflow-stage.d.ts +154 -0
- package/dist/umd/embed-bootstrap.js +1 -1
- package/dist/umd/embed-sdk-workflows.js +1 -0
- package/dist/umd/embed-sdk.js +1 -1
- package/package.json +2 -1
- package/dist/esm/types/core/realtime-manager.d.ts +0 -286
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./vendor.js";const t="https://api.axiom.co/v1",n="widgetic-performance",i="https://events.statsigapi.net/v1/custom",o=!0,r=1,a=1e3,s="",d=2500,u=2e3,l=100,c=50,p=.1,h=.05,g=1800,f=1200,m=800,v=600,w=3e3,y=2e3,I=5e5,R=3e5,T="50px",A=.1,k=3,q=3,S=1e3,C=10,E=5e3,U=36e5,b=6,_=!0,x=!0,D=!1,B="info",M="2.0.3",P="2.0.3";function K(){var e;return`${"undefined"!=typeof process&&"development"===(null===(e={NODE_ENV:"production"})||void 0===e?void 0:e.NODE_ENV)?W.DEV_API_URL:W.PROD_API_URL}${W.VERSION}`}const W={DEV_API_URL:"http://localhost:3000",PROD_API_URL:"https://api.widgetic.com",PROD_CLIENT_URL:"https://widgetic.com",PROD_CDN_URL:"https://cdn.widgetic.com",VERSION:"/api/v1",ENABLE_EDITING:!0},O="auto",z="inline",G="fixed",L=350,j=200,$=!1,N={CUSTOM_ELEMENTS:"undefined"!=typeof customElements,HTTP3:!1,RESIZE_OBSERVER:"undefined"!=typeof ResizeObserver},V=10,X=5e3,F=3;let H=D;const Y={get enabled(){return H},logLevel:B},Z=["apikey","api_key","api-key","servicekey","service_key","service-key","token","access_token","auth_token","secret","password","private_key","authorization","bearer","internal_key","public_api_key","public_internal_key"];function J(e){if("string"==typeof e){const t=e.toLowerCase();for(const n of Z)if(t.includes(n))return e.replace(/([a-zA-Z_-]*(?:key|token|secret|password)[a-zA-Z_-]*[:\s=]+)([^\s,}]+)/gi,"$1[REDACTED]");return e}if(null==e)return e;if(Array.isArray(e))return e.map(J);if("object"==typeof e){const t={};for(const[n,i]of Object.entries(e)){const e=n.toLowerCase();Z.some((t=>e.includes(t.toLowerCase())||e===t.toLowerCase()))&&"string"==typeof i&&i.length>0?t[n]=`[REDACTED_${i.length}_CHARS]`:t[n]=J(i)}return t}return e}const Q=new class{constructor(e=Y.logLevel){this.logLevels={debug:0,info:1,warn:2,error:3},this.currentLevel=this.logLevels[e]}shouldLog(e){return Y.enabled&&this.logLevels[e]>=this.currentLevel}formatMessage(e,t,...n){const i=(new Date).toISOString();return[`${`[Widgetic SDK] [${e.toUpperCase()}] [${i}]`} ${t}`,...n.map(J)]}debug(e,...t){this.shouldLog("debug")}info(e,...t){this.shouldLog("info")}warn(e,...t){this.shouldLog("warn")}error(e,...t){this.shouldLog("error")}setLevel(e){this.currentLevel=this.logLevels[e]}setDebug(e){!function(e){H=e}(e)}},ee={debug:(e,...t)=>Q.debug(e,...t),info:(e,...t)=>Q.info(e,...t),warn:(e,...t)=>Q.warn(e,...t),error:(e,...t)=>Q.error(e,...t),setLevel:e=>Q.setLevel(e)};class te{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}class ne{constructor(e){this.tokenEndpoint=e.tokenEndpoint||e.endpoint||"",this.refreshEndpoint=e.refreshEndpoint,this.headers=e.headers||{},e.apiKey&&!this.headers.Authorization&&(this.headers.Authorization=`Bearer ${e.apiKey}`)}getToken(){return e(this,void 0,void 0,(function*(){if(this.cachedToken&&(yield this.isTokenValid()))return this.cachedToken;const e=yield fetch(this.tokenEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},this.headers)});if(!e.ok)throw new Error(`Failed to fetch token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in?this.tokenExpiry=Date.now()+1e3*t.expires_in:t.expires_at&&(this.tokenExpiry=new Date(t.expires_at).getTime()),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}refreshToken(){return e(this,void 0,void 0,(function*(){if(!this.refreshEndpoint)return this.getToken();const e=yield fetch(this.refreshEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json",Authorization:`Bearer ${this.cachedToken}`},this.headers)});if(!e.ok)throw new Error(`Failed to refresh token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in&&(this.tokenExpiry=Date.now()+1e3*t.expires_in),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.cachedToken&&(!this.tokenExpiry||Date.now()<this.tokenExpiry)}))}}class ie{constructor(e,t){this.tokenFunction=e,this.validationFunction=t}getToken(){return e(this,void 0,void 0,(function*(){return yield this.tokenFunction()}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!this.validationFunction||(yield this.validationFunction())}))}}class oe{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){if(!this.apiKey)throw new Error("No API key available. Please configure a TokenProvider or set API keys.");return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}var re="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};const ae="https://api.widgetic.com/v1".replace(/\/+$/,""),se="X-SDK-Version";class de{constructor(e){if(this.configuration={basePath:ae,headers:{},middleware:[]},"string"==typeof e){const t=(null==e?void 0:e.startsWith("Bearer "))?e.slice(7):e;this.configuration.apiKey=e=>re(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${t}`:t})),this.configuration.accessToken=()=>re(this,void 0,void 0,(function*(){return t})),this.configuration.headers={"Content-Type":"application/json"}}else if(e){this.configuration=Object.assign(Object.assign({},e),{basePath:e.basePath||ae});if("string"==typeof e.accessToken&&e.accessToken){const t=e.accessToken,n=t.startsWith("Bearer ")?t.slice(7):t;this.configuration.apiKey=e=>re(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${n}`:n})),this.configuration.accessToken=()=>re(this,void 0,void 0,(function*(){return n}))}e.headers||(this.configuration.headers={"Content-Type":"application/json"})}}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:ae}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||ge}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){const e=this.configuration.accessToken;if(e)return"function"==typeof e?e:()=>re(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const ue=new de;class le{constructor(e=ue){this.configuration=e,this.fetchApi=(e,t)=>re(this,void 0,void 0,(function*(){let n,i={url:e,init:t};this.middleware&&Array.isArray(this.middleware)||(this.middleware=[]);for(const e of this.middleware)e.pre&&(i=(yield e.pre(Object.assign({fetch:this.fetchApi},i)))||i);try{n=yield(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(const t of this.middleware)t.onError&&(n=(yield t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0}))||n);if(void 0===n)throw e instanceof Error?new pe(e,"The request failed and the interceptors did not return an alternative response"):e}for(const e of this.middleware)e.post&&(n=(yield e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()}))||n);return n})),"string"!=typeof e&&(!e||e instanceof de)||(e=new de(e)),this.configuration=e,this.middleware=this.configuration.middleware||[]}withMiddleware(...e){const t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){const t=e.map((e=>({pre:e})));return this.withMiddleware(...t)}withPostMiddleware(...e){const t=e.map((e=>({post:e})));return this.withMiddleware(...t)}isJsonMime(e){return!!e&&le.jsonRegex.test(e)}request(e,t){return re(this,void 0,void 0,(function*(){var n;const{url:i,init:o}=yield this.createFetchParams(e,t),r=new Headers(Object.assign(Object.assign(Object.assign({},this.configuration.headers),e.headers||{}),o.headers||{})),a=Object.assign(Object.assign({},o),{headers:r}),s=yield this.fetchApi(i,a);if(s&&s.status>=200&&s.status<300)return s;const d=s.clone();let u="Response returned an error code",l=null;try{const e=yield d.json(),t=e.error,i=t&&"object"==typeof t?t.message:t;u=e.message||i||u;const o=null===(n=null==e?void 0:e.error)||void 0===n?void 0:n.code;"string"==typeof o&&o.length>0&&(l=o)}catch(e){try{u=yield d.text()}catch(e){u=s.statusText}}throw new ce(s,u,l)}))}createFetchParams(e,t){return re(this,void 0,void 0,(function*(){let n=(this.configuration.basePath||ae).replace(/\/+$/,"")+(e.path.startsWith("/")?e.path:`/${e.path}`);void 0!==e.query&&0!==Object.keys(e.query).length&&(n+="?"+this.configuration.queryParamsStringify(e.query));const i=Object.assign({},this.configuration.headers,e.headers);Object.keys(i).forEach((e=>void 0===i[e]?delete i[e]:{}));Object.keys(i).some((e=>e.toLowerCase()===se.toLowerCase()))||(i[se]="@widgetic/api-sdk/1.0.40");const o=this.configuration.apiKey;if(o&&!i.Authorization)try{const e=yield o("Authorization");e&&(i.Authorization=e.startsWith("Bearer ")?e:`Bearer ${e}`)}catch(e){}const r="function"==typeof t?t:()=>re(this,void 0,void 0,(function*(){return t})),a={method:e.method,headers:i,body:e.body,credentials:this.configuration.credentials},s=Object.assign(Object.assign({},a),yield r({init:a,context:e}));let d;var u;u=s.body,d="undefined"!=typeof FormData&&u instanceof FormData||s.body instanceof URLSearchParams||function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(s.body)?s.body:this.isJsonMime(i["Content-Type"])?JSON.stringify(s.body):s.body;return{url:n,init:Object.assign(Object.assign({},s),{body:d})}}))}clone(){const e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}le.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class ce extends Error{constructor(e,t,n=null){super(t),this.response=e,this.name="ResponseError",this.code=n}}class pe extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class he extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function ge(e,t=""){return Object.keys(e).map((n=>fe(n,e[n],t))).filter((e=>e.length>0)).join("&")}function fe(e,t,n=""){const i=n+(n.length?`[${e}]`:e);if(t instanceof Array){const e=t.map((e=>encodeURIComponent(String(e)))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${e}`}if(t instanceof Set){return fe(e,Array.from(t),n)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?ge(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}function me(e,t){return Object.keys(e).reduce(((n,i)=>Object.assign(Object.assign({},n),{[i]:t(e[i])})),{})}class ve{constructor(e,t=e=>e){this.raw=e,this.transformer=t}unwrapSuccessEnvelope(e){if(e&&"object"==typeof e&&"success"in e&&"data"in e){const{success:t,data:n,meta:i}=e,o="boolean"!=typeof t||t;return Array.isArray(n)?{success:o,data:n,meta:i,rawData:n}:n&&"object"==typeof n?Object.assign({success:o,data:n,meta:i},n):{success:o,data:n,meta:i}}return e}value(){return re(this,void 0,void 0,(function*(){const e=yield this.raw.json();return this.transformer(this.unwrapSuccessEnvelope(e))}))}}class we{constructor(e){this.raw=e}value(){return re(this,void 0,void 0,(function*(){}))}}function ye(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,abTestId:null==e.abTestId?void 0:e.abTestId,compositionId:null==e.compositionId?void 0:e.compositionId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,trafficPercentage:null==e.trafficPercentage?void 0:e.trafficPercentage,goalTarget:null==e.goalTarget?void 0:e.goalTarget,embedCode:null==e.embedCode?void 0:e.embedCode,totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Ie(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,organizationId:null==e.organizationId?void 0:e.organizationId,workspaceType:null==e.workspaceType?void 0:e.workspaceType,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,status:null==e.status?void 0:e.status,successMetrics:null==e.successMetrics?void 0:e.successMetrics,primaryMetric:null==e.primaryMetric?void 0:e.primaryMetric,confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel,minSampleSize:null==e.minSampleSize?void 0:e.minSampleSize,autoGraduate:null==e.autoGraduate?void 0:e.autoGraduate,graduationThreshold:null==e.graduationThreshold?void 0:e.graduationThreshold,startDate:null==e.startDate?void 0:new Date(e.startDate),endDate:null==e.endDate?void 0:new Date(e.endDate),durationDays:null==e.durationDays?void 0:e.durationDays,winningVariantId:null==e.winningVariantId?void 0:e.winningVariantId,graduatedAt:null==e.graduatedAt?void 0:new Date(e.graduatedAt),statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(ye)}}(e)}function Re(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,ab_test_id:null==e.ab_test_id?void 0:e.ab_test_id,variant_id:null==e.variant_id?void 0:e.variant_id,user_id:null==e.user_id?void 0:e.user_id,session_id:null==e.session_id?void 0:e.session_id,user_identifier_hash:null==e.user_identifier_hash?void 0:e.user_identifier_hash,assigned_at:null==e.assigned_at?void 0:new Date(e.assigned_at)}}(e)}function Te(e){return function(e){if(null==e)return e;return{hasMeaningfulContrast:null==e.hasMeaningfulContrast?void 0:e.hasMeaningfulContrast,primaryDriver:null==e.primaryDriver?void 0:e.primaryDriver,cognitiveClarityScore:null==e.cognitiveClarityScore?void 0:e.cognitiveClarityScore,safeToGraduate:null==e.safeToGraduate?void 0:e.safeToGraduate,qualitativeReason:null==e.qualitativeReason?void 0:e.qualitativeReason}}(e)}function Ae(e){return function(e){if(null==e)return e;return{action:null==e.action?void 0:e.action,reason:null==e.reason?void 0:e.reason,minAdditionalSamples:null==e.minAdditionalSamples?void 0:e.minAdditionalSamples}}(e)}function ke(e){return function(e){if(null==e)return e;return{detected:null==e.detected?void 0:e.detected,pValue:null==e.pValue?void 0:e.pValue}}(e)}function qe(e){return function(e){if(null==e)return e;return{totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,totalImpressionEvents:null==e.totalImpressionEvents?void 0:e.totalImpressionEvents,totalConversionEvents:null==e.totalConversionEvents?void 0:e.totalConversionEvents,counting:null==e.counting?void 0:e.counting,overallConversionRate:null==e.overallConversionRate?void 0:e.overallConversionRate,statisticalPower:null==e.statisticalPower?void 0:e.statisticalPower,sampleSizeNeededPerVariant:null==e.sampleSizeNeededPerVariant?void 0:e.sampleSizeNeededPerVariant,sampleRatioMismatch:null==e.sampleRatioMismatch?void 0:ke(e.sampleRatioMismatch),confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel}}(e)}function Se(e){return function(e){if(null==e)return e;return{variantId:null==e.variantId?void 0:e.variantId,variantName:null==e.variantName?void 0:e.variantName,impressions:null==e.impressions?void 0:e.impressions,conversions:null==e.conversions?void 0:e.conversions,rawImpressions:null==e.rawImpressions?void 0:e.rawImpressions,rawConversions:null==e.rawConversions?void 0:e.rawConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,confidenceIntervalLower:null==e.confidenceIntervalLower?void 0:e.confidenceIntervalLower,confidenceIntervalUpper:null==e.confidenceIntervalUpper?void 0:e.confidenceIntervalUpper,zScore:null==e.zScore?void 0:e.zScore,pValue:null==e.pValue?void 0:e.pValue,isWinner:null==e.isWinner?void 0:e.isWinner,liftPercentage:null==e.liftPercentage?void 0:e.liftPercentage,statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,significantlyWorse:null==e.significantlyWorse?void 0:e.significantlyWorse,bayesianProbabilityToBeatControl:null==e.bayesianProbabilityToBeatControl?void 0:e.bayesianProbabilityToBeatControl}}(e)}function Ce(e){return function(e){if(null==e)return e;return{overall:null==e.overall?void 0:qe(e.overall),variants:null==e.variants?void 0:e.variants.map(Se),recommendation:null==e.recommendation?void 0:Ae(e.recommendation)}}(e)}function Ee(e){return function(e){if(null==e)return e;return{id:e.id,title:e.title,status:e.status,charCount:e.charCount,chunkCount:e.chunkCount,createdAt:new Date(e.createdAt),readyAt:null==e.readyAt?null:new Date(e.readyAt)}}(e)}function Ue(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ee(e.data)}}(e)}function be(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,translationId:null==e.translationId?void 0:e.translationId,compositionId:null==e.compositionId?void 0:e.compositionId,languageCode:null==e.languageCode?void 0:e.languageCode,languageName:null==e.languageName?void 0:e.languageName,isRoot:null==e.isRoot?void 0:e.isRoot,embedCode:null==e.embedCode?void 0:e.embedCode,totalViews:null==e.totalViews?void 0:e.totalViews,status:null==e.status?void 0:e.status,translationProgress:null==e.translationProgress?void 0:e.translationProgress,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function _e(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,status:null==e.status?void 0:e.status,embedCode:null==e.embedCode?void 0:e.embedCode,selectedLanguages:null==e.selectedLanguages?void 0:e.selectedLanguages,totalViews:null==e.totalViews?void 0:e.totalViews,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(be)}}(e)}function xe(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_e(e.data),message:null==e.message?void 0:e.message}}(e)}function De(e){return function(e){if(null==e)return e;return{documents:e.documents,characters:e.characters,maxDocuments:e.maxDocuments,maxTotalChars:e.maxTotalChars}}(e)}function Be(e){return function(e){if(null==e)return e;return{documents:e.documents.map(Ee),totals:De(e.totals)}}(e)}function Me(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function Pe(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),country:e.country,region:null==e.region?void 0:e.region,city:null==e.city?void 0:e.city,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function Ke(e){return function(e){if(null==e)return e;return{total_views:null==e.total_views?void 0:e.total_views,unique_views:null==e.unique_views?void 0:e.unique_views,total_interactions:null==e.total_interactions?void 0:e.total_interactions,unique_interactions:null==e.unique_interactions?void 0:e.unique_interactions,average_session_time:null==e.average_session_time?void 0:e.average_session_time,bounce_rate:null==e.bounce_rate?void 0:e.bounce_rate}}(e)}function We(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),deviceType:e.deviceType,views:e.views,uniqueUsers:e.uniqueUsers,avgSessionDuration:e.avgSessionDuration,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Oe(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,timestamp:new Date(e.timestamp),eventType:e.eventType,eventData:null==e.eventData?void 0:e.eventData,userId:null==e.userId?void 0:e.userId,sessionId:null==e.sessionId?void 0:e.sessionId,ipAddress:null==e.ipAddress?void 0:e.ipAddress,userAgent:null==e.userAgent?void 0:e.userAgent,referrer:null==e.referrer?void 0:e.referrer,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function ze(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),source:e.source,source_url:null==e.source_url?void 0:e.source_url,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function Ge(e){return function(e){if(null==e)return e;return{summary:Ke(e.summary),devices:e.devices.map(We),geography:e.geography.map(Pe),referrers:e.referrers.map(ze),events:null==e.events?void 0:e.events.map(Oe)}}(e)}function Le(e){return function(e){if(null==e)return e;return{events:null==e.events?void 0:e.events.map(Oe),totalEvents:null==e.totalEvents?void 0:e.totalEvents,databaseStored:null==e.databaseStored?void 0:e.databaseStored,axiomStreamed:null==e.axiomStreamed?void 0:e.axiomStreamed,processingTimeMs:null==e.processingTimeMs?void 0:e.processingTimeMs}}(e)}function je(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,eventType:e.eventType,eventData:e.eventData,userId:e.userId,sessionId:e.sessionId,ipAddress:e.ipAddress,userAgent:e.userAgent,referrer:e.referrer}}(e,!1)}function $e(e){return function(e){if(null==e)return e;return{events:e.events.map(je)}}(e,!1)}function Ne(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function Ve(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function Xe(e){return function(e){if(null==e)return e;return{should_stop:null==e.should_stop?void 0:e.should_stop,reason:null==e.reason?void 0:e.reason,new_status:null==e.new_status?void 0:e.new_status}}(e)}function Fe(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Xe(e.data)}}(e)}function He(e){return function(e){if(null==e)return e;return{id:e.id,creatorId:e.creatorId,widgetId:e.widgetId,name:e.name,content:e.content,contentVersion:null==e.contentVersion?void 0:e.contentVersion,status:e.status,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),embedSettings:null==e.embedSettings?void 0:e.embedSettings,design:null==e.design?void 0:e.design,databaseId:null==e.databaseId?void 0:e.databaseId,projectId:null==e.projectId?void 0:e.projectId,managedUserId:null==e.managedUserId?void 0:e.managedUserId,direct:null==e.direct?void 0:e.direct}}(e)}function Ye(e){return function(e){if(null==e)return e;return{url:e.url,refreshSeconds:e.refreshSeconds}}(e)}function Ze(e){return function(e){if(null==e)return e;return{name:e.name,type:e.type}}(e)}function Je(e){return function(e){if(null==e)return e;return{name:e.name,columns:e.columns.map(Ze),rows:e.rows}}(e)}function Qe(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,hasData:e.hasData,tables:e.tables.map(Je)}}(e)}function et(e){return function(e){if(null==e)return e;return{value:e.value,count:e.count}}(e)}function tt(e){return function(e){if(null==e)return e;return{group:null==e.group?void 0:e.group,count:null==e.count?void 0:e.count,avg:null==e.avg?void 0:e.avg,min:null==e.min?void 0:e.min,max:null==e.max?void 0:e.max,sum:null==e.sum?void 0:e.sum}}(e)}function nt(e){return function(e){if(null==e)return e;return{column:e.column,tallies:e.tallies.map(tt),truncated:null==e.truncated?void 0:e.truncated}}(e)}function it(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,table:e.table,totalRows:e.totalRows,tallies:null==e.tallies?null:e.tallies.map(et),moreGroups:e.moreGroups,columns:e.columns,rows:null==e.rows?null:e.rows,moreRows:e.moreRows,aggregates:null==e.aggregates?void 0:nt(e.aggregates)}}(e)}function ot(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,compositionId:null==e.compositionId?void 0:e.compositionId,version:null==e.version?void 0:e.version,content:null==e.content?void 0:e.content,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function rt(e){return function(e){if(null==e)return e;return{path:e.path,message:e.message,expected:null==e.expected?void 0:e.expected,actual:null==e.actual?void 0:e.actual}}(e)}function at(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function st(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:at(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent,item:null==e.item?void 0:e.item}}(e)}function dt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Re(e.data)}}(e)}function ut(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,compositionId:e.compositionId,trafficPercentage:e.trafficPercentage,goalTarget:e.goalTarget}}(e,!1)}function lt(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,workspaceType:e.workspaceType,variants:e.variants.map(ut),successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function ct(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function pt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:He(e.data),meta:null==e.meta?void 0:ct(e.meta)}}(e)}function ht(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:st(e.data)}}(e)}function gt(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{position:e.position})}(e,!1)}function ft(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function mt(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function vt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:He(e.data),meta:null==e.meta?void 0:mt(e.meta)}}(e)}function wt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_e(e.data),message:null==e.message?void 0:e.message}}(e)}function yt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId,warnings:null==e.warnings?void 0:e.warnings}}(e)}function It(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:yt(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function Rt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ie(e.data)}}(e)}function Tt(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function At(e){return function(e){if(null==e)return e;return{deleted:null==e.deleted?void 0:e.deleted,contentVersion:null==e.contentVersion?void 0:e.contentVersion}}(e)}function kt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function qt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function St(e){return function(e){if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId}}(e)}function Ct(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:St(e.data)}}(e)}function Et(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId}}(e)}function Ut(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Et(e.data),warnings:null==e.warnings?void 0:e.warnings}}(e)}function bt(e){return function(e){if(null==e)return e;return{token:null==e.token?void 0:e.token,tokenType:null==e.tokenType?void 0:e.tokenType,expiresIn:null==e.expiresIn?void 0:e.expiresIn,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt),scopes:null==e.scopes?void 0:e.scopes}}(e)}function _t(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:bt(e.data)}}(e)}function xt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,composition_id:null==e.composition_id?void 0:e.composition_id,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage,goal_target:null==e.goal_target?void 0:e.goal_target}}(e)}function Dt(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,name:null==e.name?void 0:e.name,status:null==e.status?void 0:e.status,variants:null==e.variants?void 0:e.variants.map(xt),success_metrics:null==e.success_metrics?void 0:e.success_metrics,primary_metric:null==e.primary_metric?void 0:e.primary_metric}}(e)}function Bt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Be(e.data)}}(e)}function Mt(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total}}(e)}function Pt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(He),meta:null==e.meta?void 0:Mt(e.meta)}}(e)}function Kt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,tracking:null==e.tracking?void 0:e.tracking,supportsElementTarget:null==e.supportsElementTarget?void 0:e.supportsElementTarget,available:null==e.available?void 0:e.available,unavailableReason:null==e.unavailableReason?void 0:e.unavailableReason}}(e)}function Wt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Kt)}}(e)}function Ot(e){return function(e){if(null==e)return e;return{selector:null==e.selector?void 0:e.selector,label:null==e.label?void 0:e.label,kind:null==e.kind?void 0:e.kind,tag:null==e.tag?void 0:e.tag,metrics:null==e.metrics?void 0:e.metrics,preferred:null==e.preferred?void 0:e.preferred,matchCount:null==e.matchCount?void 0:e.matchCount}}(e)}function zt(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,complete:null==e.complete?void 0:e.complete,note:null==e.note?void 0:e.note,targets:null==e.targets?void 0:e.targets.map(Ot)}}(e)}function Gt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:zt(e.data)}}(e)}function Lt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:He(e.data)}}(e)}function jt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,contentItems:null==e.contentItems?void 0:e.contentItems,metadata:null==e.metadata?void 0:e.metadata}}(e)}function $t(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function Nt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,theme:null==e.theme?void 0:e.theme,componentGroups:null==e.componentGroups?void 0:e.componentGroups,metadata:null==e.metadata?void 0:e.metadata}}(e)}function Vt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,version:null==e.version?void 0:e.version,type:null==e.type?void 0:e.type,componentGroups:null==e.componentGroups?void 0:e.componentGroups,defaults:null==e.defaults?void 0:e.defaults}}(e)}function Xt(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,previewUrl:null==e.previewUrl?void 0:e.previewUrl}}(e)}function Ft(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(ot)}}(e)}function Ht(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,error:null==e.error?void 0:e.error}}(e)}function Yt(e){return function(e){if(null==e)return e;return{compositions:null==e.compositions?void 0:e.compositions.map(He),errors:null==e.errors?void 0:e.errors.map(Ht)}}(e)}function Zt(e){return function(e){if(null==e)return e;return{presets:null==e.presets?void 0:e.presets}}(e)}function Jt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Zt(e.data)}}(e)}function Qt(e){return function(e){if(null==e)return e;return{name:null==e.name?void 0:e.name,nativeName:null==e.nativeName?void 0:e.nativeName,region:null==e.region?void 0:e.region,isPreselected:null==e.isPreselected?void 0:e.isPreselected}}(e)}function en(e){return function(e){if(null==e)return e;return{languages:null==e.languages?void 0:me(e.languages,Qt),preselected:null==e.preselected?void 0:e.preselected}}(e)}function tn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:en(e.data)}}(e)}function nn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_e(e.data)}}(e)}function on(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views,percentage:null==e.percentage?void 0:e.percentage}}(e)}function rn(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views}}(e)}function an(e){return function(e){if(null==e)return e;return{totalViews:null==e.totalViews?void 0:e.totalViews,languageBreakdown:null==e.languageBreakdown?void 0:e.languageBreakdown.map(on),topPerformingLanguages:null==e.topPerformingLanguages?void 0:e.topPerformingLanguages.map(rn),completionStatus:null==e.completionStatus?void 0:e.completionStatus}}(e)}function sn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:an(e.data)}}(e)}function dn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,languageCompositions:null==e.languageCompositions?void 0:e.languageCompositions,status:null==e.status?void 0:e.status}}(e)}function un(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:dn(e.data)}}(e)}function ln(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(_e),count:null==e.count?void 0:e.count}}(e)}function cn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,composition_id:null==e.composition_id?void 0:e.composition_id,name:null==e.name?void 0:e.name,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage}}(e)}function pn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,version:null==e.version?void 0:e.version,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,publishedAt:null==e.publishedAt?void 0:new Date(e.publishedAt),isPublished:null==e.isPublished?void 0:e.isPublished,prompt:null==e.prompt?void 0:e.prompt,publishedBy:null==e.publishedBy?void 0:e.publishedBy}}(e)}function hn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(pn)}}(e)}function gn(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total,limit:null==e.limit?void 0:e.limit,offset:null==e.offset?void 0:e.offset,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage}}(e)}function fn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Et),meta:null==e.meta?void 0:gn(e.meta)}}(e)}function mn(e){return function(e){if(null==e)return e;return{widgets:null==e.widgets?void 0:e.widgets.map(Et),errors:null==e.errors?void 0:e.errors.map(Ht)}}(e)}function vn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Te(e.data)}}(e)}function wn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ce(e.data)}}(e)}function yn(e){return function(e){if(null==e)return e;return{count:null==e.count?void 0:e.count,workspace_type:null==e.workspace_type?void 0:e.workspace_type}}(e)}function In(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Ie),meta:null==e.meta?void 0:yn(e.meta)}}(e)}function Rn(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,month:e.month,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Tn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function An(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Me(e.data)}}(e)}function kn(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function qn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:kn(e.data)}}(e)}function Sn(e){return function(e){if(null==e)return e;return{email:e.email}}(e,!1)}function Cn(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function En(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:Cn(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent}}(e)}function Un(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function bn(e){return function(e){if(null==e)return e;return{data:null==e.data?void 0:Un(e.data),message:null==e.message?void 0:e.message,warnings:null==e.warnings?void 0:e.warnings}}(e)}function _n(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:bn(e.data)}}(e)}function xn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ie(e.data),message:null==e.message?void 0:e.message}}(e)}function Dn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ie(e.data),message:null==e.message?void 0:e.message}}(e)}function Bn(e){return function(e){if(null==e)return e;return{limit:null==e.limit?void 0:e.limit,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage,nextCursor:null==e.nextCursor?void 0:e.nextCursor,previousCursor:null==e.previousCursor?void 0:e.previousCursor}}(e)}function Mn(e){return function(e){if(null==e)return e;return{pagination:null==e.pagination?void 0:Bn(e.pagination)}}(e)}function Pn(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data,meta:null==e.meta?void 0:Mn(e.meta)}}(e)}function Kn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Wn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString(),user_id:e.user_id,session_id:e.session_id}}(e,!1)}function On(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Wn(e.data)}}(e,!1)}function zn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message,count:null==e.count?void 0:e.count}}(e)}function Gn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,user_id:e.user_id,session_id:e.session_id,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString()}}(e,!1)}function Ln(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Gn(e.data)}}(e,!1)}function jn(e){return function(e){if(null==e)return e;return{events:e.events.map(Ln)}}(e,!1)}function $n(e){return function(e){if(null==e)return e;return{id:e.id,goalTarget:e.goalTarget}}(e,!1)}function Nn(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,variants:null==e.variants?void 0:e.variants.map($n),confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function Vn(e){return function(e){if(null==e)return e;return{token:e.token,email:e.email}}(e,!1)}function Xn(e){return function(e){if(null==e)return e;return{repositoryId:null==e.repositoryId?void 0:e.repositoryId}}(e)}function Fn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Xn(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function Hn(e){return function(e){if(null==e)return e;return{thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl}}(e)}function Yn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Hn(e.data)}}(e)}function Zn(e){return function(e){if(null==e)return e;return{valid:e.valid,errors:null==e.errors?void 0:e.errors.map(rt),warnings:null==e.warnings?void 0:e.warnings.map(rt),sanitizedContent:null==e.sanitizedContent?void 0:e.sanitizedContent}}(e)}function Jn(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,reason:null==e.reason?void 0:e.reason,message:null==e.message?void 0:e.message}}(e)}function Qn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Jn(e.data)}}(e)}function ei(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,tokenType:null==e.tokenType?void 0:e.tokenType,scopes:null==e.scopes?void 0:e.scopes,userId:null==e.userId?void 0:e.userId,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt)}}(e)}function ti(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ei(e.data)}}(e)}function ni(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,impact:null==e.impact?void 0:e.impact}}(e)}function ii(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,reason:null==e.reason?void 0:e.reason}}(e)}function oi(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,blockers:null==e.blockers?void 0:e.blockers.map(ii),warnings:null==e.warnings?void 0:e.warnings.map(ni)}}(e)}function ri(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:oi(e.data)}}(e)}function ai(e){return function(e){if(null==e)return e;return{variant:null==e.variant?void 0:e.variant,metric:null==e.metric?void 0:e.metric,reason:null==e.reason?void 0:e.reason}}(e)}function si(e){return function(e){if(null==e)return e;return{is_valid:null==e.is_valid?void 0:e.is_valid,issues:null==e.issues?void 0:e.issues.map(ai),recommendations:null==e.recommendations?void 0:e.recommendations}}(e)}function di(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:si(e.data)}}(e)}function ui(e){return function(e){if(null==e)return e;return{composition_id:e.composition_id,name:e.name}}(e,!1)}function li(e){return function(e){if(null==e)return e;return{variants:e.variants.map(ui),success_metrics:e.success_metrics}}(e,!1)}function ci(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,affected_compositions:null==e.affected_compositions?void 0:e.affected_compositions,blockers:null==e.blockers?void 0:e.blockers.map(ii),warnings:null==e.warnings?void 0:e.warnings.map(ni)}}(e)}function pi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ci(e.data)}}(e)}function hi(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,weekNumber:e.weekNumber,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}var gi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class fi extends le{assignVariantRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling assignVariant().');if(null==e.assignVariantRequest)throw new he("assignVariantRequest",'Required parameter "assignVariantRequest" was null or undefined when calling assignVariant().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/{id}/assign".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.assignVariantRequest,o=r,null==o?o:{user_id:o.user_id,session_id:o.session_id})},t);var o,r;return new ve(i,(e=>ye(e)))}))}assignVariant(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.assignVariantRaw(e,t);return yield n.value()}))}checkWorkspaceABTestAutoStopRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling checkWorkspaceABTestAutoStop().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling checkWorkspaceABTestAutoStop().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/auto-stop-check".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Fe(e)))}))}checkWorkspaceABTestAutoStop(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.checkWorkspaceABTestAutoStopRaw(e,t);return yield n.value()}))}createABTestAssignmentRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.createABTestAssignmentRequest)throw new he("createABTestAssignmentRequest",'Required parameter "createABTestAssignmentRequest" was null or undefined when calling createABTestAssignment().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/assignments",method:"POST",headers:n,query:{},body:(r=e.createABTestAssignmentRequest,o=r,null==o?o:{experiment_id:o.experiment_id,variant_id:o.variant_id,user_id:o.user_id,session_id:o.session_id,device_type:o.device_type,user_agent:o.user_agent,ip_address:o.ip_address,country_code:o.country_code})},t);var o,r;return new ve(i,(e=>dt(e)))}))}createABTestAssignment(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.createABTestAssignmentRaw(e,t);return yield n.value()}))}createWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABTest().');if(null==e.createABTestRequest)throw new he("createABTestRequest",'Required parameter "createABTestRequest" was null or undefined when calling createWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:lt(e.createABTestRequest)},t);return new ve(i,(e=>Rt(e)))}))}createWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABTestRaw(e,t);return yield n.value()}))}deleteWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling deleteWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>qt(e)))}))}deleteWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABTestRaw(e,t);return yield n.value()}))}getABTestConfigRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getABTestConfig().');const n=yield this.request({path:"/ab-tests/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new ve(n,(e=>Dt(e)))}))}getABTestConfig(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.getABTestConfigRaw(e,t);return yield n.value()}))}getAvailableMetricsRaw(e){return gi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/metrics/available",method:"GET",headers:t,query:{}},e);return new ve(n,(e=>Wt(e)))}))}getAvailableMetrics(e){return gi(this,void 0,void 0,(function*(){const t=yield this.getAvailableMetricsRaw(e);return yield t.value()}))}getCompositionABGoalTargetsRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getCompositionABGoalTargets().');if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionABGoalTargets().');const n={};null!=e.metric&&(n.metric=e.metric);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/compositions/{id}/ab-goal-targets".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>Gt(e)))}))}getCompositionABGoalTargets(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.getCompositionABGoalTargetsRaw(e,t);return yield n.value()}))}getVariantConfigRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getVariantConfig().');const n=yield this.request({path:"/ab-tests/variants/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new ve(n,(e=>cn(e)))}))}getVariantConfig(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.getVariantConfigRaw(e,t);return yield n.value()}))}getWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Rt(e)))}))}getWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestRaw(e,t);return yield n.value()}))}getWorkspaceABTestDiagnosisRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestDiagnosis().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestDiagnosis().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/diagnosis".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>vn(e)))}))}getWorkspaceABTestDiagnosis(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestDiagnosisRaw(e,t);return yield n.value()}))}getWorkspaceABTestStatisticsRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestStatistics().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestStatistics().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/statistics".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>wn(e)))}))}getWorkspaceABTestStatistics(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestStatisticsRaw(e,t);return yield n.value()}))}listWorkspaceABTestsRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling listWorkspaceABTests().');const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>In(e)))}))}listWorkspaceABTests(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceABTestsRaw(e,t);return yield n.value()}))}pauseWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling pauseWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/pause".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new ve(i,(e=>Rt(e)))}))}pauseWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.pauseWorkspaceABTestRaw(e,t);return yield n.value()}))}setWorkspaceABTestDurationRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.setWorkspaceABTestDurationRequest)throw new he("setWorkspaceABTestDurationRequest",'Required parameter "setWorkspaceABTestDurationRequest" was null or undefined when calling setWorkspaceABTestDuration().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/duration".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:(r=e.setWorkspaceABTestDurationRequest,o=r,null==o?o:{duration_days:o.duration_days})},t);var o,r;return new ve(i,(e=>xn(e)))}))}setWorkspaceABTestDuration(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.setWorkspaceABTestDurationRaw(e,t);return yield n.value()}))}startWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling startWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling startWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/start".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new ve(i,(e=>Rt(e)))}))}startWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.startWorkspaceABTestRaw(e,t);return yield n.value()}))}stopWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling stopWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling stopWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/stop".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{},body:(r=e.stopWorkspaceABTestRequest,o=r,null==o?o:{winning_variant_id:o.winning_variant_id,winningVariantId:o.winningVariantId})},t);var o,r;return new ve(i,(e=>Dn(e)))}))}stopWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.stopWorkspaceABTestRaw(e,t);return yield n.value()}))}trackABTestEventRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.trackABTestEventRequest)throw new he("trackABTestEventRequest",'Required parameter "trackABTestEventRequest" was null or undefined when calling trackABTestEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/events",method:"POST",headers:n,query:{},body:On(e.trackABTestEventRequest)},t);return new ve(i,(e=>Kn(e)))}))}trackABTestEvent(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.trackABTestEventRaw(e,t);return yield n.value()}))}trackBulkABTestEventsRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.trackBulkABTestEventsRequest)throw new he("trackBulkABTestEventsRequest",'Required parameter "trackBulkABTestEventsRequest" was null or undefined when calling trackBulkABTestEvents().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/bulk",method:"POST",headers:n,query:{},body:jn(e.trackBulkABTestEventsRequest)},t);return new ve(i,(e=>zn(e)))}))}trackBulkABTestEvents(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.trackBulkABTestEventsRaw(e,t);return yield n.value()}))}updateWorkspaceABTestRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.updateABTestRequest)throw new he("updateABTestRequest",'Required parameter "updateABTestRequest" was null or undefined when calling updateWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:Nn(e.updateABTestRequest)},t);return new ve(i,(e=>Rt(e)))}))}updateWorkspaceABTest(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.updateWorkspaceABTestRaw(e,t);return yield n.value()}))}validateWorkspaceCompositionDeletionRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceCompositionDeletion().');if(null==e.validateWorkspaceCompositionDeletionRequest)throw new he("validateWorkspaceCompositionDeletionRequest",'Required parameter "validateWorkspaceCompositionDeletionRequest" was null or undefined when calling validateWorkspaceCompositionDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-composition-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceCompositionDeletionRequest,o=r,null==o?o:{composition_ids:o.composition_ids})},t);var o,r;return new ve(i,(e=>ri(e)))}))}validateWorkspaceCompositionDeletion(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceCompositionDeletionRaw(e,t);return yield n.value()}))}validateWorkspaceGoalTrackingRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceGoalTracking().');if(null==e.validateWorkspaceGoalTrackingRequest)throw new he("validateWorkspaceGoalTrackingRequest",'Required parameter "validateWorkspaceGoalTrackingRequest" was null or undefined when calling validateWorkspaceGoalTracking().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-goal-tracking".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:li(e.validateWorkspaceGoalTrackingRequest)},t);return new ve(i,(e=>di(e)))}))}validateWorkspaceGoalTracking(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceGoalTrackingRaw(e,t);return yield n.value()}))}validateWorkspaceWidgetDeletionRaw(e,t){return gi(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceWidgetDeletion().');if(null==e.validateWorkspaceWidgetDeletionRequest)throw new he("validateWorkspaceWidgetDeletionRequest",'Required parameter "validateWorkspaceWidgetDeletionRequest" was null or undefined when calling validateWorkspaceWidgetDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-widget-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceWidgetDeletionRequest,o=r,null==o?o:{widget_id:o.widget_id})},t);var o,r;return new ve(i,(e=>pi(e)))}))}validateWorkspaceWidgetDeletion(e,t){return gi(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceWidgetDeletionRaw(e,t);return yield n.value()}))}}var mi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class vi extends le{analyticsEventsBulkPostRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.analyticsEventsBulkPostRequest)throw new he("analyticsEventsBulkPostRequest",'Required parameter "analyticsEventsBulkPostRequest" was null or undefined when calling analyticsEventsBulkPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/analytics/events/bulk",method:"POST",headers:n,query:{},body:$e(e.analyticsEventsBulkPostRequest)},t);return new ve(i,(e=>Le(e)))}))}analyticsEventsBulkPost(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.analyticsEventsBulkPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDailyGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDailyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/daily".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(Tt)))}))}compositionsIdAnalyticsDailyGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDailyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDashboardGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDashboardGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.includeEvents&&(n.include_events=e.includeEvents);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/dashboard".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>Ge(e)))}))}compositionsIdAnalyticsDashboardGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDashboardGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDevicesGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDevicesGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.deviceType&&(n.device_type=e.deviceType),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/devices".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(We)))}))}compositionsIdAnalyticsDevicesGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDevicesGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.eventType&&(n.event_type=e.eventType),null!=e.userId&&(n.user_id=e.userId),null!=e.sessionId&&(n.session_id=e.sessionId),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(Oe)))}))}compositionsIdAnalyticsEventsGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsPostRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsPost().');if(null==e.newAnalyticsEvent)throw new he("newAnalyticsEvent",'Required parameter "newAnalyticsEvent" was null or undefined when calling compositionsIdAnalyticsEventsPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:je(e.newAnalyticsEvent)},t);return new ve(i,(e=>Oe(e)))}))}compositionsIdAnalyticsEventsPost(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsGeographyGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsGeographyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.country&&(n.country=e.country),null!=e.region&&(n.region=e.region),null!=e.city&&(n.city=e.city),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/geography".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(Pe)))}))}compositionsIdAnalyticsGeographyGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsGeographyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsMonthlyGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsMonthlyGet().');const n={};null!=e.month&&(n.month=e.month),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/monthly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(Rn)))}))}compositionsIdAnalyticsMonthlyGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsMonthlyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsReferrersGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsReferrersGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.source&&(n.source=e.source),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/referrers".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(ze)))}))}compositionsIdAnalyticsReferrersGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsReferrersGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsWeeklyGetRaw(e,t){return mi(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsWeeklyGet().');const n={};null!=e.weekNumber&&(n.week_number=e.weekNumber),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/weekly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>e.map(hi)))}))}compositionsIdAnalyticsWeeklyGet(e,t){return mi(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsWeeklyGetRaw(e,t);return yield n.value()}))}flushAxiomEventsRaw(e){return mi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/flush",method:"POST",headers:t,query:{}},e);return new ve(n,(e=>Pn(e)))}))}flushAxiomEvents(e){return mi(this,void 0,void 0,(function*(){const t=yield this.flushAxiomEventsRaw(e);return yield t.value()}))}getAxiomStatusRaw(e){return mi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/status",method:"GET",headers:t,query:{}},e);return new ve(n,(e=>Pn(e)))}))}getAxiomStatus(e){return mi(this,void 0,void 0,(function*(){const t=yield this.getAxiomStatusRaw(e);return yield t.value()}))}}var wi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class yi extends le{completeSignupRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.completeSignupRequest)throw new he("completeSignupRequest",'Required parameter "completeSignupRequest" was null or undefined when calling completeSignup().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/complete-signup",method:"POST",headers:n,query:{},body:(r=e.completeSignupRequest,o=r,null==o?o:{userId:o.userId,email:o.email,role:o.role,plan:o.plan,token:o.token})},t);var o,r;return new we(i)}))}completeSignup(e,t){return wi(this,void 0,void 0,(function*(){yield this.completeSignupRaw(e,t)}))}confirmEmailRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new he("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling confirmEmail().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/confirm-email",method:"POST",headers:n,query:{},body:Vn(e.updateEmailRequest)},t);return new we(i)}))}confirmEmail(e,t){return wi(this,void 0,void 0,(function*(){yield this.confirmEmailRaw(e,t)}))}consumeOAuthSessionBridgeRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.bridgeId)throw new he("bridgeId",'Required parameter "bridgeId" was null or undefined when calling consumeOAuthSessionBridge().');const n=yield this.request({path:"/auth/oauth-session/{bridgeId}".replace("{bridgeId}",encodeURIComponent(String(e.bridgeId))),method:"GET",headers:{},query:{}},t);return new we(n)}))}consumeOAuthSessionBridge(e,t){return wi(this,void 0,void 0,(function*(){yield this.consumeOAuthSessionBridgeRaw(e,t)}))}deleteAccountRaw(e,t){return wi(this,void 0,void 0,(function*(){const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/delete-account",method:"POST",headers:n,query:{},body:(r=e.deleteAccountRequest,o=r,null==o?o:{password:o.password})},t);var o,r;return new we(i)}))}deleteAccount(){return wi(this,arguments,void 0,(function*(e={},t){yield this.deleteAccountRaw(e,t)}))}getSessionRaw(e){return wi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/session",method:"GET",headers:t,query:{}},e);return new we(n)}))}getSession(e){return wi(this,void 0,void 0,(function*(){yield this.getSessionRaw(e)}))}getUserMetadataRaw(e){return wi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/get-metadata",method:"GET",headers:t,query:{}},e);return new we(n)}))}getUserMetadata(e){return wi(this,void 0,void 0,(function*(){yield this.getUserMetadataRaw(e)}))}initiateOAuthRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.provider)throw new he("provider",'Required parameter "provider" was null or undefined when calling initiateOAuth().');const n={};null!=e.redirectTo&&(n.redirectTo=e.redirectTo),null!=e.role&&(n.role=e.role),null!=e.plan&&(n.plan=e.plan);const i=yield this.request({path:"/auth/oauth/{provider}".replace("{provider}",encodeURIComponent(String(e.provider))),method:"GET",headers:{},query:n},t);return new we(i)}))}initiateOAuth(e,t){return wi(this,void 0,void 0,(function*(){yield this.initiateOAuthRaw(e,t)}))}loginUserRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.loginUserRequest)throw new he("loginUserRequest",'Required parameter "loginUserRequest" was null or undefined when calling loginUser().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/login",method:"POST",headers:n,query:{},body:(r=e.loginUserRequest,o=r,null==o?o:{email:o.email,password:o.password})},t);var o,r;return new ve(i,(e=>Tn(e)))}))}loginUser(e,t){return wi(this,void 0,void 0,(function*(){const n=yield this.loginUserRaw(e,t);return yield n.value()}))}logoutUserRaw(e){return wi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/logout",method:"POST",headers:t,query:{}},e);return new we(n)}))}logoutUser(e){return wi(this,void 0,void 0,(function*(){yield this.logoutUserRaw(e)}))}refreshSessionRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.refreshSessionRequest)throw new he("refreshSessionRequest",'Required parameter "refreshSessionRequest" was null or undefined when calling refreshSession().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/refresh",method:"POST",headers:n,query:{},body:(r=e.refreshSessionRequest,o=r,null==o?o:{refresh_token:o.refresh_token})},t);var o,r;return new we(i)}))}refreshSession(e,t){return wi(this,void 0,void 0,(function*(){yield this.refreshSessionRaw(e,t)}))}resendConfirmationRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new he("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resendConfirmation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/resend-confirmation",method:"POST",headers:n,query:{},body:Sn(e.resetPasswordRequest)},t);return new we(i)}))}resendConfirmation(e,t){return wi(this,void 0,void 0,(function*(){yield this.resendConfirmationRaw(e,t)}))}resetPasswordRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new he("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resetPassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/reset-password",method:"POST",headers:n,query:{},body:Sn(e.resetPasswordRequest)},t);return new we(i)}))}resetPassword(e,t){return wi(this,void 0,void 0,(function*(){yield this.resetPasswordRaw(e,t)}))}signupUserRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.signupUserRequest)throw new he("signupUserRequest",'Required parameter "signupUserRequest" was null or undefined when calling signupUser().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup",method:"POST",headers:n,query:{},body:(r=e.signupUserRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,inviteCode:o.inviteCode,name:o.name,returnTo:o.returnTo})},t);var o,r;return new we(i)}))}signupUser(e,t){return wi(this,void 0,void 0,(function*(){yield this.signupUserRaw(e,t)}))}signupWithInvitationRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.signupWithInvitationRequest)throw new he("signupWithInvitationRequest",'Required parameter "signupWithInvitationRequest" was null or undefined when calling signupWithInvitation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup-with-invitation",method:"POST",headers:n,query:{},body:(r=e.signupWithInvitationRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,invitationId:o.invitationId,organizationId:o.organizationId})},t);var o,r;return new we(i)}))}signupWithInvitation(e,t){return wi(this,void 0,void 0,(function*(){yield this.signupWithInvitationRaw(e,t)}))}updateEmailRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new he("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling updateEmail().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-email",method:"POST",headers:n,query:{},body:Vn(e.updateEmailRequest)},t);return new we(i)}))}updateEmail(e,t){return wi(this,void 0,void 0,(function*(){yield this.updateEmailRaw(e,t)}))}updateNameRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.updateNameRequest)throw new he("updateNameRequest",'Required parameter "updateNameRequest" was null or undefined when calling updateName().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/update-name",method:"POST",headers:n,query:{},body:(r=e.updateNameRequest,o=r,null==o?o:{token:o.token,name:o.name})},t);var o,r;return new we(i)}))}updateName(e,t){return wi(this,void 0,void 0,(function*(){yield this.updateNameRaw(e,t)}))}updatePasswordRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.updatePasswordRequest)throw new he("updatePasswordRequest",'Required parameter "updatePasswordRequest" was null or undefined when calling updatePassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-password",method:"POST",headers:n,query:{},body:(r=e.updatePasswordRequest,o=r,null==o?o:{token:o.token,email:o.email,password:o.password})},t);var o,r;return new we(i)}))}updatePassword(e,t){return wi(this,void 0,void 0,(function*(){yield this.updatePasswordRaw(e,t)}))}updateUserMetadataRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.updateUserMetadataRequest)throw new he("updateUserMetadataRequest",'Required parameter "updateUserMetadataRequest" was null or undefined when calling updateUserMetadata().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/update-metadata",method:"POST",headers:n,query:{},body:(r=e.updateUserMetadataRequest,o=r,null==o?o:{metadata:o.metadata})},t);var o,r;return new we(i)}))}updateUserMetadata(e,t){return wi(this,void 0,void 0,(function*(){yield this.updateUserMetadataRaw(e,t)}))}validateInviteCodeRaw(e,t){return wi(this,void 0,void 0,(function*(){if(null==e.code)throw new he("code",'Required parameter "code" was null or undefined when calling validateInviteCode().');const n={};null!=e.code&&(n.code=e.code);const i=yield this.request({path:"/auth/invite-code",method:"GET",headers:{},query:n},t);return new ve(i,(e=>Qn(e)))}))}validateInviteCode(e,t){return wi(this,void 0,void 0,(function*(){const n=yield this.validateInviteCodeRaw(e,t);return yield n.value()}))}}var Ii="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ri extends le{addAiAnswersKnowledgeDocumentRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeDocument().');if(null==e.addAiAnswersKnowledgeDocumentRequest)throw new he("addAiAnswersKnowledgeDocumentRequest",'Required parameter "addAiAnswersKnowledgeDocumentRequest" was null or undefined when calling addAiAnswersKnowledgeDocument().');const n={"Content-Type":"application/json"};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addAiAnswersKnowledgeDocumentRequest,o=r,null==o?o:{title:o.title,text:o.text})},t);var o,r;return new ve(i,(e=>Ue(e)))}))}addAiAnswersKnowledgeDocument(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}checkCompositionAccessRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling checkCompositionAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Ne(e)))}))}checkCompositionAccess(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.checkCompositionAccessRaw(e,t);return yield n.value()}))}createCompositionContentItemRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling createCompositionContentItem().');if(null==e.list)throw new he("list",'Required parameter "list" was null or undefined when calling createCompositionContentItem().');if(null==e.createCompositionContentItemRequest)throw new he("createCompositionContentItemRequest",'Required parameter "createCompositionContentItemRequest" was null or undefined when calling createCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))),method:"POST",headers:n,query:{},body:gt(e.createCompositionContentItemRequest)},t);return new ve(i,(e=>ht(e)))}))}createCompositionContentItem(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.createCompositionContentItemRaw(e,t);return yield n.value()}))}createCompositionDatabaseRecordRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.body)throw new he("body",'Required parameter "body" was null or undefined when calling createCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"POST",headers:n,query:{},body:e.body},t);return new ve(i,(e=>ft(e)))}))}createCompositionDatabaseRecord(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.createCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}createCompositionRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.newComposition)throw new he("newComposition",'Required parameter "newComposition" was null or undefined when calling createComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions",method:"POST",headers:n,query:{},body:(r=e.newComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,creatorId:o.creatorId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new ve(i,(e=>pt(e)))}))}createComposition(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.createCompositionRaw(e,t);return yield n.value()}))}deleteCompositionContentItemRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteCompositionContentItem().');if(null==e.list)throw new he("list",'Required parameter "list" was null or undefined when calling deleteCompositionContentItem().');if(null==e.itemId)throw new he("itemId",'Required parameter "itemId" was null or undefined when calling deleteCompositionContentItem().');const n={};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>At(e)))}))}deleteCompositionContentItem(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionContentItemRaw(e,t);return yield n.value()}))}deleteCompositionDataSourceRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteCompositionDataSource().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>function(e){return null==e?e:{removed:e.removed}}(e)))}))}deleteCompositionDataSource(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDataSourceRaw(e,t);return yield n.value()}))}deleteCompositionDatabaseRecordRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.recordId)throw new he("recordId",'Required parameter "recordId" was null or undefined when calling deleteCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>ft(e)))}))}deleteCompositionDatabaseRecord(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteComposition().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new we(i)}))}deleteComposition(e,t){return Ii(this,void 0,void 0,(function*(){yield this.deleteCompositionRaw(e,t)}))}describeCompositionEntriesRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling describeCompositionEntries().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/entries".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Qe(e)))}))}describeCompositionEntries(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.describeCompositionEntriesRaw(e,t);return yield n.value()}))}duplicateCompositionRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling duplicateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateCompositionRequest,o=r,null==o?o:{name:o.name,includeDatabase:o.includeDatabase})},t);var o,r;return new ve(i,(e=>Ct(e)))}))}duplicateComposition(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.duplicateCompositionRaw(e,t);return yield n.value()}))}getAiAnswersKnowledgeRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getAiAnswersKnowledge().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Bt(e)))}))}getAiAnswersKnowledge(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getAiAnswersKnowledgeRaw(e,t);return yield n.value()}))}getAllCompositionsRaw(e,t){return Ii(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.sort&&(n.sort=e.sort),null!=e.widgetId&&(n.widgetId=e.widgetId),null!=e.workspace&&(n.workspace=e.workspace),null!=e.projectFolder&&(n.projectFolder=e.projectFolder),null!=e.status&&(n.status=e.status),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions",method:"GET",headers:i,query:n},t);return new ve(o,(e=>Pt(e)))}))}getAllCompositions(){return Ii(this,arguments,void 0,(function*(e={},t){const n=yield this.getAllCompositionsRaw(e,t);return yield n.value()}))}getCompositionByIdRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionById().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Lt(e)))}))}getCompositionById(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionByIdRaw(e,t);return yield n.value()}))}getCompositionContentSchemaRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionContentSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>jt(e)))}))}getCompositionContentSchema(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentSchemaRaw(e,t);return yield n.value()}))}getCompositionContentRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionContent().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i)}))}getCompositionContent(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentRaw(e,t);return yield n.value()}))}getCompositionDataSourceRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDataSource().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Ye(e)))}))}getCompositionDataSource(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionDataSourceRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.recordId)throw new he("recordId",'Required parameter "recordId" was null or undefined when calling getCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>ft(e)))}))}getCompositionDatabaseRecord(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordsRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecords().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecords().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>$t(e)))}))}getCompositionDatabaseRecords(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordsRaw(e,t);return yield n.value()}))}getCompositionDesignSchemaRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDesignSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Nt(e)))}))}getCompositionDesignSchema(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignSchemaRaw(e,t);return yield n.value()}))}getCompositionDesignRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDesign().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i)}))}getCompositionDesign(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignRaw(e,t);return yield n.value()}))}getCompositionEmbedSchemaRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/embed".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Vt(e)))}))}getCompositionEmbedSchema(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSettingsRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSettings().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/embed-settings".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i)}))}getCompositionEmbedSettings(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}getCompositionPreviewRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionPreview().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/preview".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Xt(e)))}))}getCompositionPreview(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionPreviewRaw(e,t);return yield n.value()}))}getCompositionVersionsRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionVersions().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/versions".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Ft(e)))}))}getCompositionVersions(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionVersionsRaw(e,t);return yield n.value()}))}getCompositionsBatchRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.getCompositionsBatchRequest)throw new he("getCompositionsBatchRequest",'Required parameter "getCompositionsBatchRequest" was null or undefined when calling getCompositionsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/batch",method:"POST",headers:n,query:{},body:(r=e.getCompositionsBatchRequest,o=r,null==o?o:{compositionIds:o.compositionIds})},t);var o,r;return new ve(i,(e=>Yt(e)))}))}getCompositionsBatch(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.getCompositionsBatchRaw(e,t);return yield n.value()}))}patchCompositionContentItemRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling patchCompositionContentItem().');if(null==e.list)throw new he("list",'Required parameter "list" was null or undefined when calling patchCompositionContentItem().');if(null==e.itemId)throw new he("itemId",'Required parameter "itemId" was null or undefined when calling patchCompositionContentItem().');if(null==e.requestBody)throw new he("requestBody",'Required parameter "requestBody" was null or undefined when calling patchCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"PATCH",headers:n,query:{},body:e.requestBody},t);return new ve(i,(e=>ht(e)))}))}patchCompositionContentItem(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.patchCompositionContentItemRaw(e,t);return yield n.value()}))}readCompositionEntriesRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling readCompositionEntries().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling readCompositionEntries().');const n={};null!=e.groupBy&&(n.groupBy=e.groupBy),null!=e.rows&&(n.rows=e.rows),null!=e.aggregate&&(n.aggregate=e.aggregate),null!=e.column&&(n.column=e.column),null!=e.since&&(n.since=e.since.toISOString()),null!=e.until&&(n.until=e.until.toISOString()),null!=e.context&&(n.context=e.context),null!=e.filter&&(n.filter=e.filter);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/entries/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>it(e)))}))}readCompositionEntries(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.readCompositionEntriesRaw(e,t);return yield n.value()}))}removeAiAnswersKnowledgeDocumentRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling removeAiAnswersKnowledgeDocument().');if(null==e.documentId)throw new he("documentId",'Required parameter "documentId" was null or undefined when calling removeAiAnswersKnowledgeDocument().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents/{documentId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{documentId}",encodeURIComponent(String(e.documentId))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>An(e)))}))}removeAiAnswersKnowledgeDocument(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.removeAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}setCompositionDataSourceRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling setCompositionDataSource().');if(null==e.setCompositionDataSourceRequest)throw new he("setCompositionDataSourceRequest",'Required parameter "setCompositionDataSourceRequest" was null or undefined when calling setCompositionDataSource().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setCompositionDataSourceRequest,o=r,null==o?o:{url:o.url,refreshSeconds:o.refreshSeconds})},t);var o,r;return new ve(i,(e=>Ye(e)))}))}setCompositionDataSource(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.setCompositionDataSourceRaw(e,t);return yield n.value()}))}setDynamicContentRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling setDynamicContent().');if(null==e.setDynamicContentRequest)throw new he("setDynamicContentRequest",'Required parameter "setDynamicContentRequest" was null or undefined when calling setDynamicContent().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setDynamicContentRequest,o=r,null==o?o:{content:o.content,validate:o.validate,partial:o.partial,version:o.version,source:o.source})},t);var o,r;return new ve(i,(e=>En(e)))}))}setDynamicContent(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.setDynamicContentRaw(e,t);return yield n.value()}))}updateCompositionDatabaseRecordRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.recordId)throw new he("recordId",'Required parameter "recordId" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.body)throw new he("body",'Required parameter "body" was null or undefined when calling updateCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"PUT",headers:n,query:{},body:e.body},t);return new ve(i,(e=>ft(e)))}))}updateCompositionDatabaseRecord(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.updateCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}updateCompositionStatusRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateCompositionStatus().');if(null==e.updateCompositionStatusRequest)throw new he("updateCompositionStatusRequest",'Required parameter "updateCompositionStatusRequest" was null or undefined when calling updateCompositionStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateCompositionStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new ve(i,(e=>He(e)))}))}updateCompositionStatus(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.updateCompositionStatusRaw(e,t);return yield n.value()}))}updateCompositionRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateComposition().');if(null==e.updateComposition)throw new he("updateComposition",'Required parameter "updateComposition" was null or undefined when calling updateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId})},t);var o,r;return new ve(i,(e=>Lt(e)))}))}updateComposition(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.updateCompositionRaw(e,t);return yield n.value()}))}validateCompositionContentRaw(e,t){return Ii(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling validateCompositionContent().');if(null==e.requestBody)throw new he("requestBody",'Required parameter "requestBody" was null or undefined when calling validateCompositionContent().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/validate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:e.requestBody},t);return new ve(i,(e=>Zn(e)))}))}validateCompositionContent(e,t){return Ii(this,void 0,void 0,(function*(){const n=yield this.validateCompositionContentRaw(e,t);return yield n.value()}))}}var Ti="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ai extends le{exchangeTokenRaw(e,t){return Ti(this,void 0,void 0,(function*(){if(null==e.exchangeTokenRequest)throw new he("exchangeTokenRequest",'Required parameter "exchangeTokenRequest" was null or undefined when calling exchangeToken().');const n={"Content-Type":"application/json"};this.configuration&&this.configuration.apiKey&&(n.Authorization=yield this.configuration.apiKey("Authorization"));const i=yield this.request({path:"/tokens/exchange",method:"POST",headers:n,query:{},body:(r=e.exchangeTokenRequest,o=r,null==o?o:{scopes:o.scopes,expiresIn:o.expiresIn})},t);var o,r;return new ve(i,(e=>_t(e)))}))}exchangeToken(e,t){return Ti(this,void 0,void 0,(function*(){const n=yield this.exchangeTokenRaw(e,t);return yield n.value()}))}validateTokenRaw(e){return Ti(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.apiKey&&(t.Authorization=yield this.configuration.apiKey("Authorization")),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("BearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/tokens/validate",method:"GET",headers:t,query:{}},e);return new ve(n,(e=>ti(e)))}))}validateToken(e){return Ti(this,void 0,void 0,(function*(){const t=yield this.validateTokenRaw(e);return yield t.value()}))}}var ki="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class qi extends le{addLanguagesToTranslationRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling addLanguagesToTranslation().');if(null==e.addLanguagesToTranslationRequest)throw new he("addLanguagesToTranslationRequest",'Required parameter "addLanguagesToTranslationRequest" was null or undefined when calling addLanguagesToTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addLanguagesToTranslationRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new ve(i,(e=>xe(e)))}))}addLanguagesToTranslation(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.addLanguagesToTranslationRaw(e,t);return yield n.value()}))}createTranslationRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.createTranslationRequest)throw new he("createTranslationRequest",'Required parameter "createTranslationRequest" was null or undefined when calling createTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations",method:"POST",headers:n,query:{},body:(r=e.createTranslationRequest,o=r,null==o?o:{name:o.name,description:o.description,root_composition_id:o.root_composition_id,root_language:o.root_language,selected_languages:o.selected_languages})},t);var o,r;return new ve(i,(e=>wt(e)))}))}createTranslation(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.createTranslationRaw(e,t);return yield n.value()}))}deleteTranslationRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>kt(e)))}))}deleteTranslation(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.deleteTranslationRaw(e,t);return yield n.value()}))}getLanguagePresetsRaw(e){return ki(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/language-presets",method:"GET",headers:{},query:{}},e);return new ve(t,(e=>Jt(e)))}))}getLanguagePresets(e){return ki(this,void 0,void 0,(function*(){const t=yield this.getLanguagePresetsRaw(e);return yield t.value()}))}getSupportedLanguagesRaw(e){return ki(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/supported-languages",method:"GET",headers:{},query:{}},e);return new ve(t,(e=>tn(e)))}))}getSupportedLanguages(e){return ki(this,void 0,void 0,(function*(){const t=yield this.getSupportedLanguagesRaw(e);return yield t.value()}))}getTranslationRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>nn(e)))}))}getTranslation(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getTranslationRaw(e,t);return yield n.value()}))}getTranslationAnalyticsRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getTranslationAnalytics().');const n={};null!=e.period&&(n.period=e.period);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations/{id}/analytics".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new ve(o,(e=>sn(e)))}))}getTranslationAnalytics(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getTranslationAnalyticsRaw(e,t);return yield n.value()}))}getTranslationConfigRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getTranslationConfig().');const n=yield this.request({path:"/translations/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new ve(n,(e=>un(e)))}))}getTranslationConfig(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.getTranslationConfigRaw(e,t);return yield n.value()}))}getTranslationsRaw(e,t){return ki(this,void 0,void 0,(function*(){const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations",method:"GET",headers:i,query:n},t);return new ve(o,(e=>ln(e)))}))}getTranslations(){return ki(this,arguments,void 0,(function*(e={},t){const n=yield this.getTranslationsRaw(e,t);return yield n.value()}))}removeLanguageFromTranslationRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling removeLanguageFromTranslation().');if(null==e.languageCode)throw new he("languageCode",'Required parameter "languageCode" was null or undefined when calling removeLanguageFromTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages/{languageCode}".replace("{id}",encodeURIComponent(String(e.id))).replace("{languageCode}",encodeURIComponent(String(e.languageCode))),method:"DELETE",headers:n,query:{}},t);return new ve(i,(e=>xe(e)))}))}removeLanguageFromTranslation(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.removeLanguageFromTranslationRaw(e,t);return yield n.value()}))}retranslateExperimentRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling retranslateExperiment().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/retranslate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.retranslateExperimentRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new ve(i,(e=>kt(e)))}))}retranslateExperiment(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.retranslateExperimentRaw(e,t);return yield n.value()}))}submitTranslationAnalyticsEventRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling submitTranslationAnalyticsEvent().');if(null==e.submitTranslationAnalyticsEventRequest)throw new he("submitTranslationAnalyticsEventRequest",'Required parameter "submitTranslationAnalyticsEventRequest" was null or undefined when calling submitTranslationAnalyticsEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/translations/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.submitTranslationAnalyticsEventRequest,o=r,null==o?o:{eventType:o.eventType,language:o.language,compositionId:o.compositionId,metadata:o.metadata})},t);var o,r;return new we(i)}))}submitTranslationAnalyticsEvent(e,t){return ki(this,void 0,void 0,(function*(){yield this.submitTranslationAnalyticsEventRaw(e,t)}))}updateTranslationStatusRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateTranslationStatus().');if(null==e.updateTranslationStatusRequest)throw new he("updateTranslationStatusRequest",'Required parameter "updateTranslationStatusRequest" was null or undefined when calling updateTranslationStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateTranslationStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new ve(i,(e=>xe(e)))}))}updateTranslationStatus(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.updateTranslationStatusRaw(e,t);return yield n.value()}))}}var Si="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ci extends le{checkWidgetAccessRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling checkWidgetAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>Ve(e)))}))}checkWidgetAccess(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.checkWidgetAccessRaw(e,t);return yield n.value()}))}createCompositionFromWidgetRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling createCompositionFromWidget().');if(null==e.createCompositionFromWidgetRequest)throw new he("createCompositionFromWidgetRequest",'Required parameter "createCompositionFromWidgetRequest" was null or undefined when calling createCompositionFromWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/composition".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.createCompositionFromWidgetRequest,o=r,null==o?o:{name:o.name,content:o.content,design:o.design,embedSettings:o.embedSettings,locale:o.locale,managedUserId:o.managedUserId})},t);var o,r;return new ve(i,(e=>vt(e)))}))}createCompositionFromWidget(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.createCompositionFromWidgetRaw(e,t);return yield n.value()}))}createWidgetRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.newWidget)throw new he("newWidget",'Required parameter "newWidget" was null or undefined when calling createWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets",method:"POST",headers:n,query:{},body:(r=e.newWidget,o=r,null==o?o:{name:o.name,type:o.type,content:o.content,isPublic:o.isPublic,isDraft:o.isDraft,canvasId:o.canvasId,projectId:o.projectId,organizationId:o.organizationId,workspaceType:o.workspaceType,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new ve(i,(e=>It(e)))}))}createWidget(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.createWidgetRaw(e,t);return yield n.value()}))}deleteWidgetRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{},body:(r=e.deleteWidgetRequest,o=r,null==o?o:{reason:o.reason})},t);var o,r;return new we(i)}))}deleteWidget(e,t){return Si(this,void 0,void 0,(function*(){yield this.deleteWidgetRaw(e,t)}))}detachWidgetRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling detachWidget().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/detach".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{}},t);return new we(i)}))}detachWidget(e,t){return Si(this,void 0,void 0,(function*(){yield this.detachWidgetRaw(e,t)}))}duplicateWidgetRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling duplicateWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateWidgetRequest,o=r,null==o?o:{name:o.name,canvas_id:o.canvas_id,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new ve(i,(e=>Ut(e)))}))}duplicateWidget(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.duplicateWidgetRaw(e,t);return yield n.value()}))}getWidgetContentSchemaRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getWidgetContentSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i)}))}getWidgetContentSchema(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.getWidgetContentSchemaRaw(e,t);return yield n.value()}))}getWidgetDesignSchemaRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getWidgetDesignSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new ve(i)}))}getWidgetDesignSchema(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.getWidgetDesignSchemaRaw(e,t);return yield n.value()}))}getWidgetPublishHistoryRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new he("widgetId",'Required parameter "widgetId" was null or undefined when calling getWidgetPublishHistory().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history".replace("{widgetId}",encodeURIComponent(String(e.widgetId))),method:"GET",headers:n,query:{}},t);return new ve(i,(e=>hn(e)))}))}getWidgetPublishHistory(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.getWidgetPublishHistoryRaw(e,t);return yield n.value()}))}getWidgetsBatchRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.getWidgetsBatchRequest)throw new he("getWidgetsBatchRequest",'Required parameter "getWidgetsBatchRequest" was null or undefined when calling getWidgetsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/batch",method:"POST",headers:n,query:{},body:(r=e.getWidgetsBatchRequest,o=r,null==o?o:{widgetIds:o.widgetIds})},t);var o,r;return new ve(i,(e=>mn(e)))}))}getWidgetsBatch(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.getWidgetsBatchRaw(e,t);return yield n.value()}))}getWidgetsRaw(e,t){return Si(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.canvasId&&(n.canvasId=e.canvasId),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/widgets",method:"GET",headers:i,query:n},t);return new ve(o,(e=>fn(e)))}))}getWidgets(){return Si(this,arguments,void 0,(function*(e={},t){const n=yield this.getWidgetsRaw(e,t);return yield n.value()}))}renameWidgetPublishHistoryTitleRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new he("widgetId",'Required parameter "widgetId" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.version)throw new he("version",'Required parameter "version" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.renameWidgetPublishHistoryTitleRequest)throw new he("renameWidgetPublishHistoryTitleRequest",'Required parameter "renameWidgetPublishHistoryTitleRequest" was null or undefined when calling renameWidgetPublishHistoryTitle().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/title".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"PATCH",headers:n,query:{},body:(r=e.renameWidgetPublishHistoryTitleRequest,o=r,null==o?o:{commitTitle:o.commitTitle})},t);var o,r;return new ve(i,(e=>qn(e)))}))}renameWidgetPublishHistoryTitle(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.renameWidgetPublishHistoryTitleRaw(e,t);return yield n.value()}))}setWidgetPublishHistoryLiveRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new he("widgetId",'Required parameter "widgetId" was null or undefined when calling setWidgetPublishHistoryLive().');if(null==e.version)throw new he("version",'Required parameter "version" was null or undefined when calling setWidgetPublishHistoryLive().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/set-live".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"POST",headers:n,query:{}},t);return new ve(i,(e=>_n(e)))}))}setWidgetPublishHistoryLive(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.setWidgetPublishHistoryLiveRaw(e,t);return yield n.value()}))}updateWidgetRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateWidget().');if(null==e.updateWidgetRequest)throw new he("updateWidgetRequest",'Required parameter "updateWidgetRequest" was null or undefined when calling updateWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:n,query:{},body:(r=e.updateWidgetRequest,o=r,null==o?o:{name:o.name,description:o.description,canvasId:o.canvasId,projectId:o.projectId,projectFolder:o.projectFolder})},t);var o,r;return new we(i)}))}updateWidget(e,t){return Si(this,void 0,void 0,(function*(){yield this.updateWidgetRaw(e,t)}))}updateWidgetRepositoryRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateWidgetRepository().');if(null==e.updateWidgetRepositoryRequest)throw new he("updateWidgetRepositoryRequest",'Required parameter "updateWidgetRepositoryRequest" was null or undefined when calling updateWidgetRepository().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/repository".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateWidgetRepositoryRequest,o=r,null==o?o:{repositoryId:o.repositoryId})},t);var o,r;return new ve(i,(e=>Fn(e)))}))}updateWidgetRepository(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.updateWidgetRepositoryRaw(e,t);return yield n.value()}))}uploadWidgetThumbnailRaw(e,t){return Si(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling uploadWidgetThumbnail().');if(null==e.uploadWidgetThumbnailRequest)throw new he("uploadWidgetThumbnailRequest",'Required parameter "uploadWidgetThumbnailRequest" was null or undefined when calling uploadWidgetThumbnail().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/thumbnail".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.uploadWidgetThumbnailRequest,o=r,null==o?o:{imageDataUrl:o.imageDataUrl})},t);var o,r;return new ve(i,(e=>Yn(e)))}))}uploadWidgetThumbnail(e,t){return Si(this,void 0,void 0,(function*(){const n=yield this.uploadWidgetThumbnailRaw(e,t);return yield n.value()}))}}class Ei extends Error{constructor(e,t,n){super(e),this.code=t,this.statusCode=n,this.name="AuthError"}}class Ui{constructor(e={}){var t,n;this.currentToken=null,this.apiKey=null,this.refreshTimer=null,this.config=Object.assign({apiUrl:e.apiUrl||K(),debug:e.debug||!1},e),this.apiKey=e.apiKey||"undefined"!=typeof process&&((null===(t={NODE_ENV:"production"})||void 0===t?void 0:t.PUBLIC_API_KEY)||(null===(n={NODE_ENV:"production"})||void 0===n?void 0:n.API_KEY))||null}createTokensApiForApiKey(t){const n=new de({basePath:this.config.apiUrl,apiKey:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${P}`}});return new Ai(n)}createTokensApiForAccessToken(t){const n=new de({basePath:this.config.apiUrl,accessToken:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${P}`}});return new Ai(n)}setApiKey(e){this.apiKey=e,this.currentToken={token:e,tokenType:"API-Key",expiresAt:null,scopes:[]},this.config.debug&&ee.debug("AuthManager: API key set")}getValidToken(t){return e(this,void 0,void 0,(function*(){if(this.currentToken&&this.isTokenValid(this.currentToken)){if(Ui.validatedTokens.has(this.currentToken.token))return this.currentToken.token;if(yield this.validateToken())return this.currentToken.token}if(this.apiKey)return yield this.exchangeApiKeyForJWT(t),this.currentToken.token;throw new Ei("No authentication method available","NO_AUTH_METHOD")}))}exchangeApiKeyForJWT(t){return e(this,void 0,void 0,(function*(){var e;if(!this.apiKey)throw new Ei("No API key available for exchange","NO_API_KEY");const n={scopes:(null==t?void 0:t.scopes)||this.getDefaultScopes(),expiresIn:(null==t?void 0:t.expiresIn)||1800};try{const t=this.createTokensApiForApiKey(this.apiKey),i=yield t.exchangeToken({exchangeTokenRequest:n}),o=(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.token)||(null==i?void 0:i.token);if(!o)throw new Ei("Token exchange response missing token","INVALID_RESPONSE");const r=(null==i?void 0:i.data)||i,a={token:o,tokenType:r.tokenType||"Bearer",expiresAt:r.expiresAt?r.expiresAt instanceof Date?r.expiresAt.toISOString():String(r.expiresAt):null,scopes:r.scopes||[]};return this.setToken(a),this.config.debug&&ee.info("AuthManager: Token exchanged successfully",{scopes:a.scopes,expiresAt:a.expiresAt}),a}catch(e){const t=e instanceof Ei?e:new Ei(`Token exchange failed: ${e instanceof Error?e.message:String(e)}`,"TOKEN_EXCHANGE_ERROR");throw this.config.onAuthError&&this.config.onAuthError(t),t}}))}validateToken(){return e(this,void 0,void 0,(function*(){var e;if(!this.currentToken)return!1;if(Ui.validatedTokens.has(this.currentToken.token))return!0;try{const t=this.createTokensApiForAccessToken(this.currentToken.token),n=yield t.validateToken();return!0===(null==n?void 0:n.success)&&!0===(null===(e=n.data)||void 0===e?void 0:e.valid)||!0===(null==n?void 0:n.valid)?(Ui.validatedTokens.add(this.currentToken.token),!0):(this.clearToken(),!1)}catch(e){return this.config.debug&&ee.warn("AuthManager: Token validation failed",e),!1}}))}setToken(e){this.currentToken=e,e.expiresAt&&this.scheduleTokenRefresh(e),this.config.onTokenRefreshed&&this.config.onTokenRefreshed(e.token)}clearToken(){this.currentToken&&Ui.validatedTokens.delete(this.currentToken.token),this.currentToken=null,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}isTokenValid(e){if(!e.expiresAt)return!0;const t=new Date(e.expiresAt).getTime();return Date.now()<t-6e4}scheduleTokenRefresh(t){if(!t.expiresAt||!this.apiKey)return;const n=new Date(t.expiresAt).getTime()-Date.now()-3e5;n>0&&(this.refreshTimer=setTimeout((()=>e(this,void 0,void 0,(function*(){try{yield this.exchangeApiKeyForJWT({scopes:t.scopes}),this.config.debug&&ee.info("AuthManager: Token refreshed automatically")}catch(e){this.config.debug&&ee.error("AuthManager: Automatic token refresh failed",e),this.config.onTokenExpired&&this.config.onTokenExpired()}}))),n))}getDefaultScopes(){return["compositions:read","widgets:read","projects:read"]}getCurrentTokenInfo(){return this.currentToken}hasAuthMethod(){return!(!this.apiKey&&!this.currentToken)}dispose(){this.clearToken(),this.apiKey=null,this.config.debug&&ee.debug("AuthManager: Disposed")}}Ui.validatedTokens=new Set;const bi=M,_i={};let xi=null,Di=null;const Bi={API_URL:W.PROD_API_URL,API_VERSION:W.VERSION,CLIENT_URL:W.PROD_CLIENT_URL,PRODUCTION_URL:W.PROD_CDN_URL,NODE_ENV:"production",ENABLE_EDITING:W.ENABLE_EDITING,API_KEY:_i.PUBLIC_API_KEY,AXIOM_API_KEY:_i.PUBLIC_AXIOM_API_KEY,STATSIG_KEY:_i.PUBLIC_STATSIG_KEY};function Mi(e){xi=e}function Pi(){return xi}function Ki(){return Di||(Di=new Ui({apiUrl:Gi(),debug:Fi.enabled})),Di}function Wi(e){Ki().setApiKey(e)}function Oi(){return e(this,void 0,void 0,(function*(){if(Di&&Di.hasAuthMethod())try{return yield Di.getValidToken()}catch(e){}if(xi)return yield xi.getToken();const e=Bi.API_KEY;if(!e)throw new Error("No authentication method available. Please configure an API key, TokenProvider, or set PUBLIC_API_KEY in environment variables.");return e}))}function zi(e){const t=(null==e?void 0:e.tokenProvider)||xi;if(!t){const t=(null==e?void 0:e.apiKey)||Bi.API_KEY;return{apiKey:t,basePath:(null==e?void 0:e.basePath)||Gi(),tokenProvider:t?new oe(t):void 0}}return{basePath:(null==e?void 0:e.basePath)||Gi(),tokenProvider:t}}function Gi(){return Bi.API_URL}function Li(){return Bi.PRODUCTION_URL}function ji(){return`${Gi()}${Bi.API_VERSION}`}const $i={isProduction:"production"===Bi.NODE_ENV,apiUrl:Gi(),apiKey:Bi.API_KEY},Ni={renderMode:O,displayMode:z,resize:G,width:L,height:j,autoscale:$},Vi={customElements:N.CUSTOM_ELEMENTS,http3:N.HTTP3,resizeObserver:N.RESIZE_OBSERVER},Xi={batchSize:V,loadTimeout:X,retryAttempts:F},Fi={enabled:D,logLevel:B},Hi={AXIOM_API_KEY:Bi.AXIOM_API_KEY||"",AXIOM_DATASET:n,AXIOM_API_ENDPOINT:t,STATSIG_API_KEY:Bi.STATSIG_KEY||"",STATSIG_API_ENDPOINT:i,ENABLE_PERFORMANCE_TRACKING:o,PERFORMANCE_SAMPLE_RATE:r,PERFORMANCE_REPORTING_ENDPOINT:s,LCP_THRESHOLD:d,LCP_WARNING_THRESHOLD:u,FID_THRESHOLD:l,FID_WARNING_THRESHOLD:c,CLS_THRESHOLD:p,CLS_WARNING_THRESHOLD:h,FCP_THRESHOLD:g,FCP_WARNING_THRESHOLD:f,TTFB_THRESHOLD:m,TTFB_WARNING_THRESHOLD:v,WIDGET_LOAD_THRESHOLD:w,WIDGET_LOAD_WARNING_THRESHOLD:y,BUNDLE_SIZE_THRESHOLD:I,BUNDLE_SIZE_WARNING_THRESHOLD:R,MAX_METRICS_BUFFER:a},Yi={ROOT_MARGIN:T,THRESHOLD:A,MAX_CONCURRENT:k,RETRY_ATTEMPTS:q,RETRY_DELAY:S},Zi={MAX_PRELOAD_REQUESTS:C,PREFETCH_TIMEOUT:E,CACHE_DURATION:U,MAX_CONCURRENT_REQUESTS:b,DNS_PREFETCH_ENABLED:_,PRECONNECT_ENABLED:x},Ji={DEBUG:D,LOG_LEVEL:B,VERSION:M};function Qi(){return zi()}var eo=Object.freeze({__proto__:null,BROWSER_FEATURES:Vi,DEBUG:Fi,DEFAULT_WIDGET_CONFIG:Ni,LAZY_LOADING_CONFIG:Yi,PERFORMANCE:Xi,PERFORMANCE_CONFIG:Hi,RESOURCE_CONFIG:Zi,SDK_CONFIG:Ji,VERSION:bi,config:Bi,createSdkConfig:zi,environment:$i,getApiUrl:Gi,getAuthManager:Ki,getAuthToken:Oi,getCdnUrl:Li,getConfiguration:Qi,getTokenProvider:Pi,getVersionedApiUrl:ji,setApiKey:Wi,setTokenProvider:Mi});export{Ui as A,de as C,Ni as D,ne as E,ie as F,Hi as P,te as S,qi as T,bi as V,Ci as W,ji as a,Ri as b,Li as c,Bi as d,Q as e,Fi as f,Oi as g,Qi as h,Wi as i,oe as j,Pi as k,ee as l,Gi as m,W as n,yi as o,zi as p,vi as q,Ei as r,Mi as s,Ki as t,fi as u,eo as v};
|
|
1
|
+
import{_ as e}from"./vendor.js";const t="https://api.axiom.co/v1",n="widgetic-performance",i="https://events.statsigapi.net/v1/custom",o=!0,r=1,a=1e3,s="",d=2500,u=2e3,l=100,c=50,p=.1,h=.05,g=1800,f=1200,v=800,m=600,w=3e3,y=2e3,I=5e5,R=3e5,T="50px",k=.1,A=3,q=3,S=1e3,C=10,E=5e3,U=36e5,b=6,_=!0,x=!0,D=!1,B="info",M="2.0.3",P="2.0.3";function K(){var e;return`${"undefined"!=typeof process&&"development"===(null===(e={NODE_ENV:"production"})||void 0===e?void 0:e.NODE_ENV)?W.DEV_API_URL:W.PROD_API_URL}${W.VERSION}`}const W={DEV_API_URL:"http://localhost:3000",PROD_API_URL:"https://api.widgetic.com",PROD_CLIENT_URL:"https://widgetic.com",PROD_CDN_URL:"https://cdn.widgetic.com",VERSION:"/api/v1",ENABLE_EDITING:!0},O="auto",z="inline",G="fixed",L=350,$=200,j=!1,N={CUSTOM_ELEMENTS:"undefined"!=typeof customElements,HTTP3:!1,RESIZE_OBSERVER:"undefined"!=typeof ResizeObserver},V=10,X=5e3,F=3;let H=D;const Y={get enabled(){return H},logLevel:B},Z=["apikey","api_key","api-key","servicekey","service_key","service-key","token","access_token","auth_token","secret","password","private_key","authorization","bearer","internal_key","public_api_key","public_internal_key"];function J(e){if("string"==typeof e){const t=e.toLowerCase();for(const n of Z)if(t.includes(n))return e.replace(/([a-zA-Z_-]*(?:key|token|secret|password)[a-zA-Z_-]*[:\s=]+)([^\s,}]+)/gi,"$1[REDACTED]");return e}if(null==e)return e;if(Array.isArray(e))return e.map(J);if("object"==typeof e){const t={};for(const[n,i]of Object.entries(e)){const e=n.toLowerCase();Z.some((t=>e.includes(t.toLowerCase())||e===t.toLowerCase()))&&"string"==typeof i&&i.length>0?t[n]=`[REDACTED_${i.length}_CHARS]`:t[n]=J(i)}return t}return e}const Q=new class{constructor(e=Y.logLevel){this.logLevels={debug:0,info:1,warn:2,error:3},this.currentLevel=this.logLevels[e]}shouldLog(e){return Y.enabled&&this.logLevels[e]>=this.currentLevel}formatMessage(e,t,...n){const i=(new Date).toISOString();return[`${`[Widgetic SDK] [${e.toUpperCase()}] [${i}]`} ${t}`,...n.map(J)]}debug(e,...t){this.shouldLog("debug")}info(e,...t){this.shouldLog("info")}warn(e,...t){this.shouldLog("warn")}error(e,...t){this.shouldLog("error")}setLevel(e){this.currentLevel=this.logLevels[e]}setDebug(e){!function(e){H=e}(e)}},ee={debug:(e,...t)=>Q.debug(e,...t),info:(e,...t)=>Q.info(e,...t),warn:(e,...t)=>Q.warn(e,...t),error:(e,...t)=>Q.error(e,...t),setLevel:e=>Q.setLevel(e)};class te{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}class ne{constructor(e){this.tokenEndpoint=e.tokenEndpoint||e.endpoint||"",this.refreshEndpoint=e.refreshEndpoint,this.headers=e.headers||{},e.apiKey&&!this.headers.Authorization&&(this.headers.Authorization=`Bearer ${e.apiKey}`)}getToken(){return e(this,void 0,void 0,(function*(){if(this.cachedToken&&(yield this.isTokenValid()))return this.cachedToken;const e=yield fetch(this.tokenEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json"},this.headers)});if(!e.ok)throw new Error(`Failed to fetch token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in?this.tokenExpiry=Date.now()+1e3*t.expires_in:t.expires_at&&(this.tokenExpiry=new Date(t.expires_at).getTime()),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}refreshToken(){return e(this,void 0,void 0,(function*(){if(!this.refreshEndpoint)return this.getToken();const e=yield fetch(this.refreshEndpoint,{method:"POST",headers:Object.assign({"Content-Type":"application/json",Authorization:`Bearer ${this.cachedToken}`},this.headers)});if(!e.ok)throw new Error(`Failed to refresh token: ${e.status} ${e.statusText}`);const t=yield e.json();if(this.cachedToken=t.token||t.access_token||t.apiKey,t.expires_in&&(this.tokenExpiry=Date.now()+1e3*t.expires_in),!this.cachedToken)throw new Error("Invalid token response: no token found");return this.cachedToken}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.cachedToken&&(!this.tokenExpiry||Date.now()<this.tokenExpiry)}))}}class ie{constructor(e,t){this.tokenFunction=e,this.validationFunction=t}getToken(){return e(this,void 0,void 0,(function*(){return yield this.tokenFunction()}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!this.validationFunction||(yield this.validationFunction())}))}}class oe{constructor(e){this.apiKey=e}getToken(){return e(this,void 0,void 0,(function*(){if(!this.apiKey)throw new Error("No API key available. Please configure a TokenProvider or set API keys.");return this.apiKey}))}isTokenValid(){return e(this,void 0,void 0,(function*(){return!!this.apiKey}))}}var re="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};const ae="https://api.widgetic.com/v1".replace(/\/+$/,""),se="X-SDK-Version";class de{constructor(e){if(this.configuration={basePath:ae,headers:{},middleware:[]},"string"==typeof e){const t=(null==e?void 0:e.startsWith("Bearer "))?e.slice(7):e;this.configuration.apiKey=e=>re(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${t}`:t})),this.configuration.accessToken=()=>re(this,void 0,void 0,(function*(){return t})),this.configuration.headers={"Content-Type":"application/json"}}else if(e){this.configuration=Object.assign(Object.assign({},e),{basePath:e.basePath||ae});if("string"==typeof e.accessToken&&e.accessToken){const t=e.accessToken,n=t.startsWith("Bearer ")?t.slice(7):t;this.configuration.apiKey=e=>re(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${n}`:n})),this.configuration.accessToken=()=>re(this,void 0,void 0,(function*(){return n}))}e.headers||(this.configuration.headers={"Content-Type":"application/json"})}}set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:ae}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||ge}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){const e=this.configuration.accessToken;if(e)return"function"==typeof e?e:()=>re(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const ue=new de;class le{constructor(e=ue){this.configuration=e,this.fetchApi=(e,t)=>re(this,void 0,void 0,(function*(){let n,i={url:e,init:t};this.middleware&&Array.isArray(this.middleware)||(this.middleware=[]);for(const e of this.middleware)e.pre&&(i=(yield e.pre(Object.assign({fetch:this.fetchApi},i)))||i);try{n=yield(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(const t of this.middleware)t.onError&&(n=(yield t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0}))||n);if(void 0===n)throw e instanceof Error?new pe(e,"The request failed and the interceptors did not return an alternative response"):e}for(const e of this.middleware)e.post&&(n=(yield e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()}))||n);return n})),"string"!=typeof e&&(!e||e instanceof de)||(e=new de(e)),this.configuration=e,this.middleware=this.configuration.middleware||[]}withMiddleware(...e){const t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){const t=e.map((e=>({pre:e})));return this.withMiddleware(...t)}withPostMiddleware(...e){const t=e.map((e=>({post:e})));return this.withMiddleware(...t)}isJsonMime(e){return!!e&&le.jsonRegex.test(e)}request(e,t){return re(this,void 0,void 0,(function*(){var n;const{url:i,init:o}=yield this.createFetchParams(e,t),r=new Headers(Object.assign(Object.assign(Object.assign({},this.configuration.headers),e.headers||{}),o.headers||{})),a=Object.assign(Object.assign({},o),{headers:r}),s=yield this.fetchApi(i,a);if(s&&s.status>=200&&s.status<300)return s;const d=s.clone();let u="Response returned an error code",l=null;try{const e=yield d.json(),t=e.error,i=t&&"object"==typeof t?t.message:t;u=e.message||i||u;const o=null===(n=null==e?void 0:e.error)||void 0===n?void 0:n.code;"string"==typeof o&&o.length>0&&(l=o)}catch(e){try{u=yield d.text()}catch(e){u=s.statusText}}throw new ce(s,u,l)}))}createFetchParams(e,t){return re(this,void 0,void 0,(function*(){let n=(this.configuration.basePath||ae).replace(/\/+$/,"")+(e.path.startsWith("/")?e.path:`/${e.path}`);void 0!==e.query&&0!==Object.keys(e.query).length&&(n+="?"+this.configuration.queryParamsStringify(e.query));const i=Object.assign({},this.configuration.headers,e.headers);Object.keys(i).forEach((e=>void 0===i[e]?delete i[e]:{}));Object.keys(i).some((e=>e.toLowerCase()===se.toLowerCase()))||(i[se]="@widgetic/api-sdk/1.0.42");const o=this.configuration.apiKey;if(o&&!i.Authorization)try{const e=yield o("Authorization");e&&(i.Authorization=e.startsWith("Bearer ")?e:`Bearer ${e}`)}catch(e){}const r="function"==typeof t?t:()=>re(this,void 0,void 0,(function*(){return t})),a={method:e.method,headers:i,body:e.body,credentials:this.configuration.credentials},s=Object.assign(Object.assign({},a),yield r({init:a,context:e}));let d;var u;u=s.body,d="undefined"!=typeof FormData&&u instanceof FormData||s.body instanceof URLSearchParams||function(e){return"undefined"!=typeof Blob&&e instanceof Blob}(s.body)?s.body:this.isJsonMime(i["Content-Type"])?JSON.stringify(s.body):s.body;return{url:n,init:Object.assign(Object.assign({},s),{body:d})}}))}clone(){const e=new(0,this.constructor)(this.configuration);return e.middleware=this.middleware.slice(),e}}le.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class ce extends Error{constructor(e,t,n=null){super(t),this.response=e,this.name="ResponseError",this.code=n}}class pe extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class he extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function ge(e,t=""){return Object.keys(e).map((n=>fe(n,e[n],t))).filter((e=>e.length>0)).join("&")}function fe(e,t,n=""){const i=n+(n.length?`[${e}]`:e);if(t instanceof Array){const e=t.map((e=>encodeURIComponent(String(e)))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${e}`}if(t instanceof Set){return fe(e,Array.from(t),n)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?ge(t,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(t))}`}function ve(e,t){return Object.keys(e).reduce(((n,i)=>Object.assign(Object.assign({},n),{[i]:t(e[i])})),{})}class me{constructor(e,t=e=>e){this.raw=e,this.transformer=t}unwrapSuccessEnvelope(e){if(e&&"object"==typeof e&&"success"in e&&"data"in e){const{success:t,data:n,meta:i}=e,o="boolean"!=typeof t||t;return Array.isArray(n)?{success:o,data:n,meta:i,rawData:n}:n&&"object"==typeof n?Object.assign({success:o,data:n,meta:i},n):{success:o,data:n,meta:i}}return e}value(){return re(this,void 0,void 0,(function*(){const e=yield this.raw.json();return this.transformer(this.unwrapSuccessEnvelope(e))}))}}class we{constructor(e){this.raw=e}value(){return re(this,void 0,void 0,(function*(){}))}}function ye(e){return function(e){if(null==e)return e;return{configured:e.configured,endpointId:null==e.endpointId?void 0:e.endpointId,url:null==e.url?void 0:e.url,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),rotatedAt:null==e.rotatedAt?void 0:new Date(e.rotatedAt),previousSecretValidUntil:null==e.previousSecretValidUntil?void 0:new Date(e.previousSecretValidUntil),lastReceivedAt:null==e.lastReceivedAt?void 0:new Date(e.lastReceivedAt)}}(e)}function Ie(e){return function(e){if(null==e)return e;return{configured:e.configured,endpointId:e.endpointId,url:e.url,secret:e.secret,createdAt:new Date(e.createdAt),rotatedAt:null==e.rotatedAt?void 0:new Date(e.rotatedAt),previousSecretValidUntil:null==e.previousSecretValidUntil?void 0:new Date(e.previousSecretValidUntil),lastReceivedAt:null==e.lastReceivedAt?void 0:new Date(e.lastReceivedAt)}}(e)}function Re(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,abTestId:null==e.abTestId?void 0:e.abTestId,compositionId:null==e.compositionId?void 0:e.compositionId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,trafficPercentage:null==e.trafficPercentage?void 0:e.trafficPercentage,goalTarget:null==e.goalTarget?void 0:e.goalTarget,embedCode:null==e.embedCode?void 0:e.embedCode,totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Te(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,organizationId:null==e.organizationId?void 0:e.organizationId,workspaceType:null==e.workspaceType?void 0:e.workspaceType,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,status:null==e.status?void 0:e.status,successMetrics:null==e.successMetrics?void 0:e.successMetrics,primaryMetric:null==e.primaryMetric?void 0:e.primaryMetric,confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel,minSampleSize:null==e.minSampleSize?void 0:e.minSampleSize,autoGraduate:null==e.autoGraduate?void 0:e.autoGraduate,graduationThreshold:null==e.graduationThreshold?void 0:e.graduationThreshold,startDate:null==e.startDate?void 0:new Date(e.startDate),endDate:null==e.endDate?void 0:new Date(e.endDate),durationDays:null==e.durationDays?void 0:e.durationDays,winningVariantId:null==e.winningVariantId?void 0:e.winningVariantId,graduatedAt:null==e.graduatedAt?void 0:new Date(e.graduatedAt),statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(Re)}}(e)}function ke(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,ab_test_id:null==e.ab_test_id?void 0:e.ab_test_id,variant_id:null==e.variant_id?void 0:e.variant_id,user_id:null==e.user_id?void 0:e.user_id,session_id:null==e.session_id?void 0:e.session_id,user_identifier_hash:null==e.user_identifier_hash?void 0:e.user_identifier_hash,assigned_at:null==e.assigned_at?void 0:new Date(e.assigned_at)}}(e)}function Ae(e){return function(e){if(null==e)return e;return{hasMeaningfulContrast:null==e.hasMeaningfulContrast?void 0:e.hasMeaningfulContrast,primaryDriver:null==e.primaryDriver?void 0:e.primaryDriver,cognitiveClarityScore:null==e.cognitiveClarityScore?void 0:e.cognitiveClarityScore,safeToGraduate:null==e.safeToGraduate?void 0:e.safeToGraduate,qualitativeReason:null==e.qualitativeReason?void 0:e.qualitativeReason}}(e)}function qe(e){return function(e){if(null==e)return e;return{action:null==e.action?void 0:e.action,reason:null==e.reason?void 0:e.reason,minAdditionalSamples:null==e.minAdditionalSamples?void 0:e.minAdditionalSamples}}(e)}function Se(e){return function(e){if(null==e)return e;return{detected:null==e.detected?void 0:e.detected,pValue:null==e.pValue?void 0:e.pValue}}(e)}function Ce(e){return function(e){if(null==e)return e;return{totalImpressions:null==e.totalImpressions?void 0:e.totalImpressions,totalConversions:null==e.totalConversions?void 0:e.totalConversions,totalImpressionEvents:null==e.totalImpressionEvents?void 0:e.totalImpressionEvents,totalConversionEvents:null==e.totalConversionEvents?void 0:e.totalConversionEvents,counting:null==e.counting?void 0:e.counting,overallConversionRate:null==e.overallConversionRate?void 0:e.overallConversionRate,statisticalPower:null==e.statisticalPower?void 0:e.statisticalPower,sampleSizeNeededPerVariant:null==e.sampleSizeNeededPerVariant?void 0:e.sampleSizeNeededPerVariant,sampleRatioMismatch:null==e.sampleRatioMismatch?void 0:Se(e.sampleRatioMismatch),confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel}}(e)}function Ee(e){return function(e){if(null==e)return e;return{variantId:null==e.variantId?void 0:e.variantId,variantName:null==e.variantName?void 0:e.variantName,impressions:null==e.impressions?void 0:e.impressions,conversions:null==e.conversions?void 0:e.conversions,rawImpressions:null==e.rawImpressions?void 0:e.rawImpressions,rawConversions:null==e.rawConversions?void 0:e.rawConversions,conversionRate:null==e.conversionRate?void 0:e.conversionRate,confidenceIntervalLower:null==e.confidenceIntervalLower?void 0:e.confidenceIntervalLower,confidenceIntervalUpper:null==e.confidenceIntervalUpper?void 0:e.confidenceIntervalUpper,zScore:null==e.zScore?void 0:e.zScore,pValue:null==e.pValue?void 0:e.pValue,isWinner:null==e.isWinner?void 0:e.isWinner,liftPercentage:null==e.liftPercentage?void 0:e.liftPercentage,statisticalSignificance:null==e.statisticalSignificance?void 0:e.statisticalSignificance,significantlyWorse:null==e.significantlyWorse?void 0:e.significantlyWorse,bayesianProbabilityToBeatControl:null==e.bayesianProbabilityToBeatControl?void 0:e.bayesianProbabilityToBeatControl}}(e)}function Ue(e){return function(e){if(null==e)return e;return{overall:null==e.overall?void 0:Ce(e.overall),variants:null==e.variants?void 0:e.variants.map(Ee),recommendation:null==e.recommendation?void 0:qe(e.recommendation)}}(e)}function be(e){return function(e){if(null==e)return e;return{id:e.id,title:e.title,status:e.status,charCount:e.charCount,chunkCount:e.chunkCount,createdAt:new Date(e.createdAt),readyAt:null==e.readyAt?null:new Date(e.readyAt)}}(e)}function _e(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:be(e.data)}}(e)}function xe(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,translationId:null==e.translationId?void 0:e.translationId,compositionId:null==e.compositionId?void 0:e.compositionId,languageCode:null==e.languageCode?void 0:e.languageCode,languageName:null==e.languageName?void 0:e.languageName,isRoot:null==e.isRoot?void 0:e.isRoot,embedCode:null==e.embedCode?void 0:e.embedCode,totalViews:null==e.totalViews?void 0:e.totalViews,status:null==e.status?void 0:e.status,translationProgress:null==e.translationProgress?void 0:e.translationProgress,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function De(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,status:null==e.status?void 0:e.status,embedCode:null==e.embedCode?void 0:e.embedCode,selectedLanguages:null==e.selectedLanguages?void 0:e.selectedLanguages,totalViews:null==e.totalViews?void 0:e.totalViews,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),variants:null==e.variants?void 0:e.variants.map(xe)}}(e)}function Be(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:De(e.data),message:null==e.message?void 0:e.message}}(e)}function Me(e){return function(e){if(null==e)return e;return{documents:e.documents,characters:e.characters,maxDocuments:e.maxDocuments,maxTotalChars:e.maxTotalChars}}(e)}function Pe(e){return function(e){if(null==e)return e;return{documents:e.documents.map(be),totals:Me(e.totals)}}(e)}function Ke(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function We(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),country:e.country,region:null==e.region?void 0:e.region,city:null==e.city?void 0:e.city,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function Oe(e){return function(e){if(null==e)return e;return{total_views:null==e.total_views?void 0:e.total_views,unique_views:null==e.unique_views?void 0:e.unique_views,total_interactions:null==e.total_interactions?void 0:e.total_interactions,unique_interactions:null==e.unique_interactions?void 0:e.unique_interactions,average_session_time:null==e.average_session_time?void 0:e.average_session_time,bounce_rate:null==e.bounce_rate?void 0:e.bounce_rate}}(e)}function ze(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),deviceType:e.deviceType,views:e.views,uniqueUsers:e.uniqueUsers,avgSessionDuration:e.avgSessionDuration,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Ge(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,timestamp:new Date(e.timestamp),eventType:e.eventType,eventData:null==e.eventData?void 0:e.eventData,userId:null==e.userId?void 0:e.userId,sessionId:null==e.sessionId?void 0:e.sessionId,ipAddress:null==e.ipAddress?void 0:e.ipAddress,userAgent:null==e.userAgent?void 0:e.userAgent,referrer:null==e.referrer?void 0:e.referrer,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function Le(e){return function(e){if(null==e)return e;return{id:e.id,composition_id:e.composition_id,date:new Date(e.date),source:e.source,source_url:null==e.source_url?void 0:e.source_url,views:e.views,unique_users:e.unique_users,created_at:null==e.created_at?void 0:new Date(e.created_at),updated_at:null==e.updated_at?void 0:new Date(e.updated_at)}}(e)}function $e(e){return function(e){if(null==e)return e;return{summary:Oe(e.summary),devices:e.devices.map(ze),geography:e.geography.map(We),referrers:e.referrers.map(Le),events:null==e.events?void 0:e.events.map(Ge)}}(e)}function je(e){return function(e){if(null==e)return e;return{events:null==e.events?void 0:e.events.map(Ge),totalEvents:null==e.totalEvents?void 0:e.totalEvents,databaseStored:null==e.databaseStored?void 0:e.databaseStored,axiomStreamed:null==e.axiomStreamed?void 0:e.axiomStreamed,processingTimeMs:null==e.processingTimeMs?void 0:e.processingTimeMs}}(e)}function Ne(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,eventType:e.eventType,eventData:e.eventData,userId:e.userId,sessionId:e.sessionId,ipAddress:e.ipAddress,userAgent:e.userAgent,referrer:e.referrer}}(e,!1)}function Ve(e){return function(e){if(null==e)return e;return{events:e.events.map(Ne)}}(e,!1)}function Xe(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function Fe(e){return function(e){if(null==e)return e;return{canAccess:null==e.canAccess?void 0:e.canAccess,reason:null==e.reason?void 0:e.reason}}(e)}function He(e){return function(e){if(null==e)return e;return{should_stop:null==e.should_stop?void 0:e.should_stop,reason:null==e.reason?void 0:e.reason,new_status:null==e.new_status?void 0:e.new_status}}(e)}function Ye(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:He(e.data)}}(e)}function Ze(e){return function(e){if(null==e)return e;return{id:e.id,creatorId:e.creatorId,widgetId:e.widgetId,name:e.name,content:e.content,contentVersion:null==e.contentVersion?void 0:e.contentVersion,status:e.status,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),embedSettings:null==e.embedSettings?void 0:e.embedSettings,design:null==e.design?void 0:e.design,databaseId:null==e.databaseId?void 0:e.databaseId,projectId:null==e.projectId?void 0:e.projectId,managedUserId:null==e.managedUserId?void 0:e.managedUserId,direct:null==e.direct?void 0:e.direct}}(e)}function Je(e){return function(e){if(null==e)return e;return{url:e.url,refreshSeconds:e.refreshSeconds}}(e)}function Qe(e){return function(e){if(null==e)return e;return{name:e.name,type:e.type}}(e)}function et(e){return function(e){if(null==e)return e;return{name:e.name,columns:e.columns.map(Qe),rows:e.rows}}(e)}function tt(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,hasData:e.hasData,tables:e.tables.map(et)}}(e)}function nt(e){return function(e){if(null==e)return e;return{value:e.value,count:e.count}}(e)}function it(e){return function(e){if(null==e)return e;return{group:null==e.group?void 0:e.group,count:null==e.count?void 0:e.count,avg:null==e.avg?void 0:e.avg,min:null==e.min?void 0:e.min,max:null==e.max?void 0:e.max,sum:null==e.sum?void 0:e.sum}}(e)}function ot(e){return function(e){if(null==e)return e;return{column:e.column,tallies:e.tallies.map(it),truncated:null==e.truncated?void 0:e.truncated}}(e)}function rt(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,table:e.table,totalRows:e.totalRows,tallies:null==e.tallies?null:e.tallies.map(nt),moreGroups:e.moreGroups,columns:e.columns,rows:null==e.rows?null:e.rows,moreRows:e.moreRows,aggregates:null==e.aggregates?void 0:ot(e.aggregates)}}(e)}function at(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,compositionId:null==e.compositionId?void 0:e.compositionId,version:null==e.version?void 0:e.version,content:null==e.content?void 0:e.content,createdAt:null==e.createdAt?void 0:new Date(e.createdAt)}}(e)}function st(e){return function(e){if(null==e)return e;return{path:e.path,message:e.message,expected:null==e.expected?void 0:e.expected,actual:null==e.actual?void 0:e.actual}}(e)}function dt(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function ut(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:dt(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent,item:null==e.item?void 0:e.item}}(e)}function lt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ke(e.data)}}(e)}function ct(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,compositionId:e.compositionId,trafficPercentage:e.trafficPercentage,goalTarget:e.goalTarget}}(e,!1)}function pt(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,workspaceType:e.workspaceType,variants:e.variants.map(ct),successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function ht(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function gt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ze(e.data),meta:null==e.meta?void 0:ht(e.meta)}}(e)}function ft(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ut(e.data)}}(e)}function vt(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{position:e.position})}(e,!1)}function mt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function wt(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function yt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ze(e.data),meta:null==e.meta?void 0:wt(e.meta)}}(e)}function It(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:De(e.data),message:null==e.message?void 0:e.message}}(e)}function Rt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId,warnings:null==e.warnings?void 0:e.warnings}}(e)}function Tt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Rt(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function kt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ie(e.data)}}(e)}function At(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Te(e.data)}}(e)}function qt(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,date:new Date(e.date),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function St(e){return function(e){if(null==e)return e;return{deleted:null==e.deleted?void 0:e.deleted,contentVersion:null==e.contentVersion?void 0:e.contentVersion}}(e)}function Ct(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Et(e){return function(e){if(null==e)return e;return{removed:e.removed}}(e)}function Ut(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Et(e.data)}}(e)}function bt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function _t(e){return function(e){if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId}}(e)}function xt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_t(e.data)}}(e)}function Dt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,creatorId:null==e.creatorId?void 0:e.creatorId,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,isPublic:null==e.isPublic?void 0:e.isPublic,isDraft:null==e.isDraft?void 0:e.isDraft,shareId:null==e.shareId?void 0:e.shareId,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt),jsPath:null==e.jsPath?void 0:e.jsPath,canvasId:null==e.canvasId?void 0:e.canvasId,repoId:null==e.repoId?void 0:e.repoId,databaseId:null==e.databaseId?void 0:e.databaseId,version:null==e.version?void 0:e.version,lastCommitSha:null==e.lastCommitSha?void 0:e.lastCommitSha,organizationId:null==e.organizationId?void 0:e.organizationId,projectFolder:null==e.projectFolder?void 0:e.projectFolder,workspaceType:null==e.workspaceType?void 0:e.workspaceType,managedUserId:null==e.managedUserId?void 0:e.managedUserId}}(e)}function Bt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Dt(e.data),warnings:null==e.warnings?void 0:e.warnings}}(e)}function Mt(e){return function(e){if(null==e)return e;return{token:null==e.token?void 0:e.token,tokenType:null==e.tokenType?void 0:e.tokenType,expiresIn:null==e.expiresIn?void 0:e.expiresIn,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt),scopes:null==e.scopes?void 0:e.scopes}}(e)}function Pt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Mt(e.data)}}(e)}function Kt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,composition_id:null==e.composition_id?void 0:e.composition_id,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage,goal_target:null==e.goal_target?void 0:e.goal_target}}(e)}function Wt(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,name:null==e.name?void 0:e.name,status:null==e.status?void 0:e.status,variants:null==e.variants?void 0:e.variants.map(Kt),success_metrics:null==e.success_metrics?void 0:e.success_metrics,primary_metric:null==e.primary_metric?void 0:e.primary_metric}}(e)}function Ot(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Pe(e.data)}}(e)}function zt(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total}}(e)}function Gt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Ze),meta:null==e.meta?void 0:zt(e.meta)}}(e)}function Lt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,description:null==e.description?void 0:e.description,tracking:null==e.tracking?void 0:e.tracking,supportsElementTarget:null==e.supportsElementTarget?void 0:e.supportsElementTarget,available:null==e.available?void 0:e.available,unavailableReason:null==e.unavailableReason?void 0:e.unavailableReason}}(e)}function $t(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Lt)}}(e)}function jt(e){return function(e){if(null==e)return e;return{selector:null==e.selector?void 0:e.selector,label:null==e.label?void 0:e.label,kind:null==e.kind?void 0:e.kind,tag:null==e.tag?void 0:e.tag,metrics:null==e.metrics?void 0:e.metrics,preferred:null==e.preferred?void 0:e.preferred,matchCount:null==e.matchCount?void 0:e.matchCount}}(e)}function Nt(e){return function(e){if(null==e)return e;return{metric:null==e.metric?void 0:e.metric,label:null==e.label?void 0:e.label,description:null==e.description?void 0:e.description,selector:null==e.selector?void 0:e.selector,recommended:null==e.recommended?void 0:e.recommended}}(e)}function Vt(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,complete:null==e.complete?void 0:e.complete,note:null==e.note?void 0:e.note,goals:null==e.goals?void 0:e.goals.map(Nt),targets:null==e.targets?void 0:e.targets.map(jt)}}(e)}function Xt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Vt(e.data)}}(e)}function Ft(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ze(e.data)}}(e)}function Ht(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,content:null==e.content?void 0:e.content,contentItems:null==e.contentItems?void 0:e.contentItems,metadata:null==e.metadata?void 0:e.metadata}}(e)}function Yt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function Zt(e){return function(e){if(null==e)return e;return{version:null==e.version?void 0:e.version,widgetType:null==e.widgetType?void 0:e.widgetType,type:null==e.type?void 0:e.type,theme:null==e.theme?void 0:e.theme,componentGroups:null==e.componentGroups?void 0:e.componentGroups,metadata:null==e.metadata?void 0:e.metadata}}(e)}function Jt(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,version:null==e.version?void 0:e.version,type:null==e.type?void 0:e.type,componentGroups:null==e.componentGroups?void 0:e.componentGroups,defaults:null==e.defaults?void 0:e.defaults}}(e)}function Qt(e){return function(e){if(null==e)return e;return{compositionId:null==e.compositionId?void 0:e.compositionId,widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,previewUrl:null==e.previewUrl?void 0:e.previewUrl}}(e)}function en(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(at)}}(e)}function tn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,error:null==e.error?void 0:e.error}}(e)}function nn(e){return function(e){if(null==e)return e;return{compositions:null==e.compositions?void 0:e.compositions.map(Ze),errors:null==e.errors?void 0:e.errors.map(tn)}}(e)}function on(e){return function(e){if(null==e)return e;return{presets:null==e.presets?void 0:e.presets}}(e)}function rn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:on(e.data)}}(e)}function an(e){return function(e){if(null==e)return e;return{name:null==e.name?void 0:e.name,nativeName:null==e.nativeName?void 0:e.nativeName,region:null==e.region?void 0:e.region,isPreselected:null==e.isPreselected?void 0:e.isPreselected}}(e)}function sn(e){return function(e){if(null==e)return e;return{languages:null==e.languages?void 0:ve(e.languages,an),preselected:null==e.preselected?void 0:e.preselected}}(e)}function dn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:sn(e.data)}}(e)}function un(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:De(e.data)}}(e)}function ln(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views,percentage:null==e.percentage?void 0:e.percentage}}(e)}function cn(e){return function(e){if(null==e)return e;return{languageCode:null==e.languageCode?void 0:e.languageCode,views:null==e.views?void 0:e.views}}(e)}function pn(e){return function(e){if(null==e)return e;return{totalViews:null==e.totalViews?void 0:e.totalViews,languageBreakdown:null==e.languageBreakdown?void 0:e.languageBreakdown.map(ln),topPerformingLanguages:null==e.topPerformingLanguages?void 0:e.topPerformingLanguages.map(cn),completionStatus:null==e.completionStatus?void 0:e.completionStatus}}(e)}function hn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:pn(e.data)}}(e)}function gn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,name:null==e.name?void 0:e.name,rootLanguage:null==e.rootLanguage?void 0:e.rootLanguage,rootCompositionId:null==e.rootCompositionId?void 0:e.rootCompositionId,languageCompositions:null==e.languageCompositions?void 0:e.languageCompositions,status:null==e.status?void 0:e.status}}(e)}function fn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:gn(e.data)}}(e)}function vn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(De),count:null==e.count?void 0:e.count}}(e)}function mn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,composition_id:null==e.composition_id?void 0:e.composition_id,name:null==e.name?void 0:e.name,traffic_percentage:null==e.traffic_percentage?void 0:e.traffic_percentage}}(e)}function wn(e){return function(e){if(null==e)return e;return{id:null==e.id?void 0:e.id,version:null==e.version?void 0:e.version,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,publishedAt:null==e.publishedAt?void 0:new Date(e.publishedAt),isPublished:null==e.isPublished?void 0:e.isPublished,prompt:null==e.prompt?void 0:e.prompt,publishedBy:null==e.publishedBy?void 0:e.publishedBy}}(e)}function yn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(wn)}}(e)}function In(e){return function(e){if(null==e)return e;return{page:null==e.page?void 0:e.page,size:null==e.size?void 0:e.size,total:null==e.total?void 0:e.total,limit:null==e.limit?void 0:e.limit,offset:null==e.offset?void 0:e.offset,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage}}(e)}function Rn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Dt),meta:null==e.meta?void 0:In(e.meta)}}(e)}function Tn(e){return function(e){if(null==e)return e;return{widgets:null==e.widgets?void 0:e.widgets.map(Dt),errors:null==e.errors?void 0:e.errors.map(tn)}}(e)}function kn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ye(e.data)}}(e)}function An(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ae(e.data)}}(e)}function qn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ue(e.data)}}(e)}function Sn(e){return function(e){if(null==e)return e;return{count:null==e.count?void 0:e.count,workspace_type:null==e.workspace_type?void 0:e.workspace_type}}(e)}function Cn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(Te),meta:null==e.meta?void 0:Sn(e.meta)}}(e)}function En(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,month:e.month,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}function Un(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function bn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ke(e.data)}}(e)}function _n(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function xn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:_n(e.data)}}(e)}function Dn(e){return function(e){if(null==e)return e;return{email:e.email}}(e,!1)}function Bn(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,errors:null==e.errors?void 0:e.errors,warnings:null==e.warnings?void 0:e.warnings}}(e)}function Mn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,contentVersion:null==e.contentVersion?void 0:e.contentVersion,validationResult:null==e.validationResult?void 0:Bn(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent}}(e)}function Pn(e){return function(e){if(null==e)return e;return{widgetId:null==e.widgetId?void 0:e.widgetId,version:null==e.version?void 0:e.version,artifactUrl:null==e.artifactUrl?void 0:e.artifactUrl,commitSha:null==e.commitSha?void 0:e.commitSha,commitTitle:null==e.commitTitle?void 0:e.commitTitle}}(e)}function Kn(e){return function(e){if(null==e)return e;return{data:null==e.data?void 0:Pn(e.data),message:null==e.message?void 0:e.message,warnings:null==e.warnings?void 0:e.warnings}}(e)}function Wn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Kn(e.data)}}(e)}function On(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Te(e.data),message:null==e.message?void 0:e.message}}(e)}function zn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Te(e.data),message:null==e.message?void 0:e.message}}(e)}function Gn(e){return function(e){if(null==e)return e;return{limit:null==e.limit?void 0:e.limit,hasNextPage:null==e.hasNextPage?void 0:e.hasNextPage,hasPreviousPage:null==e.hasPreviousPage?void 0:e.hasPreviousPage,nextCursor:null==e.nextCursor?void 0:e.nextCursor,previousCursor:null==e.previousCursor?void 0:e.previousCursor}}(e)}function Ln(e){return function(e){if(null==e)return e;return{pagination:null==e.pagination?void 0:Gn(e.pagination)}}(e)}function $n(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data,meta:null==e.meta?void 0:Ln(e.meta)}}(e)}function jn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message}}(e)}function Nn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString(),user_id:e.user_id,session_id:e.session_id}}(e,!1)}function Vn(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Nn(e.data)}}(e,!1)}function Xn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,message:null==e.message?void 0:e.message,count:null==e.count?void 0:e.count}}(e)}function Fn(e){return function(e){if(null==e)return e;return{experiment_id:e.experiment_id,variant_id:e.variant_id,conversion_type:e.conversion_type,goal_target:e.goal_target,user_id:e.user_id,session_id:e.session_id,timestamp:null==e.timestamp?void 0:e.timestamp.toISOString()}}(e,!1)}function Hn(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Fn(e.data)}}(e,!1)}function Yn(e){return function(e){if(null==e)return e;return{events:e.events.map(Hn)}}(e,!1)}function Zn(e){return function(e){if(null==e)return e;return{id:e.id,goalTarget:e.goalTarget}}(e,!1)}function Jn(e){return function(e){if(null==e)return e;return{name:e.name,description:e.description,status:e.status,successMetrics:e.successMetrics,primaryMetric:e.primaryMetric,variants:null==e.variants?void 0:e.variants.map(Zn),confidenceLevel:e.confidenceLevel,minSampleSize:e.minSampleSize,autoGraduate:e.autoGraduate,graduationThreshold:e.graduationThreshold,startDate:null==e.startDate?void 0:e.startDate.toISOString(),endDate:null==e.endDate?void 0:e.endDate.toISOString(),durationDays:e.durationDays}}(e,!1)}function Qn(e){return function(e){if(null==e)return e;return{token:e.token,email:e.email}}(e,!1)}function ei(e){return function(e){if(null==e)return e;return{repositoryId:null==e.repositoryId?void 0:e.repositoryId}}(e)}function ti(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ei(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function ni(e){return function(e){if(null==e)return e;return{thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl}}(e)}function ii(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ni(e.data)}}(e)}function oi(e){return function(e){if(null==e)return e;return{valid:e.valid,errors:null==e.errors?void 0:e.errors.map(st),warnings:null==e.warnings?void 0:e.warnings.map(st),sanitizedContent:null==e.sanitizedContent?void 0:e.sanitizedContent}}(e)}function ri(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,reason:null==e.reason?void 0:e.reason,message:null==e.message?void 0:e.message}}(e)}function ai(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ri(e.data)}}(e)}function si(e){return function(e){if(null==e)return e;return{valid:null==e.valid?void 0:e.valid,tokenType:null==e.tokenType?void 0:e.tokenType,scopes:null==e.scopes?void 0:e.scopes,userId:null==e.userId?void 0:e.userId,expiresAt:null==e.expiresAt?void 0:new Date(e.expiresAt)}}(e)}function di(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:si(e.data)}}(e)}function ui(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,impact:null==e.impact?void 0:e.impact}}(e)}function li(e){return function(e){if(null==e)return e;return{test_id:null==e.test_id?void 0:e.test_id,test_name:null==e.test_name?void 0:e.test_name,status:null==e.status?void 0:e.status,reason:null==e.reason?void 0:e.reason}}(e)}function ci(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,blockers:null==e.blockers?void 0:e.blockers.map(li),warnings:null==e.warnings?void 0:e.warnings.map(ui)}}(e)}function pi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ci(e.data)}}(e)}function hi(e){return function(e){if(null==e)return e;return{variant:null==e.variant?void 0:e.variant,metric:null==e.metric?void 0:e.metric,reason:null==e.reason?void 0:e.reason}}(e)}function gi(e){return function(e){if(null==e)return e;return{is_valid:null==e.is_valid?void 0:e.is_valid,issues:null==e.issues?void 0:e.issues.map(hi),recommendations:null==e.recommendations?void 0:e.recommendations}}(e)}function fi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:gi(e.data)}}(e)}function vi(e){return function(e){if(null==e)return e;return{composition_id:e.composition_id,name:e.name}}(e,!1)}function mi(e){return function(e){if(null==e)return e;return{variants:e.variants.map(vi),success_metrics:e.success_metrics}}(e,!1)}function wi(e){return function(e){if(null==e)return e;return{can_delete:null==e.can_delete?void 0:e.can_delete,affected_compositions:null==e.affected_compositions?void 0:e.affected_compositions,blockers:null==e.blockers?void 0:e.blockers.map(li),warnings:null==e.warnings?void 0:e.warnings.map(ui)}}(e)}function yi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:wi(e.data)}}(e)}function Ii(e){return function(e){if(null==e)return e;return{id:e.id,compositionId:e.compositionId,year:e.year,weekNumber:e.weekNumber,startDate:new Date(e.startDate),endDate:new Date(e.endDate),totalViews:e.totalViews,uniqueViews:e.uniqueViews,totalInteractions:e.totalInteractions,uniqueInteractions:e.uniqueInteractions,totalSessionTime:e.totalSessionTime,averageSessionTime:e.averageSessionTime,bounceRate:e.bounceRate,createdAt:null==e.createdAt?void 0:new Date(e.createdAt),updatedAt:null==e.updatedAt?void 0:new Date(e.updatedAt)}}(e)}var Ri="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ti extends le{assignVariantRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling assignVariant().');if(null==e.assignVariantRequest)throw new he("assignVariantRequest",'Required parameter "assignVariantRequest" was null or undefined when calling assignVariant().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/{id}/assign".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.assignVariantRequest,o=r,null==o?o:{user_id:o.user_id,session_id:o.session_id})},t);var o,r;return new me(i,(e=>Re(e)))}))}assignVariant(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.assignVariantRaw(e,t);return yield n.value()}))}checkWorkspaceABTestAutoStopRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling checkWorkspaceABTestAutoStop().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling checkWorkspaceABTestAutoStop().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/auto-stop-check".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Ye(e)))}))}checkWorkspaceABTestAutoStop(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.checkWorkspaceABTestAutoStopRaw(e,t);return yield n.value()}))}createABTestAssignmentRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.createABTestAssignmentRequest)throw new he("createABTestAssignmentRequest",'Required parameter "createABTestAssignmentRequest" was null or undefined when calling createABTestAssignment().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/assignments",method:"POST",headers:n,query:{},body:(r=e.createABTestAssignmentRequest,o=r,null==o?o:{experiment_id:o.experiment_id,variant_id:o.variant_id,user_id:o.user_id,session_id:o.session_id,device_type:o.device_type,user_agent:o.user_agent,ip_address:o.ip_address,country_code:o.country_code})},t);var o,r;return new me(i,(e=>lt(e)))}))}createABTestAssignment(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.createABTestAssignmentRaw(e,t);return yield n.value()}))}createWorkspaceABConversionWebhookRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABConversionWebhook().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{}},t);return new me(i,(e=>kt(e)))}))}createWorkspaceABConversionWebhook(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}createWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABTest().');if(null==e.createABTestRequest)throw new he("createABTestRequest",'Required parameter "createABTestRequest" was null or undefined when calling createWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:pt(e.createABTestRequest)},t);return new me(i,(e=>At(e)))}))}createWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABTestRaw(e,t);return yield n.value()}))}deleteWorkspaceABConversionWebhookRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABConversionWebhook().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>Ut(e)))}))}deleteWorkspaceABConversionWebhook(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}deleteWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling deleteWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>bt(e)))}))}deleteWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABTestRaw(e,t);return yield n.value()}))}getABTestConfigRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getABTestConfig().');const n=yield this.request({path:"/ab-tests/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new me(n,(e=>Wt(e)))}))}getABTestConfig(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getABTestConfigRaw(e,t);return yield n.value()}))}getAvailableMetricsRaw(e){return Ri(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/metrics/available",method:"GET",headers:t,query:{}},e);return new me(n,(e=>$t(e)))}))}getAvailableMetrics(e){return Ri(this,void 0,void 0,(function*(){const t=yield this.getAvailableMetricsRaw(e);return yield t.value()}))}getCompositionABGoalTargetsRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getCompositionABGoalTargets().');if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionABGoalTargets().');const n={};null!=e.metric&&(n.metric=e.metric);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/compositions/{id}/ab-goal-targets".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>Xt(e)))}))}getCompositionABGoalTargets(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getCompositionABGoalTargetsRaw(e,t);return yield n.value()}))}getVariantConfigRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getVariantConfig().');const n=yield this.request({path:"/ab-tests/variants/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new me(n,(e=>mn(e)))}))}getVariantConfig(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getVariantConfigRaw(e,t);return yield n.value()}))}getWorkspaceABConversionWebhookRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABConversionWebhook().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>kn(e)))}))}getWorkspaceABConversionWebhook(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}getWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTest().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>At(e)))}))}getWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestRaw(e,t);return yield n.value()}))}getWorkspaceABTestDiagnosisRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestDiagnosis().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestDiagnosis().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/diagnosis".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>An(e)))}))}getWorkspaceABTestDiagnosis(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestDiagnosisRaw(e,t);return yield n.value()}))}getWorkspaceABTestStatisticsRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestStatistics().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling getWorkspaceABTestStatistics().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/statistics".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>qn(e)))}))}getWorkspaceABTestStatistics(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestStatisticsRaw(e,t);return yield n.value()}))}listWorkspaceABTestsRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling listWorkspaceABTests().');const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/ab-tests".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:i,query:n},t);return new me(o,(e=>Cn(e)))}))}listWorkspaceABTests(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceABTestsRaw(e,t);return yield n.value()}))}pauseWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling pauseWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/pause".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new me(i,(e=>At(e)))}))}pauseWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.pauseWorkspaceABTestRaw(e,t);return yield n.value()}))}rotateWorkspaceABConversionWebhookSecretRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling rotateWorkspaceABConversionWebhookSecret().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-conversion-webhook/rotate".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{}},t);return new me(i,(e=>kt(e)))}))}rotateWorkspaceABConversionWebhookSecret(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.rotateWorkspaceABConversionWebhookSecretRaw(e,t);return yield n.value()}))}setWorkspaceABTestDurationRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.setWorkspaceABTestDurationRequest)throw new he("setWorkspaceABTestDurationRequest",'Required parameter "setWorkspaceABTestDurationRequest" was null or undefined when calling setWorkspaceABTestDuration().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/duration".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:(r=e.setWorkspaceABTestDurationRequest,o=r,null==o?o:{duration_days:o.duration_days})},t);var o,r;return new me(i,(e=>On(e)))}))}setWorkspaceABTestDuration(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.setWorkspaceABTestDurationRaw(e,t);return yield n.value()}))}startWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling startWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling startWorkspaceABTest().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/start".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{}},t);return new me(i,(e=>At(e)))}))}startWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.startWorkspaceABTestRaw(e,t);return yield n.value()}))}stopWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling stopWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling stopWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}/stop".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"POST",headers:n,query:{},body:(r=e.stopWorkspaceABTestRequest,o=r,null==o?o:{winning_variant_id:o.winning_variant_id,winningVariantId:o.winningVariantId})},t);var o,r;return new me(i,(e=>zn(e)))}))}stopWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.stopWorkspaceABTestRaw(e,t);return yield n.value()}))}trackABTestEventRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.trackABTestEventRequest)throw new he("trackABTestEventRequest",'Required parameter "trackABTestEventRequest" was null or undefined when calling trackABTestEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/events",method:"POST",headers:n,query:{},body:Vn(e.trackABTestEventRequest)},t);return new me(i,(e=>jn(e)))}))}trackABTestEvent(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.trackABTestEventRaw(e,t);return yield n.value()}))}trackBulkABTestEventsRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.trackBulkABTestEventsRequest)throw new he("trackBulkABTestEventsRequest",'Required parameter "trackBulkABTestEventsRequest" was null or undefined when calling trackBulkABTestEvents().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/ab-tests/analytics/bulk",method:"POST",headers:n,query:{},body:Yn(e.trackBulkABTestEventsRequest)},t);return new me(i,(e=>Xn(e)))}))}trackBulkABTestEvents(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.trackBulkABTestEventsRaw(e,t);return yield n.value()}))}updateWorkspaceABTestRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.testId)throw new he("testId",'Required parameter "testId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.updateABTestRequest)throw new he("updateABTestRequest",'Required parameter "updateABTestRequest" was null or undefined when calling updateWorkspaceABTest().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/{testId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{testId}",encodeURIComponent(String(e.testId))),method:"PUT",headers:n,query:{},body:Jn(e.updateABTestRequest)},t);return new me(i,(e=>At(e)))}))}updateWorkspaceABTest(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.updateWorkspaceABTestRaw(e,t);return yield n.value()}))}validateWorkspaceCompositionDeletionRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceCompositionDeletion().');if(null==e.validateWorkspaceCompositionDeletionRequest)throw new he("validateWorkspaceCompositionDeletionRequest",'Required parameter "validateWorkspaceCompositionDeletionRequest" was null or undefined when calling validateWorkspaceCompositionDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-composition-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceCompositionDeletionRequest,o=r,null==o?o:{composition_ids:o.composition_ids})},t);var o,r;return new me(i,(e=>pi(e)))}))}validateWorkspaceCompositionDeletion(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceCompositionDeletionRaw(e,t);return yield n.value()}))}validateWorkspaceGoalTrackingRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceGoalTracking().');if(null==e.validateWorkspaceGoalTrackingRequest)throw new he("validateWorkspaceGoalTrackingRequest",'Required parameter "validateWorkspaceGoalTrackingRequest" was null or undefined when calling validateWorkspaceGoalTracking().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-goal-tracking".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:mi(e.validateWorkspaceGoalTrackingRequest)},t);return new me(i,(e=>fi(e)))}))}validateWorkspaceGoalTracking(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceGoalTrackingRaw(e,t);return yield n.value()}))}validateWorkspaceWidgetDeletionRaw(e,t){return Ri(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new he("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceWidgetDeletion().');if(null==e.validateWorkspaceWidgetDeletionRequest)throw new he("validateWorkspaceWidgetDeletionRequest",'Required parameter "validateWorkspaceWidgetDeletionRequest" was null or undefined when calling validateWorkspaceWidgetDeletion().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/workspaces/{workspaceId}/ab-tests/validate-widget-deletion".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:(r=e.validateWorkspaceWidgetDeletionRequest,o=r,null==o?o:{widget_id:o.widget_id})},t);var o,r;return new me(i,(e=>yi(e)))}))}validateWorkspaceWidgetDeletion(e,t){return Ri(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceWidgetDeletionRaw(e,t);return yield n.value()}))}}var ki="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ai extends le{analyticsEventsBulkPostRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.analyticsEventsBulkPostRequest)throw new he("analyticsEventsBulkPostRequest",'Required parameter "analyticsEventsBulkPostRequest" was null or undefined when calling analyticsEventsBulkPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/analytics/events/bulk",method:"POST",headers:n,query:{},body:Ve(e.analyticsEventsBulkPostRequest)},t);return new me(i,(e=>je(e)))}))}analyticsEventsBulkPost(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.analyticsEventsBulkPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDailyGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDailyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/daily".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(qt)))}))}compositionsIdAnalyticsDailyGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDailyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDashboardGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDashboardGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.includeEvents&&(n.include_events=e.includeEvents);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/dashboard".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>$e(e)))}))}compositionsIdAnalyticsDashboardGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDashboardGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsDevicesGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsDevicesGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.deviceType&&(n.device_type=e.deviceType),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/devices".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(ze)))}))}compositionsIdAnalyticsDevicesGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsDevicesGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.eventType&&(n.event_type=e.eventType),null!=e.userId&&(n.user_id=e.userId),null!=e.sessionId&&(n.session_id=e.sessionId),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(Ge)))}))}compositionsIdAnalyticsEventsGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsEventsPostRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsEventsPost().');if(null==e.newAnalyticsEvent)throw new he("newAnalyticsEvent",'Required parameter "newAnalyticsEvent" was null or undefined when calling compositionsIdAnalyticsEventsPost().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:Ne(e.newAnalyticsEvent)},t);return new me(i,(e=>Ge(e)))}))}compositionsIdAnalyticsEventsPost(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsEventsPostRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsGeographyGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsGeographyGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.country&&(n.country=e.country),null!=e.region&&(n.region=e.region),null!=e.city&&(n.city=e.city),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/geography".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(We)))}))}compositionsIdAnalyticsGeographyGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsGeographyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsMonthlyGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsMonthlyGet().');const n={};null!=e.month&&(n.month=e.month),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/monthly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(En)))}))}compositionsIdAnalyticsMonthlyGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsMonthlyGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsReferrersGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsReferrersGet().');const n={};null!=e.startDate&&(n.start_date=e.startDate.toISOString().substring(0,10)),null!=e.endDate&&(n.end_date=e.endDate.toISOString().substring(0,10)),null!=e.source&&(n.source=e.source),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/referrers".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(Le)))}))}compositionsIdAnalyticsReferrersGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsReferrersGetRaw(e,t);return yield n.value()}))}compositionsIdAnalyticsWeeklyGetRaw(e,t){return ki(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling compositionsIdAnalyticsWeeklyGet().');const n={};null!=e.weekNumber&&(n.week_number=e.weekNumber),null!=e.year&&(n.year=e.year),null!=e.limit&&(n.limit=e.limit),null!=e.offset&&(n.offset=e.offset);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/analytics/weekly".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>e.map(Ii)))}))}compositionsIdAnalyticsWeeklyGet(e,t){return ki(this,void 0,void 0,(function*(){const n=yield this.compositionsIdAnalyticsWeeklyGetRaw(e,t);return yield n.value()}))}flushAxiomEventsRaw(e){return ki(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/flush",method:"POST",headers:t,query:{}},e);return new me(n,(e=>$n(e)))}))}flushAxiomEvents(e){return ki(this,void 0,void 0,(function*(){const t=yield this.flushAxiomEventsRaw(e);return yield t.value()}))}getAxiomStatusRaw(e){return ki(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/status",method:"GET",headers:t,query:{}},e);return new me(n,(e=>$n(e)))}))}getAxiomStatus(e){return ki(this,void 0,void 0,(function*(){const t=yield this.getAxiomStatusRaw(e);return yield t.value()}))}}var qi="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Si extends le{completeSignupRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.completeSignupRequest)throw new he("completeSignupRequest",'Required parameter "completeSignupRequest" was null or undefined when calling completeSignup().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/complete-signup",method:"POST",headers:n,query:{},body:(r=e.completeSignupRequest,o=r,null==o?o:{userId:o.userId,email:o.email,role:o.role,plan:o.plan,token:o.token})},t);var o,r;return new we(i)}))}completeSignup(e,t){return qi(this,void 0,void 0,(function*(){yield this.completeSignupRaw(e,t)}))}confirmEmailRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new he("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling confirmEmail().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/confirm-email",method:"POST",headers:n,query:{},body:Qn(e.updateEmailRequest)},t);return new we(i)}))}confirmEmail(e,t){return qi(this,void 0,void 0,(function*(){yield this.confirmEmailRaw(e,t)}))}consumeOAuthSessionBridgeRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.bridgeId)throw new he("bridgeId",'Required parameter "bridgeId" was null or undefined when calling consumeOAuthSessionBridge().');const n=yield this.request({path:"/auth/oauth-session/{bridgeId}".replace("{bridgeId}",encodeURIComponent(String(e.bridgeId))),method:"GET",headers:{},query:{}},t);return new we(n)}))}consumeOAuthSessionBridge(e,t){return qi(this,void 0,void 0,(function*(){yield this.consumeOAuthSessionBridgeRaw(e,t)}))}deleteAccountRaw(e,t){return qi(this,void 0,void 0,(function*(){const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/delete-account",method:"POST",headers:n,query:{},body:(r=e.deleteAccountRequest,o=r,null==o?o:{password:o.password})},t);var o,r;return new we(i)}))}deleteAccount(){return qi(this,arguments,void 0,(function*(e={},t){yield this.deleteAccountRaw(e,t)}))}getSessionRaw(e){return qi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/session",method:"GET",headers:t,query:{}},e);return new we(n)}))}getSession(e){return qi(this,void 0,void 0,(function*(){yield this.getSessionRaw(e)}))}getUserMetadataRaw(e){return qi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/get-metadata",method:"GET",headers:t,query:{}},e);return new we(n)}))}getUserMetadata(e){return qi(this,void 0,void 0,(function*(){yield this.getUserMetadataRaw(e)}))}initiateOAuthRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.provider)throw new he("provider",'Required parameter "provider" was null or undefined when calling initiateOAuth().');const n={};null!=e.redirectTo&&(n.redirectTo=e.redirectTo),null!=e.role&&(n.role=e.role),null!=e.plan&&(n.plan=e.plan);const i=yield this.request({path:"/auth/oauth/{provider}".replace("{provider}",encodeURIComponent(String(e.provider))),method:"GET",headers:{},query:n},t);return new we(i)}))}initiateOAuth(e,t){return qi(this,void 0,void 0,(function*(){yield this.initiateOAuthRaw(e,t)}))}loginUserRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.loginUserRequest)throw new he("loginUserRequest",'Required parameter "loginUserRequest" was null or undefined when calling loginUser().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/login",method:"POST",headers:n,query:{},body:(r=e.loginUserRequest,o=r,null==o?o:{email:o.email,password:o.password})},t);var o,r;return new me(i,(e=>Un(e)))}))}loginUser(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.loginUserRaw(e,t);return yield n.value()}))}logoutUserRaw(e){return qi(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/auth/logout",method:"POST",headers:t,query:{}},e);return new we(n)}))}logoutUser(e){return qi(this,void 0,void 0,(function*(){yield this.logoutUserRaw(e)}))}refreshSessionRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.refreshSessionRequest)throw new he("refreshSessionRequest",'Required parameter "refreshSessionRequest" was null or undefined when calling refreshSession().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/refresh",method:"POST",headers:n,query:{},body:(r=e.refreshSessionRequest,o=r,null==o?o:{refresh_token:o.refresh_token})},t);var o,r;return new we(i)}))}refreshSession(e,t){return qi(this,void 0,void 0,(function*(){yield this.refreshSessionRaw(e,t)}))}resendConfirmationRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new he("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resendConfirmation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/resend-confirmation",method:"POST",headers:n,query:{},body:Dn(e.resetPasswordRequest)},t);return new we(i)}))}resendConfirmation(e,t){return qi(this,void 0,void 0,(function*(){yield this.resendConfirmationRaw(e,t)}))}resetPasswordRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new he("resetPasswordRequest",'Required parameter "resetPasswordRequest" was null or undefined when calling resetPassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/reset-password",method:"POST",headers:n,query:{},body:Dn(e.resetPasswordRequest)},t);return new we(i)}))}resetPassword(e,t){return qi(this,void 0,void 0,(function*(){yield this.resetPasswordRaw(e,t)}))}signupUserRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.signupUserRequest)throw new he("signupUserRequest",'Required parameter "signupUserRequest" was null or undefined when calling signupUser().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup",method:"POST",headers:n,query:{},body:(r=e.signupUserRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,inviteCode:o.inviteCode,name:o.name,returnTo:o.returnTo})},t);var o,r;return new we(i)}))}signupUser(e,t){return qi(this,void 0,void 0,(function*(){yield this.signupUserRaw(e,t)}))}signupWithInvitationRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.signupWithInvitationRequest)throw new he("signupWithInvitationRequest",'Required parameter "signupWithInvitationRequest" was null or undefined when calling signupWithInvitation().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/signup-with-invitation",method:"POST",headers:n,query:{},body:(r=e.signupWithInvitationRequest,o=r,null==o?o:{email:o.email,password:o.password,role:o.role,plan:o.plan,invitationId:o.invitationId,organizationId:o.organizationId})},t);var o,r;return new we(i)}))}signupWithInvitation(e,t){return qi(this,void 0,void 0,(function*(){yield this.signupWithInvitationRaw(e,t)}))}updateEmailRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new he("updateEmailRequest",'Required parameter "updateEmailRequest" was null or undefined when calling updateEmail().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-email",method:"POST",headers:n,query:{},body:Qn(e.updateEmailRequest)},t);return new we(i)}))}updateEmail(e,t){return qi(this,void 0,void 0,(function*(){yield this.updateEmailRaw(e,t)}))}updateNameRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.updateNameRequest)throw new he("updateNameRequest",'Required parameter "updateNameRequest" was null or undefined when calling updateName().');const n={"Content-Type":"application/json"},i=yield this.request({path:"/auth/update-name",method:"POST",headers:n,query:{},body:(r=e.updateNameRequest,o=r,null==o?o:{token:o.token,name:o.name})},t);var o,r;return new we(i)}))}updateName(e,t){return qi(this,void 0,void 0,(function*(){yield this.updateNameRaw(e,t)}))}updatePasswordRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.updatePasswordRequest)throw new he("updatePasswordRequest",'Required parameter "updatePasswordRequest" was null or undefined when calling updatePassword().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/auth/update-password",method:"POST",headers:n,query:{},body:(r=e.updatePasswordRequest,o=r,null==o?o:{token:o.token,email:o.email,password:o.password})},t);var o,r;return new we(i)}))}updatePassword(e,t){return qi(this,void 0,void 0,(function*(){yield this.updatePasswordRaw(e,t)}))}updateUserMetadataRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.updateUserMetadataRequest)throw new he("updateUserMetadataRequest",'Required parameter "updateUserMetadataRequest" was null or undefined when calling updateUserMetadata().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/auth/update-metadata",method:"POST",headers:n,query:{},body:(r=e.updateUserMetadataRequest,o=r,null==o?o:{metadata:o.metadata})},t);var o,r;return new we(i)}))}updateUserMetadata(e,t){return qi(this,void 0,void 0,(function*(){yield this.updateUserMetadataRaw(e,t)}))}validateInviteCodeRaw(e,t){return qi(this,void 0,void 0,(function*(){if(null==e.code)throw new he("code",'Required parameter "code" was null or undefined when calling validateInviteCode().');const n={};null!=e.code&&(n.code=e.code);const i=yield this.request({path:"/auth/invite-code",method:"GET",headers:{},query:n},t);return new me(i,(e=>ai(e)))}))}validateInviteCode(e,t){return qi(this,void 0,void 0,(function*(){const n=yield this.validateInviteCodeRaw(e,t);return yield n.value()}))}}var Ci="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Ei extends le{addAiAnswersKnowledgeDocumentRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeDocument().');if(null==e.addAiAnswersKnowledgeDocumentRequest)throw new he("addAiAnswersKnowledgeDocumentRequest",'Required parameter "addAiAnswersKnowledgeDocumentRequest" was null or undefined when calling addAiAnswersKnowledgeDocument().');const n={"Content-Type":"application/json"};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addAiAnswersKnowledgeDocumentRequest,o=r,null==o?o:{title:o.title,text:o.text})},t);var o,r;return new me(i,(e=>_e(e)))}))}addAiAnswersKnowledgeDocument(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}checkCompositionAccessRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling checkCompositionAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Xe(e)))}))}checkCompositionAccess(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.checkCompositionAccessRaw(e,t);return yield n.value()}))}createCompositionContentItemRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling createCompositionContentItem().');if(null==e.list)throw new he("list",'Required parameter "list" was null or undefined when calling createCompositionContentItem().');if(null==e.createCompositionContentItemRequest)throw new he("createCompositionContentItemRequest",'Required parameter "createCompositionContentItemRequest" was null or undefined when calling createCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))),method:"POST",headers:n,query:{},body:vt(e.createCompositionContentItemRequest)},t);return new me(i,(e=>ft(e)))}))}createCompositionContentItem(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.createCompositionContentItemRaw(e,t);return yield n.value()}))}createCompositionDatabaseRecordRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.body)throw new he("body",'Required parameter "body" was null or undefined when calling createCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"POST",headers:n,query:{},body:e.body},t);return new me(i,(e=>mt(e)))}))}createCompositionDatabaseRecord(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.createCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}createCompositionRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.newComposition)throw new he("newComposition",'Required parameter "newComposition" was null or undefined when calling createComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions",method:"POST",headers:n,query:{},body:(r=e.newComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,creatorId:o.creatorId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new me(i,(e=>gt(e)))}))}createComposition(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.createCompositionRaw(e,t);return yield n.value()}))}deleteCompositionContentItemRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteCompositionContentItem().');if(null==e.list)throw new he("list",'Required parameter "list" was null or undefined when calling deleteCompositionContentItem().');if(null==e.itemId)throw new he("itemId",'Required parameter "itemId" was null or undefined when calling deleteCompositionContentItem().');const n={};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>St(e)))}))}deleteCompositionContentItem(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionContentItemRaw(e,t);return yield n.value()}))}deleteCompositionDataSourceRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteCompositionDataSource().');const n={};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>function(e){return null==e?e:{removed:e.removed}}(e)))}))}deleteCompositionDataSource(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDataSourceRaw(e,t);return yield n.value()}))}deleteCompositionDatabaseRecordRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.recordId)throw new he("recordId",'Required parameter "recordId" was null or undefined when calling deleteCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>mt(e)))}))}deleteCompositionDatabaseRecord(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteComposition().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new we(i)}))}deleteComposition(e,t){return Ci(this,void 0,void 0,(function*(){yield this.deleteCompositionRaw(e,t)}))}describeCompositionEntriesRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling describeCompositionEntries().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/entries".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>tt(e)))}))}describeCompositionEntries(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.describeCompositionEntriesRaw(e,t);return yield n.value()}))}duplicateCompositionRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling duplicateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateCompositionRequest,o=r,null==o?o:{name:o.name,includeDatabase:o.includeDatabase})},t);var o,r;return new me(i,(e=>xt(e)))}))}duplicateComposition(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.duplicateCompositionRaw(e,t);return yield n.value()}))}getAiAnswersKnowledgeRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getAiAnswersKnowledge().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Ot(e)))}))}getAiAnswersKnowledge(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getAiAnswersKnowledgeRaw(e,t);return yield n.value()}))}getAllCompositionsRaw(e,t){return Ci(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.sort&&(n.sort=e.sort),null!=e.widgetId&&(n.widgetId=e.widgetId),null!=e.workspace&&(n.workspace=e.workspace),null!=e.projectFolder&&(n.projectFolder=e.projectFolder),null!=e.status&&(n.status=e.status),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions",method:"GET",headers:i,query:n},t);return new me(o,(e=>Gt(e)))}))}getAllCompositions(){return Ci(this,arguments,void 0,(function*(e={},t){const n=yield this.getAllCompositionsRaw(e,t);return yield n.value()}))}getCompositionByIdRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionById().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Ft(e)))}))}getCompositionById(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionByIdRaw(e,t);return yield n.value()}))}getCompositionContentSchemaRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionContentSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Ht(e)))}))}getCompositionContentSchema(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentSchemaRaw(e,t);return yield n.value()}))}getCompositionContentRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionContent().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i)}))}getCompositionContent(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentRaw(e,t);return yield n.value()}))}getCompositionDataSourceRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDataSource().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Je(e)))}))}getCompositionDataSource(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionDataSourceRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.recordId)throw new he("recordId",'Required parameter "recordId" was null or undefined when calling getCompositionDatabaseRecord().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>mt(e)))}))}getCompositionDatabaseRecord(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordsRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecords().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecords().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Yt(e)))}))}getCompositionDatabaseRecords(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordsRaw(e,t);return yield n.value()}))}getCompositionDesignSchemaRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDesignSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Zt(e)))}))}getCompositionDesignSchema(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignSchemaRaw(e,t);return yield n.value()}))}getCompositionDesignRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionDesign().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i)}))}getCompositionDesign(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignRaw(e,t);return yield n.value()}))}getCompositionEmbedSchemaRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSchema().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/schema/embed".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Jt(e)))}))}getCompositionEmbedSchema(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSettingsRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionEmbedSettings().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/embed-settings".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i)}))}getCompositionEmbedSettings(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}getCompositionPreviewRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionPreview().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/preview".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Qt(e)))}))}getCompositionPreview(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionPreviewRaw(e,t);return yield n.value()}))}getCompositionVersionsRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getCompositionVersions().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/versions".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>en(e)))}))}getCompositionVersions(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionVersionsRaw(e,t);return yield n.value()}))}getCompositionsBatchRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.getCompositionsBatchRequest)throw new he("getCompositionsBatchRequest",'Required parameter "getCompositionsBatchRequest" was null or undefined when calling getCompositionsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/batch",method:"POST",headers:n,query:{},body:(r=e.getCompositionsBatchRequest,o=r,null==o?o:{compositionIds:o.compositionIds})},t);var o,r;return new me(i,(e=>nn(e)))}))}getCompositionsBatch(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.getCompositionsBatchRaw(e,t);return yield n.value()}))}patchCompositionContentItemRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling patchCompositionContentItem().');if(null==e.list)throw new he("list",'Required parameter "list" was null or undefined when calling patchCompositionContentItem().');if(null==e.itemId)throw new he("itemId",'Required parameter "itemId" was null or undefined when calling patchCompositionContentItem().');if(null==e.requestBody)throw new he("requestBody",'Required parameter "requestBody" was null or undefined when calling patchCompositionContentItem().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/{list}/items/{itemId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{list}",encodeURIComponent(String(e.list))).replace("{itemId}",encodeURIComponent(String(e.itemId))),method:"PATCH",headers:n,query:{},body:e.requestBody},t);return new me(i,(e=>ft(e)))}))}patchCompositionContentItem(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.patchCompositionContentItemRaw(e,t);return yield n.value()}))}readCompositionEntriesRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling readCompositionEntries().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling readCompositionEntries().');const n={};null!=e.groupBy&&(n.groupBy=e.groupBy),null!=e.rows&&(n.rows=e.rows),null!=e.aggregate&&(n.aggregate=e.aggregate),null!=e.column&&(n.column=e.column),null!=e.since&&(n.since=e.since.toISOString()),null!=e.until&&(n.until=e.until.toISOString()),null!=e.context&&(n.context=e.context),null!=e.filter&&(n.filter=e.filter);const i={};if(null!=e.xManagedUserId&&(i["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(i["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/compositions/{id}/entries/{table}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return new me(o,(e=>rt(e)))}))}readCompositionEntries(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.readCompositionEntriesRaw(e,t);return yield n.value()}))}removeAiAnswersKnowledgeDocumentRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling removeAiAnswersKnowledgeDocument().');if(null==e.documentId)throw new he("documentId",'Required parameter "documentId" was null or undefined when calling removeAiAnswersKnowledgeDocument().');const n={};if(null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents/{documentId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{documentId}",encodeURIComponent(String(e.documentId))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>bn(e)))}))}removeAiAnswersKnowledgeDocument(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.removeAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}setCompositionDataSourceRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling setCompositionDataSource().');if(null==e.setCompositionDataSourceRequest)throw new he("setCompositionDataSourceRequest",'Required parameter "setCompositionDataSourceRequest" was null or undefined when calling setCompositionDataSource().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/data-source".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setCompositionDataSourceRequest,o=r,null==o?o:{url:o.url,refreshSeconds:o.refreshSeconds})},t);var o,r;return new me(i,(e=>Je(e)))}))}setCompositionDataSource(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.setCompositionDataSourceRaw(e,t);return yield n.value()}))}setDynamicContentRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling setDynamicContent().');if(null==e.setDynamicContentRequest)throw new he("setDynamicContentRequest",'Required parameter "setDynamicContentRequest" was null or undefined when calling setDynamicContent().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.setDynamicContentRequest,o=r,null==o?o:{content:o.content,validate:o.validate,partial:o.partial,version:o.version,source:o.source})},t);var o,r;return new me(i,(e=>Mn(e)))}))}setDynamicContent(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.setDynamicContentRaw(e,t);return yield n.value()}))}updateCompositionDatabaseRecordRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.table)throw new he("table",'Required parameter "table" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.recordId)throw new he("recordId",'Required parameter "recordId" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.body)throw new he("body",'Required parameter "body" was null or undefined when calling updateCompositionDatabaseRecord().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/database/{table}/{recordId}".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))).replace("{recordId}",encodeURIComponent(String(e.recordId))),method:"PUT",headers:n,query:{},body:e.body},t);return new me(i,(e=>mt(e)))}))}updateCompositionDatabaseRecord(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.updateCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}updateCompositionStatusRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateCompositionStatus().');if(null==e.updateCompositionStatusRequest)throw new he("updateCompositionStatusRequest",'Required parameter "updateCompositionStatusRequest" was null or undefined when calling updateCompositionStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateCompositionStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new me(i,(e=>Ze(e)))}))}updateCompositionStatus(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.updateCompositionStatusRaw(e,t);return yield n.value()}))}updateCompositionRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateComposition().');if(null==e.updateComposition)throw new he("updateComposition",'Required parameter "updateComposition" was null or undefined when calling updateComposition().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateComposition,o=r,null==o?o:{name:o.name,widgetId:o.widgetId,content:o.content,status:o.status,embedSettings:o.embedSettings,design:o.design,databaseSchema:o.databaseSchema,projectId:o.projectId})},t);var o,r;return new me(i,(e=>Ft(e)))}))}updateComposition(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.updateCompositionRaw(e,t);return yield n.value()}))}validateCompositionContentRaw(e,t){return Ci(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling validateCompositionContent().');if(null==e.requestBody)throw new he("requestBody",'Required parameter "requestBody" was null or undefined when calling validateCompositionContent().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),null!=e.xManagedUserId&&(n["X-Managed-User-Id"]=String(e.xManagedUserId)),null!=e.xManagedUserExternalId&&(n["X-Managed-User-External-Id"]=String(e.xManagedUserExternalId)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/compositions/{id}/content/validate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:e.requestBody},t);return new me(i,(e=>oi(e)))}))}validateCompositionContent(e,t){return Ci(this,void 0,void 0,(function*(){const n=yield this.validateCompositionContentRaw(e,t);return yield n.value()}))}}var Ui="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class bi extends le{exchangeTokenRaw(e,t){return Ui(this,void 0,void 0,(function*(){if(null==e.exchangeTokenRequest)throw new he("exchangeTokenRequest",'Required parameter "exchangeTokenRequest" was null or undefined when calling exchangeToken().');const n={"Content-Type":"application/json"};this.configuration&&this.configuration.apiKey&&(n.Authorization=yield this.configuration.apiKey("Authorization"));const i=yield this.request({path:"/tokens/exchange",method:"POST",headers:n,query:{},body:(r=e.exchangeTokenRequest,o=r,null==o?o:{scopes:o.scopes,expiresIn:o.expiresIn})},t);var o,r;return new me(i,(e=>Pt(e)))}))}exchangeToken(e,t){return Ui(this,void 0,void 0,(function*(){const n=yield this.exchangeTokenRaw(e,t);return yield n.value()}))}validateTokenRaw(e){return Ui(this,void 0,void 0,(function*(){const t={};if(this.configuration&&this.configuration.apiKey&&(t.Authorization=yield this.configuration.apiKey("Authorization")),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,n=yield e("BearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/tokens/validate",method:"GET",headers:t,query:{}},e);return new me(n,(e=>di(e)))}))}validateToken(e){return Ui(this,void 0,void 0,(function*(){const t=yield this.validateTokenRaw(e);return yield t.value()}))}}var _i="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class xi extends le{addLanguagesToTranslationRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling addLanguagesToTranslation().');if(null==e.addLanguagesToTranslationRequest)throw new he("addLanguagesToTranslationRequest",'Required parameter "addLanguagesToTranslationRequest" was null or undefined when calling addLanguagesToTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.addLanguagesToTranslationRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new me(i,(e=>Be(e)))}))}addLanguagesToTranslation(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.addLanguagesToTranslationRaw(e,t);return yield n.value()}))}createTranslationRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.createTranslationRequest)throw new he("createTranslationRequest",'Required parameter "createTranslationRequest" was null or undefined when calling createTranslation().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations",method:"POST",headers:n,query:{},body:(r=e.createTranslationRequest,o=r,null==o?o:{name:o.name,description:o.description,root_composition_id:o.root_composition_id,root_language:o.root_language,selected_languages:o.selected_languages})},t);var o,r;return new me(i,(e=>It(e)))}))}createTranslation(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.createTranslationRaw(e,t);return yield n.value()}))}deleteTranslationRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>Ct(e)))}))}deleteTranslation(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.deleteTranslationRaw(e,t);return yield n.value()}))}getLanguagePresetsRaw(e){return _i(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/language-presets",method:"GET",headers:{},query:{}},e);return new me(t,(e=>rn(e)))}))}getLanguagePresets(e){return _i(this,void 0,void 0,(function*(){const t=yield this.getLanguagePresetsRaw(e);return yield t.value()}))}getSupportedLanguagesRaw(e){return _i(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/supported-languages",method:"GET",headers:{},query:{}},e);return new me(t,(e=>dn(e)))}))}getSupportedLanguages(e){return _i(this,void 0,void 0,(function*(){const t=yield this.getSupportedLanguagesRaw(e);return yield t.value()}))}getTranslationRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>un(e)))}))}getTranslation(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.getTranslationRaw(e,t);return yield n.value()}))}getTranslationAnalyticsRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getTranslationAnalytics().');const n={};null!=e.period&&(n.period=e.period);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations/{id}/analytics".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:i,query:n},t);return new me(o,(e=>hn(e)))}))}getTranslationAnalytics(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.getTranslationAnalyticsRaw(e,t);return yield n.value()}))}getTranslationConfigRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getTranslationConfig().');const n=yield this.request({path:"/translations/{id}/config".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t);return new me(n,(e=>fn(e)))}))}getTranslationConfig(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.getTranslationConfigRaw(e,t);return yield n.value()}))}getTranslationsRaw(e,t){return _i(this,void 0,void 0,(function*(){const n={};null!=e.status&&(n.status=e.status);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/translations",method:"GET",headers:i,query:n},t);return new me(o,(e=>vn(e)))}))}getTranslations(){return _i(this,arguments,void 0,(function*(e={},t){const n=yield this.getTranslationsRaw(e,t);return yield n.value()}))}removeLanguageFromTranslationRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling removeLanguageFromTranslation().');if(null==e.languageCode)throw new he("languageCode",'Required parameter "languageCode" was null or undefined when calling removeLanguageFromTranslation().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/languages/{languageCode}".replace("{id}",encodeURIComponent(String(e.id))).replace("{languageCode}",encodeURIComponent(String(e.languageCode))),method:"DELETE",headers:n,query:{}},t);return new me(i,(e=>Be(e)))}))}removeLanguageFromTranslation(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.removeLanguageFromTranslationRaw(e,t);return yield n.value()}))}retranslateExperimentRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling retranslateExperiment().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/retranslate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.retranslateExperimentRequest,o=r,null==o?o:{languages:o.languages})},t);var o,r;return new me(i,(e=>Ct(e)))}))}retranslateExperiment(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.retranslateExperimentRaw(e,t);return yield n.value()}))}submitTranslationAnalyticsEventRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling submitTranslationAnalyticsEvent().');if(null==e.submitTranslationAnalyticsEventRequest)throw new he("submitTranslationAnalyticsEventRequest",'Required parameter "submitTranslationAnalyticsEventRequest" was null or undefined when calling submitTranslationAnalyticsEvent().');const n={"Content-Type":"application/json"};null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey));const i=yield this.request({path:"/translations/{id}/analytics/events".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.submitTranslationAnalyticsEventRequest,o=r,null==o?o:{eventType:o.eventType,language:o.language,compositionId:o.compositionId,metadata:o.metadata})},t);var o,r;return new we(i)}))}submitTranslationAnalyticsEvent(e,t){return _i(this,void 0,void 0,(function*(){yield this.submitTranslationAnalyticsEventRaw(e,t)}))}updateTranslationStatusRaw(e,t){return _i(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateTranslationStatus().');if(null==e.updateTranslationStatusRequest)throw new he("updateTranslationStatusRequest",'Required parameter "updateTranslationStatusRequest" was null or undefined when calling updateTranslationStatus().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("BearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/translations/{id}/status".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateTranslationStatusRequest,o=r,null==o?o:{status:o.status})},t);var o,r;return new me(i,(e=>Be(e)))}))}updateTranslationStatus(e,t){return _i(this,void 0,void 0,(function*(){const n=yield this.updateTranslationStatusRaw(e,t);return yield n.value()}))}}var Di="undefined"!=typeof window&&window.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{d(i.next(e))}catch(e){r(e)}}function s(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}d((i=i.apply(e,t||[])).next())}))};class Bi extends le{checkWidgetAccessRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling checkWidgetAccess().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/access".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>Fe(e)))}))}checkWidgetAccess(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.checkWidgetAccessRaw(e,t);return yield n.value()}))}createCompositionFromWidgetRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling createCompositionFromWidget().');if(null==e.createCompositionFromWidgetRequest)throw new he("createCompositionFromWidgetRequest",'Required parameter "createCompositionFromWidgetRequest" was null or undefined when calling createCompositionFromWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/composition".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.createCompositionFromWidgetRequest,o=r,null==o?o:{name:o.name,content:o.content,design:o.design,embedSettings:o.embedSettings,locale:o.locale,managedUserId:o.managedUserId})},t);var o,r;return new me(i,(e=>yt(e)))}))}createCompositionFromWidget(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.createCompositionFromWidgetRaw(e,t);return yield n.value()}))}createWidgetRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.newWidget)throw new he("newWidget",'Required parameter "newWidget" was null or undefined when calling createWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets",method:"POST",headers:n,query:{},body:(r=e.newWidget,o=r,null==o?o:{name:o.name,type:o.type,content:o.content,isPublic:o.isPublic,isDraft:o.isDraft,canvasId:o.canvasId,projectId:o.projectId,organizationId:o.organizationId,workspaceType:o.workspaceType,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new me(i,(e=>Tt(e)))}))}createWidget(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.createWidgetRaw(e,t);return yield n.value()}))}deleteWidgetRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling deleteWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:n,query:{},body:(r=e.deleteWidgetRequest,o=r,null==o?o:{reason:o.reason})},t);var o,r;return new we(i)}))}deleteWidget(e,t){return Di(this,void 0,void 0,(function*(){yield this.deleteWidgetRaw(e,t)}))}detachWidgetRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling detachWidget().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/detach".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{}},t);return new we(i)}))}detachWidget(e,t){return Di(this,void 0,void 0,(function*(){yield this.detachWidgetRaw(e,t)}))}duplicateWidgetRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling duplicateWidget().');const n={"Content-Type":"application/json"};if(null!=e.idempotencyKey&&(n["Idempotency-Key"]=String(e.idempotencyKey)),this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/duplicate".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.duplicateWidgetRequest,o=r,null==o?o:{name:o.name,canvas_id:o.canvas_id,managedUserId:o.managedUserId,managedUserExternalId:o.managedUserExternalId})},t);var o,r;return new me(i,(e=>Bt(e)))}))}duplicateWidget(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.duplicateWidgetRaw(e,t);return yield n.value()}))}getWidgetContentSchemaRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getWidgetContentSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/content".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i)}))}getWidgetContentSchema(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getWidgetContentSchemaRaw(e,t);return yield n.value()}))}getWidgetDesignSchemaRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling getWidgetDesignSchema().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/schema/design".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new me(i)}))}getWidgetDesignSchema(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getWidgetDesignSchemaRaw(e,t);return yield n.value()}))}getWidgetPublishHistoryRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new he("widgetId",'Required parameter "widgetId" was null or undefined when calling getWidgetPublishHistory().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history".replace("{widgetId}",encodeURIComponent(String(e.widgetId))),method:"GET",headers:n,query:{}},t);return new me(i,(e=>yn(e)))}))}getWidgetPublishHistory(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getWidgetPublishHistoryRaw(e,t);return yield n.value()}))}getWidgetsBatchRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.getWidgetsBatchRequest)throw new he("getWidgetsBatchRequest",'Required parameter "getWidgetsBatchRequest" was null or undefined when calling getWidgetsBatch().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/batch",method:"POST",headers:n,query:{},body:(r=e.getWidgetsBatchRequest,o=r,null==o?o:{widgetIds:o.widgetIds})},t);var o,r;return new me(i,(e=>Tn(e)))}))}getWidgetsBatch(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.getWidgetsBatchRaw(e,t);return yield n.value()}))}getWidgetsRaw(e,t){return Di(this,void 0,void 0,(function*(){const n={};null!=e.page&&(n.page=e.page),null!=e.size&&(n.size=e.size),null!=e.canvasId&&(n.canvasId=e.canvasId),null!=e.managedUserId&&(n.managedUserId=e.managedUserId),null!=e.managedUserExternalId&&(n.managedUserExternalId=e.managedUserExternalId);const i={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/widgets",method:"GET",headers:i,query:n},t);return new me(o,(e=>Rn(e)))}))}getWidgets(){return Di(this,arguments,void 0,(function*(e={},t){const n=yield this.getWidgetsRaw(e,t);return yield n.value()}))}renameWidgetPublishHistoryTitleRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new he("widgetId",'Required parameter "widgetId" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.version)throw new he("version",'Required parameter "version" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.renameWidgetPublishHistoryTitleRequest)throw new he("renameWidgetPublishHistoryTitleRequest",'Required parameter "renameWidgetPublishHistoryTitleRequest" was null or undefined when calling renameWidgetPublishHistoryTitle().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/title".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"PATCH",headers:n,query:{},body:(r=e.renameWidgetPublishHistoryTitleRequest,o=r,null==o?o:{commitTitle:o.commitTitle})},t);var o,r;return new me(i,(e=>xn(e)))}))}renameWidgetPublishHistoryTitle(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.renameWidgetPublishHistoryTitleRaw(e,t);return yield n.value()}))}setWidgetPublishHistoryLiveRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new he("widgetId",'Required parameter "widgetId" was null or undefined when calling setWidgetPublishHistoryLive().');if(null==e.version)throw new he("version",'Required parameter "version" was null or undefined when calling setWidgetPublishHistoryLive().');const n={};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("bearerAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{widgetId}/publish-history/{version}/set-live".replace("{widgetId}",encodeURIComponent(String(e.widgetId))).replace("{version}",encodeURIComponent(String(e.version))),method:"POST",headers:n,query:{}},t);return new me(i,(e=>Wn(e)))}))}setWidgetPublishHistoryLive(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.setWidgetPublishHistoryLiveRaw(e,t);return yield n.value()}))}updateWidgetRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateWidget().');if(null==e.updateWidgetRequest)throw new he("updateWidgetRequest",'Required parameter "updateWidgetRequest" was null or undefined when calling updateWidget().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:n,query:{},body:(r=e.updateWidgetRequest,o=r,null==o?o:{name:o.name,description:o.description,canvasId:o.canvasId,projectId:o.projectId,projectFolder:o.projectFolder})},t);var o,r;return new we(i)}))}updateWidget(e,t){return Di(this,void 0,void 0,(function*(){yield this.updateWidgetRaw(e,t)}))}updateWidgetRepositoryRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling updateWidgetRepository().');if(null==e.updateWidgetRepositoryRequest)throw new he("updateWidgetRepositoryRequest",'Required parameter "updateWidgetRepositoryRequest" was null or undefined when calling updateWidgetRepository().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/repository".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.updateWidgetRepositoryRequest,o=r,null==o?o:{repositoryId:o.repositoryId})},t);var o,r;return new me(i,(e=>ti(e)))}))}updateWidgetRepository(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.updateWidgetRepositoryRaw(e,t);return yield n.value()}))}uploadWidgetThumbnailRaw(e,t){return Di(this,void 0,void 0,(function*(){if(null==e.id)throw new he("id",'Required parameter "id" was null or undefined when calling uploadWidgetThumbnail().');if(null==e.uploadWidgetThumbnailRequest)throw new he("uploadWidgetThumbnailRequest",'Required parameter "uploadWidgetThumbnailRequest" was null or undefined when calling uploadWidgetThumbnail().');const n={"Content-Type":"application/json"};if(this.configuration&&this.configuration.accessToken){const e=this.configuration.accessToken,t=yield e("apiKeyAuth",[]);t&&(n.Authorization=`Bearer ${t}`)}const i=yield this.request({path:"/widgets/{id}/thumbnail".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:(r=e.uploadWidgetThumbnailRequest,o=r,null==o?o:{imageDataUrl:o.imageDataUrl})},t);var o,r;return new me(i,(e=>ii(e)))}))}uploadWidgetThumbnail(e,t){return Di(this,void 0,void 0,(function*(){const n=yield this.uploadWidgetThumbnailRaw(e,t);return yield n.value()}))}}class Mi extends Error{constructor(e,t,n){super(e),this.code=t,this.statusCode=n,this.name="AuthError"}}class Pi{constructor(e={}){var t,n;this.currentToken=null,this.apiKey=null,this.refreshTimer=null,this.config=Object.assign({apiUrl:e.apiUrl||K(),debug:e.debug||!1},e),this.apiKey=e.apiKey||"undefined"!=typeof process&&((null===(t={NODE_ENV:"production"})||void 0===t?void 0:t.PUBLIC_API_KEY)||(null===(n={NODE_ENV:"production"})||void 0===n?void 0:n.API_KEY))||null}createTokensApiForApiKey(t){const n=new de({basePath:this.config.apiUrl,apiKey:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${P}`}});return new bi(n)}createTokensApiForAccessToken(t){const n=new de({basePath:this.config.apiUrl,accessToken:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${P}`}});return new bi(n)}setApiKey(e){this.apiKey=e,this.currentToken={token:e,tokenType:"API-Key",expiresAt:null,scopes:[]},this.config.debug&&ee.debug("AuthManager: API key set")}getValidToken(t){return e(this,void 0,void 0,(function*(){if(this.currentToken&&this.isTokenValid(this.currentToken)){if(Pi.validatedTokens.has(this.currentToken.token))return this.currentToken.token;if(yield this.validateToken())return this.currentToken.token}if(this.apiKey)return yield this.exchangeApiKeyForJWT(t),this.currentToken.token;throw new Mi("No authentication method available","NO_AUTH_METHOD")}))}exchangeApiKeyForJWT(t){return e(this,void 0,void 0,(function*(){var e;if(!this.apiKey)throw new Mi("No API key available for exchange","NO_API_KEY");const n={scopes:(null==t?void 0:t.scopes)||this.getDefaultScopes(),expiresIn:(null==t?void 0:t.expiresIn)||1800};try{const t=this.createTokensApiForApiKey(this.apiKey),i=yield t.exchangeToken({exchangeTokenRequest:n}),o=(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.token)||(null==i?void 0:i.token);if(!o)throw new Mi("Token exchange response missing token","INVALID_RESPONSE");const r=(null==i?void 0:i.data)||i,a={token:o,tokenType:r.tokenType||"Bearer",expiresAt:r.expiresAt?r.expiresAt instanceof Date?r.expiresAt.toISOString():String(r.expiresAt):null,scopes:r.scopes||[]};return this.setToken(a),this.config.debug&&ee.info("AuthManager: Token exchanged successfully",{scopes:a.scopes,expiresAt:a.expiresAt}),a}catch(e){const t=e instanceof Mi?e:new Mi(`Token exchange failed: ${e instanceof Error?e.message:String(e)}`,"TOKEN_EXCHANGE_ERROR");throw this.config.onAuthError&&this.config.onAuthError(t),t}}))}validateToken(){return e(this,void 0,void 0,(function*(){var e;if(!this.currentToken)return!1;if(Pi.validatedTokens.has(this.currentToken.token))return!0;try{const t=this.createTokensApiForAccessToken(this.currentToken.token),n=yield t.validateToken();return!0===(null==n?void 0:n.success)&&!0===(null===(e=n.data)||void 0===e?void 0:e.valid)||!0===(null==n?void 0:n.valid)?(Pi.validatedTokens.add(this.currentToken.token),!0):(this.clearToken(),!1)}catch(e){return this.config.debug&&ee.warn("AuthManager: Token validation failed",e),!1}}))}setToken(e){this.currentToken=e,e.expiresAt&&this.scheduleTokenRefresh(e),this.config.onTokenRefreshed&&this.config.onTokenRefreshed(e.token)}clearToken(){this.currentToken&&Pi.validatedTokens.delete(this.currentToken.token),this.currentToken=null,this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}isTokenValid(e){if(!e.expiresAt)return!0;const t=new Date(e.expiresAt).getTime();return Date.now()<t-6e4}scheduleTokenRefresh(t){if(!t.expiresAt||!this.apiKey)return;const n=new Date(t.expiresAt).getTime()-Date.now()-3e5;n>0&&(this.refreshTimer=setTimeout((()=>e(this,void 0,void 0,(function*(){try{yield this.exchangeApiKeyForJWT({scopes:t.scopes}),this.config.debug&&ee.info("AuthManager: Token refreshed automatically")}catch(e){this.config.debug&&ee.error("AuthManager: Automatic token refresh failed",e),this.config.onTokenExpired&&this.config.onTokenExpired()}}))),n))}getDefaultScopes(){return["compositions:read","widgets:read","projects:read"]}getCurrentTokenInfo(){return this.currentToken}hasAuthMethod(){return!(!this.apiKey&&!this.currentToken)}dispose(){this.clearToken(),this.apiKey=null,this.config.debug&&ee.debug("AuthManager: Disposed")}}Pi.validatedTokens=new Set;const Ki=M,Wi={};let Oi=null,zi=null;const Gi={API_URL:W.PROD_API_URL,API_VERSION:W.VERSION,CLIENT_URL:W.PROD_CLIENT_URL,PRODUCTION_URL:W.PROD_CDN_URL,NODE_ENV:"production",ENABLE_EDITING:W.ENABLE_EDITING,API_KEY:Wi.PUBLIC_API_KEY,AXIOM_API_KEY:Wi.PUBLIC_AXIOM_API_KEY,STATSIG_KEY:Wi.PUBLIC_STATSIG_KEY};function Li(e){Oi=e}function $i(){return Oi}function ji(){return zi||(zi=new Pi({apiUrl:Fi(),debug:to.enabled})),zi}function Ni(e){ji().setApiKey(e)}function Vi(){return e(this,void 0,void 0,(function*(){if(zi&&zi.hasAuthMethod())try{return yield zi.getValidToken()}catch(e){}if(Oi)return yield Oi.getToken();const e=Gi.API_KEY;if(!e)throw new Error("No authentication method available. Please configure an API key, TokenProvider, or set PUBLIC_API_KEY in environment variables.");return e}))}function Xi(e){const t=(null==e?void 0:e.tokenProvider)||Oi;if(!t){const t=(null==e?void 0:e.apiKey)||Gi.API_KEY;return{apiKey:t,basePath:(null==e?void 0:e.basePath)||Fi(),tokenProvider:t?new oe(t):void 0}}return{basePath:(null==e?void 0:e.basePath)||Fi(),tokenProvider:t}}function Fi(){return Gi.API_URL}function Hi(){return Gi.PRODUCTION_URL}function Yi(){return`${Fi()}${Gi.API_VERSION}`}const Zi={isProduction:"production"===Gi.NODE_ENV,apiUrl:Fi(),apiKey:Gi.API_KEY},Ji={renderMode:O,displayMode:z,resize:G,width:L,height:$,autoscale:j},Qi={customElements:N.CUSTOM_ELEMENTS,http3:N.HTTP3,resizeObserver:N.RESIZE_OBSERVER},eo={batchSize:V,loadTimeout:X,retryAttempts:F},to={enabled:D,logLevel:B},no={AXIOM_API_KEY:Gi.AXIOM_API_KEY||"",AXIOM_DATASET:n,AXIOM_API_ENDPOINT:t,STATSIG_API_KEY:Gi.STATSIG_KEY||"",STATSIG_API_ENDPOINT:i,ENABLE_PERFORMANCE_TRACKING:o,PERFORMANCE_SAMPLE_RATE:r,PERFORMANCE_REPORTING_ENDPOINT:s,LCP_THRESHOLD:d,LCP_WARNING_THRESHOLD:u,FID_THRESHOLD:l,FID_WARNING_THRESHOLD:c,CLS_THRESHOLD:p,CLS_WARNING_THRESHOLD:h,FCP_THRESHOLD:g,FCP_WARNING_THRESHOLD:f,TTFB_THRESHOLD:v,TTFB_WARNING_THRESHOLD:m,WIDGET_LOAD_THRESHOLD:w,WIDGET_LOAD_WARNING_THRESHOLD:y,BUNDLE_SIZE_THRESHOLD:I,BUNDLE_SIZE_WARNING_THRESHOLD:R,MAX_METRICS_BUFFER:a},io={ROOT_MARGIN:T,THRESHOLD:k,MAX_CONCURRENT:A,RETRY_ATTEMPTS:q,RETRY_DELAY:S},oo={MAX_PRELOAD_REQUESTS:C,PREFETCH_TIMEOUT:E,CACHE_DURATION:U,MAX_CONCURRENT_REQUESTS:b,DNS_PREFETCH_ENABLED:_,PRECONNECT_ENABLED:x},ro={DEBUG:D,LOG_LEVEL:B,VERSION:M};function ao(){return Xi()}var so=Object.freeze({__proto__:null,BROWSER_FEATURES:Qi,DEBUG:to,DEFAULT_WIDGET_CONFIG:Ji,LAZY_LOADING_CONFIG:io,PERFORMANCE:eo,PERFORMANCE_CONFIG:no,RESOURCE_CONFIG:oo,SDK_CONFIG:ro,VERSION:Ki,config:Gi,createSdkConfig:Xi,environment:Zi,getApiUrl:Fi,getAuthManager:ji,getAuthToken:Vi,getCdnUrl:Hi,getConfiguration:ao,getTokenProvider:$i,getVersionedApiUrl:Yi,setApiKey:Ni,setTokenProvider:Li});const uo="widgetic_session_id",lo=new Map;let co=null;function po(e){var t;try{const t=localStorage.getItem(e);if(null!==t)return t}catch(e){}return null!==(t=lo.get(e))&&void 0!==t?t:null}function ho(e,t){lo.set(e,t);try{localStorage.setItem(e,t)}catch(t){Q.debug("localStorage is not available; keeping the A/B test state in memory",{key:e,error:t})}}function go(e){lo.delete(e);try{localStorage.removeItem(e)}catch(t){Q.debug("localStorage is not available; the value was only forgotten in memory",{key:e,error:t})}}function fo(){const e=po(uo);return e||(co||(co=function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return`visitor_${crypto.randomUUID()}`}catch(e){}return`visitor_${Math.random().toString(36).slice(2,12)}_${Date.now().toString(36)}`}()),ho(uo,co),co)}function vo(e,t){return function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}(`${t}:${e}`)%1e4/100}function mo(e,t,n){if(!e||0===e.length)return null;const i=vo(t,n);let o=0;for(const t of e)if(o+=Number(t.trafficPercentage)||0,i<o)return t;return e[e.length-1]}function wo(e,t){if(!e||!t)return!1;try{return null!==e.closest(t)}catch(e){return Q.warn("The goal target is not a selector this browser understands",{goalTarget:t,error:e}),!1}}export{Pi as A,mo as B,de as C,Ji as D,ne as E,ie as F,so as G,no as P,te as S,xi as T,Ki as V,Bi as W,Yi as a,Ei as b,Hi as c,Gi as d,Q as e,to as f,Vi as g,ao as h,Ni as i,oe as j,$i as k,ee as l,Fi as m,W as n,Si as o,Xi as p,go as q,po as r,Li as s,wo as t,Ai as u,Mi as v,ho as w,ji as x,Ti as y,fo as z};
|