@widgetic/embed-sdk 2.1.9 → 2.1.10
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/dist/browser/chunks/core.js +1 -1
- package/dist/browser/chunks/workflows.js +1 -1
- package/dist/esm/chunks/core.js +1 -1
- package/dist/esm/chunks/workflows.js +1 -1
- package/dist/esm/types/core/constants.d.ts +1 -1
- package/dist/esm/types/core/version.d.ts +1 -1
- package/dist/esm/types/workflows/workflow-entry.d.ts +12 -0
- package/dist/umd/embed-bootstrap.js +1 -1
- package/dist/umd/embed-sdk-workflows.js +1 -1
- package/dist/umd/embed-sdk.js +1 -1
- package/package.json +1 -1
package/dist/esm/chunks/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./vendor.js";const t="2.1.9",n="https://api.axiom.co/v1",i="widgetic-performance",o="https://events.statsigapi.net/v1/custom",r=!0,a=1,s=1e3,d="",u=2500,l=2e3,c=100,h=50,p=.1,g=.05,f=1800,m=1200,v=800,w=600,y=3e3,I=2e3,R=5e5,T=3e5,A="50px",k=.1,C=3,S=3,q=1e3,E=10,U=5e3,b=36e5,x=6,_=!0,D=!0,B=!1,M="info",K=t,P=t;function W(){var e;return`${"undefined"!=typeof process&&"development"===(null===(e={NODE_ENV:"production"})||void 0===e?void 0:e.NODE_ENV)?O.DEV_API_URL:O.PROD_API_URL}${O.VERSION}`}const O={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},z="auto",L="inline",$="fixed",j=350,G=200,N=!1,V={CUSTOM_ELEMENTS:"undefined"!=typeof customElements,HTTP3:!1,RESIZE_OBSERVER:"undefined"!=typeof ResizeObserver},X=10,F=5e3,H=3;let Y=B;const J={get enabled(){return Y},logLevel:M},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 Q(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(Q);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]=Q(i)}return t}return e}const ee=new class{constructor(e=J.logLevel){this.logLevels={debug:0,info:1,warn:2,error:3},this.currentLevel=this.logLevels[e]}shouldLog(e){return J.enabled&&this.logLevels[e]>=this.currentLevel}formatMessage(e,t,...n){const i=(new Date).toISOString();return[`${`[Widgetic SDK] [${e.toUpperCase()}] [${i}]`} ${t}`,...n.map(Q)]}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){Y=e}(e)}},te={debug:(e,...t)=>ee.debug(e,...t),info:(e,...t)=>ee.info(e,...t),warn:(e,...t)=>ee.warn(e,...t),error:(e,...t)=>ee.error(e,...t),setLevel:e=>ee.setLevel(e)};class ne{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 ie{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 oe{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 re{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 ae="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 se="https://api.widgetic.com/v1".replace(/\/+$/,""),de="X-SDK-Version";class ue{constructor(e){if(this.configuration={basePath:se,headers:{},middleware:[]},"string"==typeof e){const t=(null==e?void 0:e.startsWith("Bearer "))?e.slice(7):e;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${t}`:t})),this.configuration.accessToken=()=>ae(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||se});if("string"==typeof e.accessToken&&e.accessToken){const t=e.accessToken,n=t.startsWith("Bearer ")?t.slice(7):t;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${n}`:n})),this.configuration.accessToken=()=>ae(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:se}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||fe}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:()=>ae(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const le=new ue;class ce{constructor(e=le){this.configuration=e,this.fetchApi=(e,t)=>ae(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 ue)||(e=new ue(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&&ce.jsonRegex.test(e)}request(e,t){return ae(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 he(s,u,l)}))}createFetchParams(e,t){return ae(this,void 0,void 0,(function*(){let n=(this.configuration.basePath||se).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()===de.toLowerCase()))||(i[de]="@widgetic/api-sdk/2.0.4");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:()=>ae(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}}ce.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class he 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 ge extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function fe(e,t=""){return Object.keys(e).map((n=>me(n,e[n],t))).filter((e=>e.length>0)).join("&")}function me(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 me(e,Array.from(t),n)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?fe(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 we{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 ae(this,void 0,void 0,(function*(){const e=yield this.raw.json();return this.transformer(this.unwrapSuccessEnvelope(e))}))}}class ye{constructor(e){this.raw=e}value(){return ae(this,void 0,void 0,(function*(){}))}}class Ie{constructor(e){this.raw=e}value(){return ae(this,void 0,void 0,(function*(){return yield this.raw.text()}))}}function Re(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 Te(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 Ae(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 ke(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(Ae)}}(e)}function Ce(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 Se(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 Ee(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 Ue(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:Ee(e.sampleRatioMismatch),confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel}}(e)}function be(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 xe(e){return function(e){if(null==e)return e;return{overall:null==e.overall?void 0:Ue(e.overall),variants:null==e.variants?void 0:e.variants.map(be),recommendation:null==e.recommendation?void 0:qe(e.recommendation)}}(e)}function _e(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),origin:null==e.origin?void 0:e.origin,syncStatus:null==e.syncStatus?void 0:e.syncStatus,lastSyncedAt:null==e.lastSyncedAt?void 0:new Date(e.lastSyncedAt),variants:null==e.variants?void 0:e.variants.map(_e)}}(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{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 Ke(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(Me),totals:Ke(e.totals)}}(e)}function We(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 Oe(e){return function(e){if(null==e)return e;return{removed:e.removed}}(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),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 Le(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 $e(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 je(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 Ge(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 Ne(e){return function(e){if(null==e)return e;return{summary:Le(e.summary),devices:e.devices.map($e),geography:e.geography.map(ze),referrers:e.referrers.map(Ge),events:null==e.events?void 0:e.events.map(je)}}(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{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{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 He(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Fe(e.data)}}(e)}function Ye(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}}(e)}function Je(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,lastEditedBy:null==e.lastEditedBy?void 0:Ye(e.lastEditedBy),lastEditedAt:null==e.lastEditedAt?void 0:new Date(e.lastEditedAt)}}(e)}function Ze(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{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data}}(e)}function et(e){return function(e){if(null==e)return e;return{name:e.name,type:e.type}}(e)}function tt(e){return function(e){if(null==e)return e;return{name:e.name,columns:e.columns.map(et),rows:e.rows}}(e)}function nt(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,hasData:e.hasData,tables:e.tables.map(tt)}}(e)}function it(e){return function(e){if(null==e)return e;return{value:e.value,count:e.count}}(e)}function ot(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 rt(e){return function(e){if(null==e)return e;return{column:e.column,tallies:e.tallies.map(ot),truncated:null==e.truncated?void 0:e.truncated}}(e)}function at(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(it),moreGroups:e.moreGroups,columns:e.columns,rows:null==e.rows?null:e.rows,moreRows:e.moreRows,aggregates:null==e.aggregates?void 0:rt(e.aggregates)}}(e)}function st(e){return function(e){if(null==e)return e;return{deleted:e.deleted}}(e)}function dt(e){return function(e){if(null==e)return e;return{success:e.success,data:st(e.data)}}(e)}function ut(e){return function(e){if(null==e)return e;return{id:e.id,values:e.values,context:e.context,createdAt:null==e.createdAt?null:new Date(e.createdAt),truncatedColumns:null==e.truncatedColumns?void 0:e.truncatedColumns}}(e)}function lt(e){return function(e){if(null==e)return e;return{nextCursor:e.nextCursor,total:e.total,paging:null==e.paging?void 0:e.paging}}(e)}function ct(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data.map(ut),meta:lt(e.meta)}}(e)}function ht(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 pt(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 gt(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 ft(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:gt(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 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:ft(e.data)}}(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:Ce(e.data)}}(e)}function wt(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 yt(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(wt),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 It(e){return function(e){if(null==e)return e;return{events:null==e.events?void 0:e.events.map(je),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 Rt(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 Tt(e){return function(e){if(null==e)return e;return{events:e.events.map(Rt)}}(e,!1)}function At(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(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:Je(e.data),meta:null==e.meta?void 0:At(e.meta)}}(e)}function Ct(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{position:e.position})}(e,!1)}function St(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}function qt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Je(e.data),meta:null==e.meta?void 0:St(e.meta)}}(e)}function Et(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 Ut(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 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:Ut(e.data),meta:null==e.meta?void 0:e.meta}}(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:Te(e.data)}}(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:ke(e.data)}}(e)}function Dt(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 Bt(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 Mt(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 Kt(e){return function(e){if(null==e)return e;return{removed:e.removed}}(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:Kt(e.data)}}(e)}function Wt(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 Ot(e){return function(e){if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId}}(e)}function zt(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ot(e.data)}}(e)}function Lt(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 $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:Lt(e.data),warnings:null==e.warnings?void 0:e.warnings}}(e)}function jt(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 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:jt(e.data)}}(e)}function Nt(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 Vt(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(Nt),success_metrics:null==e.success_metrics?void 0:e.success_metrics,primary_metric:null==e.primary_metric?void 0:e.primary_metric}}(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:Pe(e.data)}}(e)}function Ft(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 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:e.data.map(Je),meta:null==e.meta?void 0:Ft(e.meta)}}(e)}function Yt(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 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:e.data.map(Yt)}}(e)}function Zt(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 Qt(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 en(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(Qt),targets:null==e.targets?void 0:e.targets.map(Zt)}}(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.data.map(je)}}(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:Je(e.data)}}(e)}function rn(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 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:e.data.map(Dt)}}(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:e.data}}(e)}function dn(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 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.map($e)}}(e)}function ln(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 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(ze)}}(e)}function hn(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 pn(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(hn)}}(e)}function gn(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 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(Ge)}}(e)}function mn(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(ht)}}(e)}function vn(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)}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:e.data.map(vn)}}(e)}function yn(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 In(e){return function(e){if(null==e)return e;return{compositions:null==e.compositions?void 0:e.compositions.map(Je),errors:null==e.errors?void 0:e.errors.map(yn)}}(e)}function Rn(e){return function(e){if(null==e)return e;return{presets:null==e.presets?void 0:e.presets}}(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:Rn(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:e.data}}(e)}function kn(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 Cn(e){return function(e){if(null==e)return e;return{languages:null==e.languages?void 0:ve(e.languages,kn),preselected:null==e.preselected?void 0:e.preselected}}(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:Cn(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:De(e.data)}}(e)}function En(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 Un(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 bn(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(En),topPerformingLanguages:null==e.topPerformingLanguages?void 0:e.topPerformingLanguages.map(Un),completionStatus:null==e.completionStatus?void 0:e.completionStatus}}(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:bn(e.data)}}(e)}function _n(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 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:_n(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: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 Kn(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 Pn(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(Kn)}}(e)}function Wn(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 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:e.data.map(Lt),meta:null==e.meta?void 0:Wn(e.meta)}}(e)}function zn(e){return function(e){if(null==e)return e;return{widgets:null==e.widgets?void 0:e.widgets.map(Lt),errors:null==e.errors?void 0:e.errors.map(yn)}}(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:Re(e.data)}}(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:Se(e.data)}}(e)}function jn(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 Gn(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 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.data.map(ke),meta:null==e.meta?void 0:Gn(e.meta)}}(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:Oe(e.data)}}(e)}function Xn(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 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)}}(e)}function Hn(e){return function(e){if(null==e)return e;return{email:e.email}}(e,!1)}function Yn(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 Jn(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:Yn(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent}}(e)}function Zn(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 Qn(e){return function(e){if(null==e)return e;return{data:null==e.data?void 0:Zn(e.data),message:null==e.message?void 0:e.message,warnings:null==e.warnings?void 0:e.warnings}}(e)}function ei(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Qn(e.data)}}(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:ke(e.data),message:null==e.message?void 0:e.message}}(e)}function ni(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),message:null==e.message?void 0:e.message}}(e)}function ii(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 oi(e){return function(e){if(null==e)return e;return{pagination:null==e.pagination?void 0:ii(e.pagination)}}(e)}function ri(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data,meta:null==e.meta?void 0:oi(e.meta)}}(e)}function ai(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 si(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 di(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:si(e.data)}}(e,!1)}function ui(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 li(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 ci(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:li(e.data)}}(e,!1)}function hi(e){return function(e){if(null==e)return e;return{events:e.events.map(ci)}}(e,!1)}function pi(e){return function(e){if(null==e)return e;return{id:e.id,goalTarget:e.goalTarget}}(e,!1)}function gi(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(pi),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 fi(e){return function(e){if(null==e)return e;return{token:e.token,email:e.email}}(e,!1)}function mi(e){return function(e){if(null==e)return e;return{repositoryId:null==e.repositoryId?void 0:e.repositoryId}}(e)}function vi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:mi(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function wi(e){return function(e){if(null==e)return e;return{thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl}}(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{valid:e.valid,errors:null==e.errors?void 0:e.errors.map(pt),warnings:null==e.warnings?void 0:e.warnings.map(pt),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 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:Ri(e.data)}}(e)}function Ai(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 ki(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ai(e.data)}}(e)}function Ci(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 Si(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 qi(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(Si),warnings:null==e.warnings?void 0:e.warnings.map(Ci)}}(e)}function Ei(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:qi(e.data)}}(e)}function Ui(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 bi(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(Ui),recommendations:null==e.recommendations?void 0:e.recommendations}}(e)}function xi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:bi(e.data)}}(e)}function _i(e){return function(e){if(null==e)return e;return{composition_id:e.composition_id,name:e.name}}(e,!1)}function Di(e){return function(e){if(null==e)return e;return{variants:e.variants.map(_i),success_metrics:e.success_metrics}}(e,!1)}function Bi(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(Si),warnings:null==e.warnings?void 0:e.warnings.map(Ci)}}(e)}function Mi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Bi(e.data)}}(e)}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 Pi extends ce{assignVariantRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling assignVariant().');if(null==e.assignVariantRequest)throw new ge("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 we(i,(e=>Ae(e)))}))}assignVariant(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.assignVariantRaw(e,t);return yield n.value()}))}checkWorkspaceABTestAutoStopRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling checkWorkspaceABTestAutoStop().');if(null==e.testId)throw new ge("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 we(i,(e=>He(e)))}))}checkWorkspaceABTestAutoStop(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.checkWorkspaceABTestAutoStopRaw(e,t);return yield n.value()}))}createABTestAssignmentRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.createABTestAssignmentRequest)throw new ge("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 we(i,(e=>vt(e)))}))}createABTestAssignment(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.createABTestAssignmentRaw(e,t);return yield n.value()}))}createWorkspaceABConversionWebhookRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>xt(e)))}))}createWorkspaceABConversionWebhook(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}createWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABTest().');if(null==e.createABTestRequest)throw new ge("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:yt(e.createABTestRequest)},t);return new we(i,(e=>_t(e)))}))}createWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABTestRaw(e,t);return yield n.value()}))}deleteWorkspaceABConversionWebhookRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>Pt(e)))}))}deleteWorkspaceABConversionWebhook(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}deleteWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>Wt(e)))}))}deleteWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABTestRaw(e,t);return yield n.value()}))}getABTestConfigRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(n,(e=>Vt(e)))}))}getABTestConfig(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getABTestConfigRaw(e,t);return yield n.value()}))}getAvailableMetricsRaw(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("apiKeyAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/metrics/available",method:"GET",headers:t,query:{}},e);return new we(n,(e=>Jt(e)))}))}getAvailableMetrics(e){return Ki(this,void 0,void 0,(function*(){const t=yield this.getAvailableMetricsRaw(e);return yield t.value()}))}getCompositionABGoalTargetsRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getCompositionABGoalTargets().');if(null==e.id)throw new ge("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 we(o,(e=>tn(e)))}))}getCompositionABGoalTargets(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getCompositionABGoalTargetsRaw(e,t);return yield n.value()}))}getVariantConfigRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(n,(e=>Mn(e)))}))}getVariantConfig(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getVariantConfigRaw(e,t);return yield n.value()}))}getWorkspaceABConversionWebhookRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>Ln(e)))}))}getWorkspaceABConversionWebhook(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}getWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>_t(e)))}))}getWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestRaw(e,t);return yield n.value()}))}getWorkspaceABTestDiagnosisRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestDiagnosis().');if(null==e.testId)throw new ge("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 we(i,(e=>$n(e)))}))}getWorkspaceABTestDiagnosis(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestDiagnosisRaw(e,t);return yield n.value()}))}getWorkspaceABTestStatisticsRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestStatistics().');if(null==e.testId)throw new ge("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 we(i,(e=>jn(e)))}))}getWorkspaceABTestStatistics(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestStatisticsRaw(e,t);return yield n.value()}))}listWorkspaceABTestsRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(o,(e=>Nn(e)))}))}listWorkspaceABTests(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceABTestsRaw(e,t);return yield n.value()}))}pauseWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>_t(e)))}))}pauseWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.pauseWorkspaceABTestRaw(e,t);return yield n.value()}))}rotateWorkspaceABConversionWebhookSecretRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>xt(e)))}))}rotateWorkspaceABConversionWebhookSecret(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.rotateWorkspaceABConversionWebhookSecretRaw(e,t);return yield n.value()}))}setWorkspaceABTestDurationRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.setWorkspaceABTestDurationRequest)throw new ge("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 we(i,(e=>ti(e)))}))}setWorkspaceABTestDuration(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.setWorkspaceABTestDurationRaw(e,t);return yield n.value()}))}startWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling startWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>_t(e)))}))}startWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.startWorkspaceABTestRaw(e,t);return yield n.value()}))}stopWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling stopWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>ni(e)))}))}stopWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.stopWorkspaceABTestRaw(e,t);return yield n.value()}))}trackABTestEventRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.trackABTestEventRequest)throw new ge("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:di(e.trackABTestEventRequest)},t);return new we(i,(e=>ai(e)))}))}trackABTestEvent(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.trackABTestEventRaw(e,t);return yield n.value()}))}trackBulkABTestEventsRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.trackBulkABTestEventsRequest)throw new ge("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:hi(e.trackBulkABTestEventsRequest)},t);return new we(i,(e=>ui(e)))}))}trackBulkABTestEvents(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.trackBulkABTestEventsRaw(e,t);return yield n.value()}))}updateWorkspaceABTestRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.updateABTestRequest)throw new ge("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:gi(e.updateABTestRequest)},t);return new we(i,(e=>_t(e)))}))}updateWorkspaceABTest(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.updateWorkspaceABTestRaw(e,t);return yield n.value()}))}validateWorkspaceCompositionDeletionRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceCompositionDeletion().');if(null==e.validateWorkspaceCompositionDeletionRequest)throw new ge("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 we(i,(e=>Ei(e)))}))}validateWorkspaceCompositionDeletion(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceCompositionDeletionRaw(e,t);return yield n.value()}))}validateWorkspaceGoalTrackingRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceGoalTracking().');if(null==e.validateWorkspaceGoalTrackingRequest)throw new ge("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:Di(e.validateWorkspaceGoalTrackingRequest)},t);return new we(i,(e=>xi(e)))}))}validateWorkspaceGoalTracking(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceGoalTrackingRaw(e,t);return yield n.value()}))}validateWorkspaceWidgetDeletionRaw(e,t){return Ki(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceWidgetDeletion().');if(null==e.validateWorkspaceWidgetDeletionRequest)throw new ge("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 we(i,(e=>Mi(e)))}))}validateWorkspaceWidgetDeletion(e,t){return Ki(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceWidgetDeletionRaw(e,t);return yield n.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 Oi extends ce{createAnalyticsEventsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.createAnalyticsEventsRequest)throw new ge("createAnalyticsEventsRequest",'Required parameter "createAnalyticsEventsRequest" was null or undefined when calling createAnalyticsEvents().');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:Tt(e.createAnalyticsEventsRequest)},t);return new we(i,(e=>It(e)))}))}createAnalyticsEvents(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.createAnalyticsEventsRaw(e,t);return yield n.value()}))}createCompositionAnalyticsEventRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionAnalyticsEvent().');if(null==e.newAnalyticsEvent)throw new ge("newAnalyticsEvent",'Required parameter "newAnalyticsEvent" was null or undefined when calling createCompositionAnalyticsEvent().');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:Rt(e.newAnalyticsEvent)},t);return new we(i,(e=>je(e)))}))}createCompositionAnalyticsEvent(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.createCompositionAnalyticsEventRaw(e,t);return yield n.value()}))}flushAxiomEventsRaw(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("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/flush",method:"POST",headers:t,query:{}},e);return new we(n,(e=>ri(e)))}))}flushAxiomEvents(e){return Wi(this,void 0,void 0,(function*(){const t=yield this.flushAxiomEventsRaw(e);return yield t.value()}))}getAxiomStatusRaw(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("bearerAuth",[]);n&&(t.Authorization=`Bearer ${n}`)}const n=yield this.request({path:"/analytics/axiom/status",method:"GET",headers:t,query:{}},e);return new we(n,(e=>ri(e)))}))}getAxiomStatus(e){return Wi(this,void 0,void 0,(function*(){const t=yield this.getAxiomStatusRaw(e);return yield t.value()}))}getCompositionAnalyticsDashboardRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionAnalyticsDashboard().');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 we(o,(e=>Ne(e)))}))}getCompositionAnalyticsDashboard(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionAnalyticsDashboardRaw(e,t);return yield n.value()}))}getCompositionAnalyticsEventsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionAnalyticsEvents().');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 we(o,(e=>nn(e)))}))}getCompositionAnalyticsEvents(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionAnalyticsEventsRaw(e,t);return yield n.value()}))}getCompositionDailyAnalyticsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDailyAnalytics().');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 we(o,(e=>an(e)))}))}getCompositionDailyAnalytics(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionDailyAnalyticsRaw(e,t);return yield n.value()}))}getCompositionDeviceAnalyticsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDeviceAnalytics().');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 we(o,(e=>un(e)))}))}getCompositionDeviceAnalytics(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionDeviceAnalyticsRaw(e,t);return yield n.value()}))}getCompositionGeographyAnalyticsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionGeographyAnalytics().');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 we(o,(e=>cn(e)))}))}getCompositionGeographyAnalytics(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionGeographyAnalyticsRaw(e,t);return yield n.value()}))}getCompositionMonthlyAnalyticsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionMonthlyAnalytics().');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 we(o,(e=>pn(e)))}))}getCompositionMonthlyAnalytics(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionMonthlyAnalyticsRaw(e,t);return yield n.value()}))}getCompositionReferrerAnalyticsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionReferrerAnalytics().');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 we(o,(e=>fn(e)))}))}getCompositionReferrerAnalytics(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionReferrerAnalyticsRaw(e,t);return yield n.value()}))}getCompositionWeeklyAnalyticsRaw(e,t){return Wi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionWeeklyAnalytics().');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 we(o,(e=>wn(e)))}))}getCompositionWeeklyAnalytics(e,t){return Wi(this,void 0,void 0,(function*(){const n=yield this.getCompositionWeeklyAnalyticsRaw(e,t);return yield n.value()}))}}var zi="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 Li extends ce{completeSignupRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.completeSignupRequest)throw new ge("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 ye(i)}))}completeSignup(e,t){return zi(this,void 0,void 0,(function*(){yield this.completeSignupRaw(e,t)}))}confirmEmailRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("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:fi(e.updateEmailRequest)},t);return new ye(i)}))}confirmEmail(e,t){return zi(this,void 0,void 0,(function*(){yield this.confirmEmailRaw(e,t)}))}consumeOAuthSessionBridgeRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.bridgeId)throw new ge("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 ye(n)}))}consumeOAuthSessionBridge(e,t){return zi(this,void 0,void 0,(function*(){yield this.consumeOAuthSessionBridgeRaw(e,t)}))}deleteAccountRaw(e,t){return zi(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 ye(i)}))}deleteAccount(){return zi(this,arguments,void 0,(function*(e={},t){yield this.deleteAccountRaw(e,t)}))}getSessionRaw(e){return zi(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 ye(n)}))}getSession(e){return zi(this,void 0,void 0,(function*(){yield this.getSessionRaw(e)}))}getUserMetadataRaw(e){return zi(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 ye(n)}))}getUserMetadata(e){return zi(this,void 0,void 0,(function*(){yield this.getUserMetadataRaw(e)}))}initiateOAuthRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.provider)throw new ge("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 ye(i)}))}initiateOAuth(e,t){return zi(this,void 0,void 0,(function*(){yield this.initiateOAuthRaw(e,t)}))}loginUserRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.loginUserRequest)throw new ge("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 we(i,(e=>An(e)))}))}loginUser(e,t){return zi(this,void 0,void 0,(function*(){const n=yield this.loginUserRaw(e,t);return yield n.value()}))}logoutUserRaw(e){return zi(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 ye(n)}))}logoutUser(e){return zi(this,void 0,void 0,(function*(){yield this.logoutUserRaw(e)}))}logoutUserEverywhereRaw(e){return zi(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-everywhere",method:"POST",headers:t,query:{}},e);return new ye(n)}))}logoutUserEverywhere(e){return zi(this,void 0,void 0,(function*(){yield this.logoutUserEverywhereRaw(e)}))}refreshSessionRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.refreshSessionRequest)throw new ge("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 ye(i)}))}refreshSession(e,t){return zi(this,void 0,void 0,(function*(){yield this.refreshSessionRaw(e,t)}))}resendConfirmationRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("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:Hn(e.resetPasswordRequest)},t);return new ye(i)}))}resendConfirmation(e,t){return zi(this,void 0,void 0,(function*(){yield this.resendConfirmationRaw(e,t)}))}resetPasswordRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("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:Hn(e.resetPasswordRequest)},t);return new ye(i)}))}resetPassword(e,t){return zi(this,void 0,void 0,(function*(){yield this.resetPasswordRaw(e,t)}))}signupUserRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.signupUserRequest)throw new ge("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 ye(i)}))}signupUser(e,t){return zi(this,void 0,void 0,(function*(){yield this.signupUserRaw(e,t)}))}signupWithInvitationRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.signupWithInvitationRequest)throw new ge("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 ye(i)}))}signupWithInvitation(e,t){return zi(this,void 0,void 0,(function*(){yield this.signupWithInvitationRaw(e,t)}))}updateEmailRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("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:fi(e.updateEmailRequest)},t);return new ye(i)}))}updateEmail(e,t){return zi(this,void 0,void 0,(function*(){yield this.updateEmailRaw(e,t)}))}updateNameRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.updateNameRequest)throw new ge("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 ye(i)}))}updateName(e,t){return zi(this,void 0,void 0,(function*(){yield this.updateNameRaw(e,t)}))}updatePasswordRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.updatePasswordRequest)throw new ge("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 ye(i)}))}updatePassword(e,t){return zi(this,void 0,void 0,(function*(){yield this.updatePasswordRaw(e,t)}))}updateUserMetadataRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.updateUserMetadataRequest)throw new ge("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 ye(i)}))}updateUserMetadata(e,t){return zi(this,void 0,void 0,(function*(){yield this.updateUserMetadataRaw(e,t)}))}validateInviteCodeRaw(e,t){return zi(this,void 0,void 0,(function*(){if(null==e.code)throw new ge("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 we(i,(e=>Ti(e)))}))}validateInviteCode(e,t){return zi(this,void 0,void 0,(function*(){const n=yield this.validateInviteCodeRaw(e,t);return yield n.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 ji extends ce{addAiAnswersKnowledgeDocumentRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeDocument().');if(null==e.addAiAnswersKnowledgeDocumentRequest)throw new ge("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 we(i,(e=>We(e)))}))}addAiAnswersKnowledgeDocument(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}addAiAnswersKnowledgeFileRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeFile().');if(null==e.file)throw new ge("file",'Required parameter "file" was null or undefined when calling addAiAnswersKnowledgeFile().');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=function(e){for(const t of e)if("multipart/form-data"===t.contentType)return!0;return!1}([{contentType:"multipart/form-data"}]);let o,r=!1;r=i,o=r?new FormData:new URLSearchParams,null!=e.file&&o.append("file",e.file),null!=e.title&&o.append("title",e.title);const a=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents/file".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:o},t);return new we(a,(e=>We(e)))}))}addAiAnswersKnowledgeFile(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeFileRaw(e,t);return yield n.value()}))}checkCompositionAccessRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Ve(e)))}))}checkCompositionAccess(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.checkCompositionAccessRaw(e,t);return yield n.value()}))}createCompositionRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.newComposition)throw new ge("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 we(i,(e=>kt(e)))}))}createComposition(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.createCompositionRaw(e,t);return yield n.value()}))}createCompositionContentItemRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling createCompositionContentItem().');if(null==e.createCompositionContentItemRequest)throw new ge("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:Ct(e.createCompositionContentItemRequest)},t);return new we(i,(e=>mt(e)))}))}createCompositionContentItem(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.createCompositionContentItemRaw(e,t);return yield n.value()}))}createCompositionDatabaseRecordRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.body)throw new ge("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 we(i,(e=>Qe(e)))}))}createCompositionDatabaseRecord(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.createCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 ye(i)}))}deleteComposition(e,t){return $i(this,void 0,void 0,(function*(){yield this.deleteCompositionRaw(e,t)}))}deleteCompositionContentItemRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling deleteCompositionContentItem().');if(null==e.itemId)throw new ge("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 we(i,(e=>Bt(e)))}))}deleteCompositionContentItem(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionContentItemRaw(e,t);return yield n.value()}))}deleteCompositionDataSourceRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>function(e){return null==e?e:{removed:e.removed}}(e)))}))}deleteCompositionDataSource(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDataSourceRaw(e,t);return yield n.value()}))}deleteCompositionDatabaseRecordRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("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 we(i,(e=>Qe(e)))}))}deleteCompositionDatabaseRecord(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionEntryItemsRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionEntryItems().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling deleteCompositionEntryItems().');const n={};null!=e.ids&&(n.ids=e.ids),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}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"DELETE",headers:i,query:n},t);return new we(o,(e=>dt(e)))}))}deleteCompositionEntryItems(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionEntryItemsRaw(e,t);return yield n.value()}))}describeCompositionEntriesRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>nt(e)))}))}describeCompositionEntries(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.describeCompositionEntriesRaw(e,t);return yield n.value()}))}duplicateCompositionRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>zt(e)))}))}duplicateComposition(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.duplicateCompositionRaw(e,t);return yield n.value()}))}exportCompositionEntryItemsRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling exportCompositionEntryItems().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling exportCompositionEntryItems().');const n={};null!=e.format&&(n.format=e.format),null!=e.order&&(n.order=e.order),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}/export".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return this.isJsonMime(o.headers.get("content-type"))?new we(o):new Ie(o)}))}exportCompositionEntryItems(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.exportCompositionEntryItemsRaw(e,t);return yield n.value()}))}getAiAnswersKnowledgeRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Xt(e)))}))}getAiAnswersKnowledge(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getAiAnswersKnowledgeRaw(e,t);return yield n.value()}))}getAllCompositionsRaw(e,t){return $i(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 we(o,(e=>Ht(e)))}))}getAllCompositions(){return $i(this,arguments,void 0,(function*(e={},t){const n=yield this.getAllCompositionsRaw(e,t);return yield n.value()}))}getCompositionByIdRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>on(e)))}))}getCompositionById(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionByIdRaw(e,t);return yield n.value()}))}getCompositionContentRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getCompositionContent(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentRaw(e,t);return yield n.value()}))}getCompositionContentSchemaRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>rn(e)))}))}getCompositionContentSchema(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentSchemaRaw(e,t);return yield n.value()}))}getCompositionDataSourceRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Ze(e)))}))}getCompositionDataSource(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionDataSourceRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("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 we(i,(e=>Qe(e)))}))}getCompositionDatabaseRecord(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordsRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecords().');if(null==e.table)throw new ge("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 we(i,(e=>sn(e)))}))}getCompositionDatabaseRecords(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordsRaw(e,t);return yield n.value()}))}getCompositionDesignRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getCompositionDesign(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignRaw(e,t);return yield n.value()}))}getCompositionDesignSchemaRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>dn(e)))}))}getCompositionDesignSchema(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSchemaRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>ln(e)))}))}getCompositionEmbedSchema(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSettingsRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getCompositionEmbedSettings(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}getCompositionPreviewRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>gn(e)))}))}getCompositionPreview(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionPreviewRaw(e,t);return yield n.value()}))}getCompositionVersionsRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>mn(e)))}))}getCompositionVersions(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionVersionsRaw(e,t);return yield n.value()}))}getCompositionsBatchRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.getCompositionsBatchRequest)throw new ge("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 we(i,(e=>In(e)))}))}getCompositionsBatch(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.getCompositionsBatchRaw(e,t);return yield n.value()}))}listCompositionEntryItemsRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling listCompositionEntryItems().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling listCompositionEntryItems().');const n={};null!=e.limit&&(n.limit=e.limit),null!=e.order&&(n.order=e.order),null!=e.since&&(n.since=e.since.toISOString()),null!=e.until&&(n.until=e.until.toISOString()),null!=e.cursor&&(n.cursor=e.cursor),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}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return new we(o,(e=>ct(e)))}))}listCompositionEntryItems(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.listCompositionEntryItemsRaw(e,t);return yield n.value()}))}patchCompositionContentItemRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling patchCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling patchCompositionContentItem().');if(null==e.itemId)throw new ge("itemId",'Required parameter "itemId" was null or undefined when calling patchCompositionContentItem().');if(null==e.requestBody)throw new ge("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 we(i,(e=>mt(e)))}))}patchCompositionContentItem(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.patchCompositionContentItemRaw(e,t);return yield n.value()}))}readCompositionEntriesRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling readCompositionEntries().');if(null==e.table)throw new ge("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 we(o,(e=>at(e)))}))}readCompositionEntries(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.readCompositionEntriesRaw(e,t);return yield n.value()}))}removeAiAnswersKnowledgeDocumentRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeAiAnswersKnowledgeDocument().');if(null==e.documentId)throw new ge("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 we(i,(e=>Vn(e)))}))}removeAiAnswersKnowledgeDocument(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.removeAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}setCompositionDataSourceRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setCompositionDataSource().');if(null==e.setCompositionDataSourceRequest)throw new ge("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 we(i,(e=>Ze(e)))}))}setCompositionDataSource(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.setCompositionDataSourceRaw(e,t);return yield n.value()}))}setDynamicContentRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setDynamicContent().');if(null==e.setDynamicContentRequest)throw new ge("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 we(i,(e=>Jn(e)))}))}setDynamicContent(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.setDynamicContentRaw(e,t);return yield n.value()}))}updateCompositionRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateComposition().');if(null==e.updateComposition)throw new ge("updateComposition",'Required parameter "updateComposition" was null or undefined when calling updateComposition().');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}".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 we(i,(e=>on(e)))}))}updateComposition(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.updateCompositionRaw(e,t);return yield n.value()}))}updateCompositionDatabaseRecordRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.body)throw new ge("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 we(i,(e=>Qe(e)))}))}updateCompositionDatabaseRecord(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.updateCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}updateCompositionStatusRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionStatus().');if(null==e.updateCompositionStatusRequest)throw new ge("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 we(i,(e=>Je(e)))}))}updateCompositionStatus(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.updateCompositionStatusRaw(e,t);return yield n.value()}))}validateCompositionContentRaw(e,t){return $i(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling validateCompositionContent().');if(null==e.requestBody)throw new ge("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 we(i,(e=>Ii(e)))}))}validateCompositionContent(e,t){return $i(this,void 0,void 0,(function*(){const n=yield this.validateCompositionContentRaw(e,t);return yield n.value()}))}}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 Ni extends ce{exchangeTokenRaw(e,t){return Gi(this,void 0,void 0,(function*(){if(null==e.exchangeTokenRequest)throw new ge("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 we(i,(e=>Gt(e)))}))}exchangeToken(e,t){return Gi(this,void 0,void 0,(function*(){const n=yield this.exchangeTokenRaw(e,t);return yield n.value()}))}validateTokenRaw(e){return Gi(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 we(n,(e=>ki(e)))}))}validateToken(e){return Gi(this,void 0,void 0,(function*(){const t=yield this.validateTokenRaw(e);return yield t.value()}))}}var Vi="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 ce{addLanguagesToTranslationRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addLanguagesToTranslation().');if(null==e.addLanguagesToTranslationRequest)throw new ge("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 we(i,(e=>Be(e)))}))}addLanguagesToTranslation(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.addLanguagesToTranslationRaw(e,t);return yield n.value()}))}createTranslationRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.createTranslationRequest)throw new ge("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 we(i,(e=>Et(e)))}))}createTranslation(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.createTranslationRaw(e,t);return yield n.value()}))}deleteTranslationRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Mt(e)))}))}deleteTranslation(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.deleteTranslationRaw(e,t);return yield n.value()}))}getLanguagePresetsRaw(e){return Vi(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/language-presets",method:"GET",headers:{},query:{}},e);return new we(t,(e=>Tn(e)))}))}getLanguagePresets(e){return Vi(this,void 0,void 0,(function*(){const t=yield this.getLanguagePresetsRaw(e);return yield t.value()}))}getSupportedLanguagesRaw(e){return Vi(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/supported-languages",method:"GET",headers:{},query:{}},e);return new we(t,(e=>Sn(e)))}))}getSupportedLanguages(e){return Vi(this,void 0,void 0,(function*(){const t=yield this.getSupportedLanguagesRaw(e);return yield t.value()}))}getTranslationRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>qn(e)))}))}getTranslation(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.getTranslationRaw(e,t);return yield n.value()}))}getTranslationAnalyticsRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(o,(e=>xn(e)))}))}getTranslationAnalytics(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.getTranslationAnalyticsRaw(e,t);return yield n.value()}))}getTranslationConfigRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(n,(e=>Dn(e)))}))}getTranslationConfig(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.getTranslationConfigRaw(e,t);return yield n.value()}))}getTranslationsRaw(e,t){return Vi(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 we(o,(e=>Bn(e)))}))}getTranslations(){return Vi(this,arguments,void 0,(function*(e={},t){const n=yield this.getTranslationsRaw(e,t);return yield n.value()}))}removeLanguageFromTranslationRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeLanguageFromTranslation().');if(null==e.languageCode)throw new ge("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 we(i,(e=>Be(e)))}))}removeLanguageFromTranslation(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.removeLanguageFromTranslationRaw(e,t);return yield n.value()}))}retranslateExperimentRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Mt(e)))}))}retranslateExperiment(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.retranslateExperimentRaw(e,t);return yield n.value()}))}submitTranslationAnalyticsEventRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling submitTranslationAnalyticsEvent().');if(null==e.submitTranslationAnalyticsEventRequest)throw new ge("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 ye(i)}))}submitTranslationAnalyticsEvent(e,t){return Vi(this,void 0,void 0,(function*(){yield this.submitTranslationAnalyticsEventRaw(e,t)}))}updateTranslationStatusRaw(e,t){return Vi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateTranslationStatus().');if(null==e.updateTranslationStatusRequest)throw new ge("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 we(i,(e=>Be(e)))}))}updateTranslationStatus(e,t){return Vi(this,void 0,void 0,(function*(){const n=yield this.updateTranslationStatusRaw(e,t);return yield n.value()}))}}var Fi="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 Hi extends ce{checkWidgetAccessRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Xe(e)))}))}checkWidgetAccess(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.checkWidgetAccessRaw(e,t);return yield n.value()}))}createCompositionFromWidgetRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionFromWidget().');if(null==e.createCompositionFromWidgetRequest)throw new ge("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 we(i,(e=>qt(e)))}))}createCompositionFromWidget(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.createCompositionFromWidgetRaw(e,t);return yield n.value()}))}createWidgetRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.newWidget)throw new ge("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 we(i,(e=>bt(e)))}))}createWidget(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.createWidgetRaw(e,t);return yield n.value()}))}deleteWidgetRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 ye(i)}))}deleteWidget(e,t){return Fi(this,void 0,void 0,(function*(){yield this.deleteWidgetRaw(e,t)}))}detachWidgetRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 ye(i)}))}detachWidget(e,t){return Fi(this,void 0,void 0,(function*(){yield this.detachWidgetRaw(e,t)}))}duplicateWidgetRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>$t(e)))}))}duplicateWidget(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.duplicateWidgetRaw(e,t);return yield n.value()}))}getWidgetContentSchemaRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getWidgetContentSchema(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.getWidgetContentSchemaRaw(e,t);return yield n.value()}))}getWidgetDesignSchemaRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getWidgetDesignSchema(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.getWidgetDesignSchemaRaw(e,t);return yield n.value()}))}getWidgetPublishHistoryRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("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 we(i,(e=>Pn(e)))}))}getWidgetPublishHistory(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.getWidgetPublishHistoryRaw(e,t);return yield n.value()}))}getWidgetsRaw(e,t){return Fi(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 we(o,(e=>On(e)))}))}getWidgets(){return Fi(this,arguments,void 0,(function*(e={},t){const n=yield this.getWidgetsRaw(e,t);return yield n.value()}))}getWidgetsBatchRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.getWidgetsBatchRequest)throw new ge("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 we(i,(e=>zn(e)))}))}getWidgetsBatch(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.getWidgetsBatchRaw(e,t);return yield n.value()}))}renameWidgetPublishHistoryTitleRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.version)throw new ge("version",'Required parameter "version" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.renameWidgetPublishHistoryTitleRequest)throw new ge("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 we(i,(e=>Fn(e)))}))}renameWidgetPublishHistoryTitle(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.renameWidgetPublishHistoryTitleRaw(e,t);return yield n.value()}))}setWidgetPublishHistoryLiveRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling setWidgetPublishHistoryLive().');if(null==e.version)throw new ge("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 we(i,(e=>ei(e)))}))}setWidgetPublishHistoryLive(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.setWidgetPublishHistoryLiveRaw(e,t);return yield n.value()}))}updateWidgetRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidget().');if(null==e.updateWidgetRequest)throw new ge("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 ye(i)}))}updateWidget(e,t){return Fi(this,void 0,void 0,(function*(){yield this.updateWidgetRaw(e,t)}))}updateWidgetRepositoryRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidgetRepository().');if(null==e.updateWidgetRepositoryRequest)throw new ge("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 we(i,(e=>vi(e)))}))}updateWidgetRepository(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.updateWidgetRepositoryRaw(e,t);return yield n.value()}))}uploadWidgetThumbnailRaw(e,t){return Fi(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling uploadWidgetThumbnail().');if(null==e.uploadWidgetThumbnailRequest)throw new ge("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 we(i,(e=>yi(e)))}))}uploadWidgetThumbnail(e,t){return Fi(this,void 0,void 0,(function*(){const n=yield this.uploadWidgetThumbnailRaw(e,t);return yield n.value()}))}}class Yi extends Error{constructor(e,t,n){super(e),this.code=t,this.statusCode=n,this.name="AuthError"}}class Ji{constructor(e={}){var t,n;this.currentToken=null,this.apiKey=null,this.refreshTimer=null,this.config=Object.assign({apiUrl:e.apiUrl||W(),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 ue({basePath:this.config.apiUrl,apiKey:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${P}`}});return new Ni(n)}createTokensApiForAccessToken(t){const n=new ue({basePath:this.config.apiUrl,accessToken:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${P}`}});return new Ni(n)}setApiKey(e){this.apiKey=e,this.currentToken={token:e,tokenType:"API-Key",expiresAt:null,scopes:[]},this.config.debug&&te.debug("AuthManager: API key set")}getValidToken(t){return e(this,void 0,void 0,(function*(){if(this.currentToken&&this.isTokenValid(this.currentToken)){if(Ji.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 Yi("No authentication method available","NO_AUTH_METHOD")}))}exchangeApiKeyForJWT(t){return e(this,void 0,void 0,(function*(){var e;if(!this.apiKey)throw new Yi("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 Yi("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&&te.info("AuthManager: Token exchanged successfully",{scopes:a.scopes,expiresAt:a.expiresAt}),a}catch(e){const t=e instanceof Yi?e:new Yi(`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(Ji.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)?(Ji.validatedTokens.add(this.currentToken.token),!0):(this.clearToken(),!1)}catch(e){return this.config.debug&&te.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&&Ji.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&&te.info("AuthManager: Token refreshed automatically")}catch(e){this.config.debug&&te.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&&te.debug("AuthManager: Disposed")}}Ji.validatedTokens=new Set;const Zi=K,Qi={};let eo=null,to=null;const no={API_URL:O.PROD_API_URL,API_VERSION:O.VERSION,CLIENT_URL:O.PROD_CLIENT_URL,PRODUCTION_URL:O.PROD_CDN_URL,NODE_ENV:"production",ENABLE_EDITING:O.ENABLE_EDITING,API_KEY:Qi.PUBLIC_API_KEY,AXIOM_API_KEY:Qi.PUBLIC_AXIOM_API_KEY,STATSIG_KEY:Qi.PUBLIC_STATSIG_KEY};function io(e){eo=e}function oo(){return eo}function ro(){return to||(to=new Ji({apiUrl:lo(),debug:vo.enabled})),to}function ao(e){ro().setApiKey(e)}function so(){return e(this,void 0,void 0,(function*(){if(to&&to.hasAuthMethod())try{return yield to.getValidToken()}catch(e){}if(eo)return yield eo.getToken();const e=no.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 uo(e){const t=(null==e?void 0:e.tokenProvider)||eo;if(!t){const t=(null==e?void 0:e.apiKey)||no.API_KEY;return{apiKey:t,basePath:(null==e?void 0:e.basePath)||lo(),tokenProvider:t?new re(t):void 0}}return{basePath:(null==e?void 0:e.basePath)||lo(),tokenProvider:t}}function lo(){return no.API_URL}function co(){return no.PRODUCTION_URL}function ho(){return`${lo()}${no.API_VERSION}`}const po={isProduction:"production"===no.NODE_ENV,apiUrl:lo(),apiKey:no.API_KEY},go={renderMode:z,displayMode:L,resize:$,width:j,height:G,autoscale:N},fo={customElements:V.CUSTOM_ELEMENTS,http3:V.HTTP3,resizeObserver:V.RESIZE_OBSERVER},mo={batchSize:X,loadTimeout:F,retryAttempts:H},vo={enabled:B,logLevel:M},wo={AXIOM_API_KEY:no.AXIOM_API_KEY||"",AXIOM_DATASET:i,AXIOM_API_ENDPOINT:n,STATSIG_API_KEY:no.STATSIG_KEY||"",STATSIG_API_ENDPOINT:o,ENABLE_PERFORMANCE_TRACKING:r,PERFORMANCE_SAMPLE_RATE:a,PERFORMANCE_REPORTING_ENDPOINT:d,LCP_THRESHOLD:u,LCP_WARNING_THRESHOLD:l,FID_THRESHOLD:c,FID_WARNING_THRESHOLD:h,CLS_THRESHOLD:p,CLS_WARNING_THRESHOLD:g,FCP_THRESHOLD:f,FCP_WARNING_THRESHOLD:m,TTFB_THRESHOLD:v,TTFB_WARNING_THRESHOLD:w,WIDGET_LOAD_THRESHOLD:y,WIDGET_LOAD_WARNING_THRESHOLD:I,BUNDLE_SIZE_THRESHOLD:R,BUNDLE_SIZE_WARNING_THRESHOLD:T,MAX_METRICS_BUFFER:s},yo={ROOT_MARGIN:A,THRESHOLD:k,MAX_CONCURRENT:C,RETRY_ATTEMPTS:S,RETRY_DELAY:q},Io={MAX_PRELOAD_REQUESTS:E,PREFETCH_TIMEOUT:U,CACHE_DURATION:b,MAX_CONCURRENT_REQUESTS:x,DNS_PREFETCH_ENABLED:_,PRECONNECT_ENABLED:D},Ro={DEBUG:B,LOG_LEVEL:M,VERSION:K};function To(){return uo()}var Ao=Object.freeze({__proto__:null,BROWSER_FEATURES:fo,DEBUG:vo,DEFAULT_WIDGET_CONFIG:go,LAZY_LOADING_CONFIG:yo,PERFORMANCE:mo,PERFORMANCE_CONFIG:wo,RESOURCE_CONFIG:Io,SDK_CONFIG:Ro,VERSION:Zi,config:no,createSdkConfig:uo,environment:po,getApiUrl:lo,getAuthManager:ro,getAuthToken:so,getCdnUrl:co,getConfiguration:To,getTokenProvider:oo,getVersionedApiUrl:ho,setApiKey:ao,setTokenProvider:io});const ko="widgetic_session_id",Co=new Map;let So=null;function qo(e){var t;try{const t=localStorage.getItem(e);if(null!==t)return t}catch(e){}return null!==(t=Co.get(e))&&void 0!==t?t:null}function Eo(e,t){Co.set(e,t);try{localStorage.setItem(e,t)}catch(t){ee.debug("localStorage is not available; keeping the A/B test state in memory",{key:e,error:t})}}function Uo(e){Co.delete(e);try{localStorage.removeItem(e)}catch(t){ee.debug("localStorage is not available; the value was only forgotten in memory",{key:e,error:t})}}function bo(){const e=qo(ko);return e||(So||(So=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)}`}()),Eo(ko,So),So)}function xo(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 _o(e,t,n){if(!e||0===e.length)return null;const i=xo(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 Do(e,t){if(!e||!t)return!1;try{return null!==e.closest(t)}catch(e){return ee.warn("The goal target is not a selector this browser understands",{goalTarget:t,error:e}),!1}}export{Ji as A,bo as B,ue as C,go as D,ie as E,oe as F,_o as G,Ao as H,wo as P,ne as S,Xi as T,Zi as V,Hi as W,ho as a,ji as b,co as c,no as d,ee as e,vo as f,so as g,To as h,ao as i,re as j,oo as k,te as l,lo as m,O as n,Li as o,uo as p,Uo as q,qo as r,io as s,Do as t,Oi as u,Yi as v,Eo as w,ro as x,Pi as y,ko as z};
|
|
1
|
+
import{_ as e}from"./vendor.js";const t="2.1.10",n="https://api.axiom.co/v1",i="widgetic-performance",o="https://events.statsigapi.net/v1/custom",r=!0,a=1,s=1e3,d="",u=2500,l=2e3,c=100,p=50,h=.1,g=.05,f=1800,m=1200,v=800,w=600,y=3e3,I=2e3,R=5e5,T=3e5,k="50px",A=.1,C=3,q=3,S=1e3,b=10,E=5e3,U=36e5,x=6,_=!0,D=!0,B=!1,M="info",P=t,W=t;function K(){var e;return`${"undefined"!=typeof process&&"development"===(null===(e={NODE_ENV:"production"})||void 0===e?void 0:e.NODE_ENV)?O.DEV_API_URL:O.PROD_API_URL}${O.VERSION}`}const O={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},z="auto",L="inline",$="fixed",j=350,N=200,G=!1,V={CUSTOM_ELEMENTS:"undefined"!=typeof customElements,HTTP3:!1,RESIZE_OBSERVER:"undefined"!=typeof ResizeObserver},F=10,X=5e3,H=3;let Y=B;const J={get enabled(){return Y},logLevel:M},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 Q(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(Q);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]=Q(i)}return t}return e}const ee=new class{constructor(e=J.logLevel){this.logLevels={debug:0,info:1,warn:2,error:3},this.currentLevel=this.logLevels[e]}shouldLog(e){return J.enabled&&this.logLevels[e]>=this.currentLevel}formatMessage(e,t,...n){const i=(new Date).toISOString();return[`${`[Widgetic SDK] [${e.toUpperCase()}] [${i}]`} ${t}`,...n.map(Q)]}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){Y=e}(e)}},te={debug:(e,...t)=>ee.debug(e,...t),info:(e,...t)=>ee.info(e,...t),warn:(e,...t)=>ee.warn(e,...t),error:(e,...t)=>ee.error(e,...t),setLevel:e=>ee.setLevel(e)};class ne{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 ie{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 oe{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 re{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 ae="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 se="https://api.widgetic.com/v1".replace(/\/+$/,""),de="X-SDK-Version";class ue{constructor(e){if(this.configuration={basePath:se,headers:{},middleware:[]},"string"==typeof e){const t=(null==e?void 0:e.startsWith("Bearer "))?e.slice(7):e;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${t}`:t})),this.configuration.accessToken=()=>ae(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||se});if("string"==typeof e.accessToken&&e.accessToken){const t=e.accessToken,n=t.startsWith("Bearer ")?t.slice(7):t;this.configuration.apiKey=e=>ae(this,void 0,void 0,(function*(){return"authorization"===(null==e?void 0:e.toLowerCase())?`Bearer ${n}`:n})),this.configuration.accessToken=()=>ae(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:se}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||fe}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:()=>ae(this,void 0,void 0,(function*(){return e}))}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const le=new ue;class ce{constructor(e=le){this.configuration=e,this.fetchApi=(e,t)=>ae(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 he(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 ue)||(e=new ue(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&&ce.jsonRegex.test(e)}request(e,t){return ae(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 pe(s,u,l)}))}createFetchParams(e,t){return ae(this,void 0,void 0,(function*(){let n=(this.configuration.basePath||se).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()===de.toLowerCase()))||(i[de]="@widgetic/api-sdk/2.0.4");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:()=>ae(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}}ce.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class pe extends Error{constructor(e,t,n=null){super(t),this.response=e,this.name="ResponseError",this.code=n}}class he extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class ge extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}function fe(e,t=""){return Object.keys(e).map((n=>me(n,e[n],t))).filter((e=>e.length>0)).join("&")}function me(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 me(e,Array.from(t),n)}return t instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?fe(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 we{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 ae(this,void 0,void 0,(function*(){const e=yield this.raw.json();return this.transformer(this.unwrapSuccessEnvelope(e))}))}}class ye{constructor(e){this.raw=e}value(){return ae(this,void 0,void 0,(function*(){}))}}class Ie{constructor(e){this.raw=e}value(){return ae(this,void 0,void 0,(function*(){return yield this.raw.text()}))}}function Re(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 Te(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 ke(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 Ae(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(ke)}}(e)}function Ce(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 qe(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 Se(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 be(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 Ee(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:be(e.sampleRatioMismatch),confidenceLevel:null==e.confidenceLevel?void 0:e.confidenceLevel}}(e)}function Ue(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 xe(e){return function(e){if(null==e)return e;return{overall:null==e.overall?void 0:Ee(e.overall),variants:null==e.variants?void 0:e.variants.map(Ue),recommendation:null==e.recommendation?void 0:Se(e.recommendation)}}(e)}function _e(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),origin:null==e.origin?void 0:e.origin,syncStatus:null==e.syncStatus?void 0:e.syncStatus,lastSyncedAt:null==e.lastSyncedAt?void 0:new Date(e.lastSyncedAt),variants:null==e.variants?void 0:e.variants.map(_e)}}(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{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 Pe(e){return function(e){if(null==e)return e;return{documents:e.documents,characters:e.characters,maxDocuments:e.maxDocuments,maxTotalChars:e.maxTotalChars}}(e)}function We(e){return function(e){if(null==e)return e;return{documents:e.documents.map(Me),totals:Pe(e.totals)}}(e)}function Ke(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 Oe(e){return function(e){if(null==e)return e;return{removed:e.removed}}(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),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 Le(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 $e(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 je(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 Ne(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:Le(e.summary),devices:e.devices.map($e),geography:e.geography.map(ze),referrers:e.referrers.map(Ne),events:null==e.events?void 0:e.events.map(je)}}(e)}function Ve(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{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,nextCursor:null==e.nextCursor?void 0:e.nextCursor,warnings:null==e.warnings?void 0:e.warnings})}(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 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 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 Je(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}}(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,lastEditedBy:null==e.lastEditedBy?void 0:Je(e.lastEditedBy),lastEditedAt:null==e.lastEditedAt?void 0:new Date(e.lastEditedAt)}}(e)}function Qe(e){return function(e){if(null==e)return e;return{url:e.url,refreshSeconds:e.refreshSeconds}}(e)}function et(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 tt(e){return function(e){if(null==e)return e;return{settings:e.settings,source:e.source,widgetDefaults:e.widgetDefaults,defaultsSourceCompositionId:e.defaultsSourceCompositionId}}(e)}function nt(e){return function(e){if(null==e)return e;return{success:e.success,data:tt(e.data),meta:null==e.meta?void 0:Ve(e.meta)}}(e)}function it(e){return function(e){if(null==e)return e;return{name:e.name,type:e.type}}(e)}function ot(e){return function(e){if(null==e)return e;return{name:e.name,columns:e.columns.map(it),rows:e.rows}}(e)}function rt(e){return function(e){if(null==e)return e;return{compositionId:e.compositionId,hasData:e.hasData,tables:e.tables.map(ot)}}(e)}function at(e){return function(e){if(null==e)return e;return{value:e.value,count:e.count}}(e)}function st(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 dt(e){return function(e){if(null==e)return e;return{column:e.column,tallies:e.tallies.map(st),truncated:null==e.truncated?void 0:e.truncated}}(e)}function ut(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(at),moreGroups:e.moreGroups,columns:e.columns,rows:null==e.rows?null:e.rows,moreRows:e.moreRows,aggregates:null==e.aggregates?void 0:dt(e.aggregates)}}(e)}function lt(e){return function(e){if(null==e)return e;return{deleted:e.deleted}}(e)}function ct(e){return function(e){if(null==e)return e;return{success:e.success,data:lt(e.data)}}(e)}function pt(e){return function(e){if(null==e)return e;return{id:e.id,values:e.values,context:e.context,createdAt:null==e.createdAt?null:new Date(e.createdAt),truncatedColumns:null==e.truncatedColumns?void 0:e.truncatedColumns}}(e)}function ht(e){return function(e){if(null==e)return e;return{nextCursor:e.nextCursor,total:e.total,paging:null==e.paging?void 0:e.paging}}(e)}function gt(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data.map(pt),meta:ht(e.meta)}}(e)}function ft(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 mt(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 vt(e){return function(e){if(null==e)return e;return{fieldPath:e.fieldPath,fieldLabel:e.fieldLabel,fileName:e.fileName,mediaId:e.mediaId,mimeType:e.mimeType}}(e)}function wt(e){return function(e){if(null==e)return e;return{name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,mediaId:e.mediaId}}(e,!1)}function yt(e){return function(e){if(null==e)return e;return{fileName:e.fileName,mediaId:e.mediaId,reason:e.reason}}(e)}function It(e){return function(e){if(null==e)return e;return{key:e.key,label:e.label,source:e.source,assignments:e.assignments.map(vt)}}(e)}function Rt(e){return function(e){if(null==e)return e;return{added:e.added,libraryOnly:e.libraryOnly}}(e)}function Tt(e){return function(e){if(null==e)return e;return{items:e.items.map(It),libraryOnly:e.libraryOnly.map(yt),summary:Rt(e.summary)}}(e)}function kt(e){return function(e){if(null==e)return e;return{plan:Tt(e.plan),applied:e.applied,content:null==e.content?void 0:e.content}}(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:kt(e.data)}}(e)}function Ct(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 qt(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:Ct(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 St(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:qt(e.data)}}(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:Ce(e.data)}}(e)}function Et(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 Ut(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(Et),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 xt(e){return function(e){if(null==e)return e;return{events:null==e.events?void 0:e.events.map(je),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 _t(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 Dt(e){return function(e){if(null==e)return e;return{events:e.events.map(_t)}}(e,!1)}function Bt(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(e)}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:Ze(e.data),meta:null==e.meta?void 0:Bt(e.meta)}}(e)}function Pt(e){return function(e){if(null==e)return e;return Object.assign(Object.assign({},e),{position:e.position})}(e,!1)}function Wt(e){return function(e){if(null==e)return e;return{warnings:null==e.warnings?void 0:e.warnings}}(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:Ze(e.data),meta:null==e.meta?void 0:Wt(e.meta)}}(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:De(e.data),message:null==e.message?void 0:e.message}}(e)}function zt(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,hasUnpublishedChanges:null==e.hasUnpublishedChanges?void 0:e.hasUnpublishedChanges,publishedAt:null==e.publishedAt?void 0:new Date(e.publishedAt),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 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:zt(e.data),meta:null==e.meta?void 0:e.meta}}(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:Te(e.data)}}(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:Ae(e.data)}}(e)}function Nt(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 Gt(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 Vt(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 Ft(e){return function(e){if(null==e)return e;return{removed:e.removed}}(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:Ft(e.data)}}(e)}function Ht(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 Yt(e){return function(e){if(null==e)return e;return{operationId:null==e.operationId?void 0:e.operationId}}(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:Yt(e.data)}}(e)}function Zt(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,hasUnpublishedChanges:null==e.hasUnpublishedChanges?void 0:e.hasUnpublishedChanges,publishedAt:null==e.publishedAt?void 0:new Date(e.publishedAt),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 Qt(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),warnings:null==e.warnings?void 0:e.warnings}}(e)}function en(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 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{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 on(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(nn),success_metrics:null==e.success_metrics?void 0:e.success_metrics,primary_metric:null==e.primary_metric?void 0:e.primary_metric}}(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:We(e.data)}}(e)}function an(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 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:e.data.map(Ze),meta:null==e.meta?void 0:an(e.meta)}}(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,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 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.map(dn)}}(e)}function ln(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 cn(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 pn(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(cn),targets:null==e.targets?void 0:e.targets.map(ln)}}(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{success:null==e.success?void 0:e.success,data:null==e.data?void 0:e.data.map(je)}}(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:Ze(e.data)}}(e)}function mn(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 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(Nt)}}(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:e.data}}(e)}function yn(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 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($e)}}(e)}function Rn(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 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.map(ze)}}(e)}function kn(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 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:e.data.map(kn)}}(e)}function Cn(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 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:e.data.map(Ne)}}(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:e.data.map(ft)}}(e)}function bn(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)}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(bn)}}(e)}function Un(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 xn(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(Un)}}(e)}function _n(e){return function(e){if(null==e)return e;return{presets:null==e.presets?void 0:e.presets}}(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:_n(e.data)}}(e)}function Bn(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 Mn(e){return function(e){if(null==e)return e;return{languages:null==e.languages?void 0:ve(e.languages,Bn),preselected:null==e.preselected?void 0:e.preselected}}(e)}function Pn(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Mn(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:De(e.data)}}(e)}function Kn(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 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}}(e)}function zn(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(Kn),topPerformingLanguages:null==e.topPerformingLanguages?void 0:e.topPerformingLanguages.map(On),completionStatus:null==e.completionStatus?void 0:e.completionStatus}}(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:zn(e.data)}}(e)}function $n(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 jn(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 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.data.map(De),count:null==e.count?void 0:e.count}}(e)}function Gn(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 Vn(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 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(Vn)}}(e)}function Xn(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 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(Zt),meta:null==e.meta?void 0:Xn(e.meta)}}(e)}function Yn(e){return function(e){if(null==e)return e;return{widgets:null==e.widgets?void 0:e.widgets.map(Zt),errors:null==e.errors?void 0:e.errors.map(Un)}}(e)}function Jn(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 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:qe(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:xe(e.data)}}(e)}function ei(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,type:null==e.type?void 0:e.type,thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl,jsPath:null==e.jsPath?void 0:e.jsPath,shareId:null==e.shareId?void 0:e.shareId,updatedAt:null==e.updatedAt?void 0:e.updatedAt}}(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:e.data.map(ei)}}(e)}function ni(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 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:e.data.map(Ae),meta:null==e.meta?void 0:ni(e.meta)}}(e)}function oi(e){return function(e){if(null==e)return e;return{id:e.id,name:e.name,description:null==e.description?void 0:e.description,type:null==e.type?void 0:e.type,thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt),markedAt:null==e.markedAt?void 0:new Date(e.markedAt),jsPath:null==e.jsPath?void 0:e.jsPath,shareId:null==e.shareId?void 0:e.shareId,version:null==e.version?void 0:e.version}}(e)}function ri(e){return function(e){if(null==e)return e;return{items:null==e.items?void 0:e.items.map(oi),total:null==e.total?void 0:e.total,limit:null==e.limit?void 0:e.limit,offset:null==e.offset?void 0:e.offset}}(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{files:e.files.map(wt),apply:e.apply}}(e,!1)}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:Oe(e.data)}}(e)}function ui(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 li(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:ui(e.data)}}(e)}function ci(e){return function(e){if(null==e)return e;return{email:e.email}}(e,!1)}function pi(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 hi(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:pi(e.validationResult),compositionUpdated:null==e.compositionUpdated?void 0:e.compositionUpdated,realtimeUpdateSent:null==e.realtimeUpdateSent?void 0:e.realtimeUpdateSent}}(e)}function gi(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 fi(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 mi(e){return function(e){if(null==e)return e;return{data:null==e.data?void 0:fi(e.data),message:null==e.message?void 0:e.message,warnings:null==e.warnings?void 0:e.warnings}}(e)}function vi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:mi(e.data)}}(e)}function wi(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),message:null==e.message?void 0:e.message}}(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:Ae(e.data),message:null==e.message?void 0:e.message}}(e)}function Ii(e){return function(e){if(null==e)return e;return{cardId:e.cardId,selectedOptionIds:e.selectedOptionIds}}(e,!1)}function Ri(e){return function(e){if(null==e)return e;return{role:e.role,text:e.text}}(e,!1)}function Ti(e){return function(e){if(null==e)return e;return{message:e.message,history:null==e.history?void 0:e.history.map(Ri),answerToQuestion:Ii(e.answerToQuestion),currentSettings:e.currentSettings}}(e,!1)}function ki(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 Ai(e){return function(e){if(null==e)return e;return{pagination:null==e.pagination?void 0:ki(e.pagination)}}(e)}function Ci(e){return function(e){if(null==e)return e;return{success:e.success,data:e.data,meta:null==e.meta?void 0:Ai(e.meta)}}(e)}function qi(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 Si(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 bi(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Si(e.data)}}(e,!1)}function Ei(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 Ui(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 xi(e){return function(e){if(null==e)return e;return{event_type:e.event_type,data:Ui(e.data)}}(e,!1)}function _i(e){return function(e){if(null==e)return e;return{events:e.events.map(xi)}}(e,!1)}function Di(e){return function(e){if(null==e)return e;return{id:e.id,goalTarget:e.goalTarget}}(e,!1)}function Bi(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(Di),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 Mi(e){return function(e){if(null==e)return e;return{token:e.token,email:e.email}}(e,!1)}function Pi(e){return function(e){if(null==e)return e;return{repositoryId:null==e.repositoryId?void 0:e.repositoryId}}(e)}function Wi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Pi(e.data),meta:null==e.meta?void 0:e.meta}}(e)}function Ki(e){return function(e){if(null==e)return e;return{thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl}}(e)}function Oi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ki(e.data)}}(e)}function zi(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 Li(e){return function(e){if(null==e)return e;return{valid:e.valid,errors:null==e.errors?void 0:e.errors.map(mt),warnings:null==e.warnings?void 0:e.warnings.map(mt),sanitizedContent:null==e.sanitizedContent?void 0:e.sanitizedContent}}(e)}function $i(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 ji(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:$i(e.data)}}(e)}function Ni(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 Gi(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 Vi(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 Fi(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 Xi(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(Fi),warnings:null==e.warnings?void 0:e.warnings.map(Vi)}}(e)}function Hi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Xi(e.data)}}(e)}function Yi(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 Ji(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(Yi),recommendations:null==e.recommendations?void 0:e.recommendations}}(e)}function Zi(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:Ji(e.data)}}(e)}function Qi(e){return function(e){if(null==e)return e;return{composition_id:e.composition_id,name:e.name}}(e,!1)}function eo(e){return function(e){if(null==e)return e;return{variants:e.variants.map(Qi),success_metrics:e.success_metrics}}(e,!1)}function to(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(Fi),warnings:null==e.warnings?void 0:e.warnings.map(Vi)}}(e)}function no(e){return function(e){if(null==e)return e;return{success:null==e.success?void 0:e.success,data:null==e.data?void 0:to(e.data)}}(e)}var io="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 oo extends ce{assignVariantRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling assignVariant().');if(null==e.assignVariantRequest)throw new ge("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 we(i,(e=>ke(e)))}))}assignVariant(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.assignVariantRaw(e,t);return yield n.value()}))}checkWorkspaceABTestAutoStopRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling checkWorkspaceABTestAutoStop().');if(null==e.testId)throw new ge("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 we(i,(e=>Ye(e)))}))}checkWorkspaceABTestAutoStop(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.checkWorkspaceABTestAutoStopRaw(e,t);return yield n.value()}))}createABTestAssignmentRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.createABTestAssignmentRequest)throw new ge("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 we(i,(e=>bt(e)))}))}createABTestAssignment(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.createABTestAssignmentRaw(e,t);return yield n.value()}))}createWorkspaceABConversionWebhookRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>$t(e)))}))}createWorkspaceABConversionWebhook(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}createWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling createWorkspaceABTest().');if(null==e.createABTestRequest)throw new ge("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:Ut(e.createABTestRequest)},t);return new we(i,(e=>jt(e)))}))}createWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.createWorkspaceABTestRaw(e,t);return yield n.value()}))}deleteWorkspaceABConversionWebhookRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>Xt(e)))}))}deleteWorkspaceABConversionWebhook(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}deleteWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling deleteWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>Ht(e)))}))}deleteWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.deleteWorkspaceABTestRaw(e,t);return yield n.value()}))}getABTestConfigRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(n,(e=>on(e)))}))}getABTestConfig(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getABTestConfigRaw(e,t);return yield n.value()}))}getAvailableMetricsRaw(e){return io(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 we(n,(e=>un(e)))}))}getAvailableMetrics(e){return io(this,void 0,void 0,(function*(){const t=yield this.getAvailableMetricsRaw(e);return yield t.value()}))}getCompositionABGoalTargetsRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getCompositionABGoalTargets().');if(null==e.id)throw new ge("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 we(o,(e=>hn(e)))}))}getCompositionABGoalTargets(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getCompositionABGoalTargetsRaw(e,t);return yield n.value()}))}getVariantConfigRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(n,(e=>Gn(e)))}))}getVariantConfig(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getVariantConfigRaw(e,t);return yield n.value()}))}getWorkspaceABConversionWebhookRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>Jn(e)))}))}getWorkspaceABConversionWebhook(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABConversionWebhookRaw(e,t);return yield n.value()}))}getWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>jt(e)))}))}getWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestRaw(e,t);return yield n.value()}))}getWorkspaceABTestDiagnosisRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestDiagnosis().');if(null==e.testId)throw new ge("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 we(i,(e=>Zn(e)))}))}getWorkspaceABTestDiagnosis(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestDiagnosisRaw(e,t);return yield n.value()}))}getWorkspaceABTestStatisticsRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling getWorkspaceABTestStatistics().');if(null==e.testId)throw new ge("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 we(i,(e=>Qn(e)))}))}getWorkspaceABTestStatistics(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.getWorkspaceABTestStatisticsRaw(e,t);return yield n.value()}))}listWorkspaceABTestsRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(o,(e=>ii(e)))}))}listWorkspaceABTests(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceABTestsRaw(e,t);return yield n.value()}))}pauseWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling pauseWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>jt(e)))}))}pauseWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.pauseWorkspaceABTestRaw(e,t);return yield n.value()}))}rotateWorkspaceABConversionWebhookSecretRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("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 we(i,(e=>$t(e)))}))}rotateWorkspaceABConversionWebhookSecret(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.rotateWorkspaceABConversionWebhookSecretRaw(e,t);return yield n.value()}))}setWorkspaceABTestDurationRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling setWorkspaceABTestDuration().');if(null==e.setWorkspaceABTestDurationRequest)throw new ge("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 we(i,(e=>wi(e)))}))}setWorkspaceABTestDuration(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.setWorkspaceABTestDurationRaw(e,t);return yield n.value()}))}startWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling startWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>jt(e)))}))}startWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.startWorkspaceABTestRaw(e,t);return yield n.value()}))}stopWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling stopWorkspaceABTest().');if(null==e.testId)throw new ge("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 we(i,(e=>yi(e)))}))}stopWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.stopWorkspaceABTestRaw(e,t);return yield n.value()}))}trackABTestEventRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.trackABTestEventRequest)throw new ge("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:bi(e.trackABTestEventRequest)},t);return new we(i,(e=>qi(e)))}))}trackABTestEvent(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.trackABTestEventRaw(e,t);return yield n.value()}))}trackBulkABTestEventsRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.trackBulkABTestEventsRequest)throw new ge("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:_i(e.trackBulkABTestEventsRequest)},t);return new we(i,(e=>Ei(e)))}))}trackBulkABTestEvents(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.trackBulkABTestEventsRaw(e,t);return yield n.value()}))}updateWorkspaceABTestRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.testId)throw new ge("testId",'Required parameter "testId" was null or undefined when calling updateWorkspaceABTest().');if(null==e.updateABTestRequest)throw new ge("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:Bi(e.updateABTestRequest)},t);return new we(i,(e=>jt(e)))}))}updateWorkspaceABTest(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.updateWorkspaceABTestRaw(e,t);return yield n.value()}))}validateWorkspaceCompositionDeletionRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceCompositionDeletion().');if(null==e.validateWorkspaceCompositionDeletionRequest)throw new ge("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 we(i,(e=>Hi(e)))}))}validateWorkspaceCompositionDeletion(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceCompositionDeletionRaw(e,t);return yield n.value()}))}validateWorkspaceGoalTrackingRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceGoalTracking().');if(null==e.validateWorkspaceGoalTrackingRequest)throw new ge("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:eo(e.validateWorkspaceGoalTrackingRequest)},t);return new we(i,(e=>Zi(e)))}))}validateWorkspaceGoalTracking(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceGoalTrackingRaw(e,t);return yield n.value()}))}validateWorkspaceWidgetDeletionRaw(e,t){return io(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling validateWorkspaceWidgetDeletion().');if(null==e.validateWorkspaceWidgetDeletionRequest)throw new ge("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 we(i,(e=>no(e)))}))}validateWorkspaceWidgetDeletion(e,t){return io(this,void 0,void 0,(function*(){const n=yield this.validateWorkspaceWidgetDeletionRaw(e,t);return yield n.value()}))}}var ro="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 ao extends ce{createAnalyticsEventsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.createAnalyticsEventsRequest)throw new ge("createAnalyticsEventsRequest",'Required parameter "createAnalyticsEventsRequest" was null or undefined when calling createAnalyticsEvents().');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:Dt(e.createAnalyticsEventsRequest)},t);return new we(i,(e=>xt(e)))}))}createAnalyticsEvents(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.createAnalyticsEventsRaw(e,t);return yield n.value()}))}createCompositionAnalyticsEventRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionAnalyticsEvent().');if(null==e.newAnalyticsEvent)throw new ge("newAnalyticsEvent",'Required parameter "newAnalyticsEvent" was null or undefined when calling createCompositionAnalyticsEvent().');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:_t(e.newAnalyticsEvent)},t);return new we(i,(e=>je(e)))}))}createCompositionAnalyticsEvent(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.createCompositionAnalyticsEventRaw(e,t);return yield n.value()}))}flushAxiomEventsRaw(e){return ro(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 we(n,(e=>Ci(e)))}))}flushAxiomEvents(e){return ro(this,void 0,void 0,(function*(){const t=yield this.flushAxiomEventsRaw(e);return yield t.value()}))}getAxiomStatusRaw(e){return ro(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 we(n,(e=>Ci(e)))}))}getAxiomStatus(e){return ro(this,void 0,void 0,(function*(){const t=yield this.getAxiomStatusRaw(e);return yield t.value()}))}getCompositionAnalyticsDashboardRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionAnalyticsDashboard().');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 we(o,(e=>Ge(e)))}))}getCompositionAnalyticsDashboard(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionAnalyticsDashboardRaw(e,t);return yield n.value()}))}getCompositionAnalyticsEventsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionAnalyticsEvents().');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 we(o,(e=>gn(e)))}))}getCompositionAnalyticsEvents(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionAnalyticsEventsRaw(e,t);return yield n.value()}))}getCompositionDailyAnalyticsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDailyAnalytics().');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 we(o,(e=>vn(e)))}))}getCompositionDailyAnalytics(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionDailyAnalyticsRaw(e,t);return yield n.value()}))}getCompositionDeviceAnalyticsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDeviceAnalytics().');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 we(o,(e=>In(e)))}))}getCompositionDeviceAnalytics(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionDeviceAnalyticsRaw(e,t);return yield n.value()}))}getCompositionGeographyAnalyticsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionGeographyAnalytics().');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 we(o,(e=>Tn(e)))}))}getCompositionGeographyAnalytics(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionGeographyAnalyticsRaw(e,t);return yield n.value()}))}getCompositionMonthlyAnalyticsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionMonthlyAnalytics().');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 we(o,(e=>An(e)))}))}getCompositionMonthlyAnalytics(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionMonthlyAnalyticsRaw(e,t);return yield n.value()}))}getCompositionReferrerAnalyticsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionReferrerAnalytics().');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 we(o,(e=>qn(e)))}))}getCompositionReferrerAnalytics(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionReferrerAnalyticsRaw(e,t);return yield n.value()}))}getCompositionWeeklyAnalyticsRaw(e,t){return ro(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionWeeklyAnalytics().');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 we(o,(e=>En(e)))}))}getCompositionWeeklyAnalytics(e,t){return ro(this,void 0,void 0,(function*(){const n=yield this.getCompositionWeeklyAnalyticsRaw(e,t);return yield n.value()}))}}var so="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 uo extends ce{completeSignupRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.completeSignupRequest)throw new ge("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 ye(i)}))}completeSignup(e,t){return so(this,void 0,void 0,(function*(){yield this.completeSignupRaw(e,t)}))}confirmEmailRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("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:Mi(e.updateEmailRequest)},t);return new ye(i)}))}confirmEmail(e,t){return so(this,void 0,void 0,(function*(){yield this.confirmEmailRaw(e,t)}))}consumeOAuthSessionBridgeRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.bridgeId)throw new ge("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 ye(n)}))}consumeOAuthSessionBridge(e,t){return so(this,void 0,void 0,(function*(){yield this.consumeOAuthSessionBridgeRaw(e,t)}))}deleteAccountRaw(e,t){return so(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 ye(i)}))}deleteAccount(){return so(this,arguments,void 0,(function*(e={},t){yield this.deleteAccountRaw(e,t)}))}getSessionRaw(e){return so(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 ye(n)}))}getSession(e){return so(this,void 0,void 0,(function*(){yield this.getSessionRaw(e)}))}getUserMetadataRaw(e){return so(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 ye(n)}))}getUserMetadata(e){return so(this,void 0,void 0,(function*(){yield this.getUserMetadataRaw(e)}))}initiateOAuthRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.provider)throw new ge("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 ye(i)}))}initiateOAuth(e,t){return so(this,void 0,void 0,(function*(){yield this.initiateOAuthRaw(e,t)}))}loginUserRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.loginUserRequest)throw new ge("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 we(i,(e=>gi(e)))}))}loginUser(e,t){return so(this,void 0,void 0,(function*(){const n=yield this.loginUserRaw(e,t);return yield n.value()}))}logoutUserRaw(e){return so(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 ye(n)}))}logoutUser(e){return so(this,void 0,void 0,(function*(){yield this.logoutUserRaw(e)}))}logoutUserEverywhereRaw(e){return so(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-everywhere",method:"POST",headers:t,query:{}},e);return new ye(n)}))}logoutUserEverywhere(e){return so(this,void 0,void 0,(function*(){yield this.logoutUserEverywhereRaw(e)}))}refreshSessionRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.refreshSessionRequest)throw new ge("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 ye(i)}))}refreshSession(e,t){return so(this,void 0,void 0,(function*(){yield this.refreshSessionRaw(e,t)}))}resendConfirmationRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("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:ci(e.resetPasswordRequest)},t);return new ye(i)}))}resendConfirmation(e,t){return so(this,void 0,void 0,(function*(){yield this.resendConfirmationRaw(e,t)}))}resetPasswordRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.resetPasswordRequest)throw new ge("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:ci(e.resetPasswordRequest)},t);return new ye(i)}))}resetPassword(e,t){return so(this,void 0,void 0,(function*(){yield this.resetPasswordRaw(e,t)}))}signupUserRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.signupUserRequest)throw new ge("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 ye(i)}))}signupUser(e,t){return so(this,void 0,void 0,(function*(){yield this.signupUserRaw(e,t)}))}signupWithInvitationRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.signupWithInvitationRequest)throw new ge("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 ye(i)}))}signupWithInvitation(e,t){return so(this,void 0,void 0,(function*(){yield this.signupWithInvitationRaw(e,t)}))}updateEmailRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.updateEmailRequest)throw new ge("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:Mi(e.updateEmailRequest)},t);return new ye(i)}))}updateEmail(e,t){return so(this,void 0,void 0,(function*(){yield this.updateEmailRaw(e,t)}))}updateNameRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.updateNameRequest)throw new ge("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 ye(i)}))}updateName(e,t){return so(this,void 0,void 0,(function*(){yield this.updateNameRaw(e,t)}))}updatePasswordRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.updatePasswordRequest)throw new ge("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 ye(i)}))}updatePassword(e,t){return so(this,void 0,void 0,(function*(){yield this.updatePasswordRaw(e,t)}))}updateUserMetadataRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.updateUserMetadataRequest)throw new ge("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 ye(i)}))}updateUserMetadata(e,t){return so(this,void 0,void 0,(function*(){yield this.updateUserMetadataRaw(e,t)}))}validateInviteCodeRaw(e,t){return so(this,void 0,void 0,(function*(){if(null==e.code)throw new ge("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 we(i,(e=>ji(e)))}))}validateInviteCode(e,t){return so(this,void 0,void 0,(function*(){const n=yield this.validateInviteCodeRaw(e,t);return yield n.value()}))}}var lo="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 co extends ce{addAiAnswersKnowledgeDocumentRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeDocument().');if(null==e.addAiAnswersKnowledgeDocumentRequest)throw new ge("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 we(i,(e=>Ke(e)))}))}addAiAnswersKnowledgeDocument(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}addAiAnswersKnowledgeFileRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addAiAnswersKnowledgeFile().');if(null==e.file)throw new ge("file",'Required parameter "file" was null or undefined when calling addAiAnswersKnowledgeFile().');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=function(e){for(const t of e)if("multipart/form-data"===t.contentType)return!0;return!1}([{contentType:"multipart/form-data"}]);let o,r=!1;r=i,o=r?new FormData:new URLSearchParams,null!=e.file&&o.append("file",e.file),null!=e.title&&o.append("title",e.title);const a=yield this.request({path:"/compositions/{id}/adapters/ai-answers/knowledge/documents/file".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:o},t);return new we(a,(e=>Ke(e)))}))}addAiAnswersKnowledgeFile(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.addAiAnswersKnowledgeFileRaw(e,t);return yield n.value()}))}applyCompositionWidgetEmbedDefaultsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling applyCompositionWidgetEmbedDefaults().');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}/embed-settings/apply-widget-defaults".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{}},t);return new we(i,(e=>nt(e)))}))}applyCompositionWidgetEmbedDefaults(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.applyCompositionWidgetEmbedDefaultsRaw(e,t);return yield n.value()}))}checkCompositionAccessRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Fe(e)))}))}checkCompositionAccess(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.checkCompositionAccessRaw(e,t);return yield n.value()}))}createCompositionRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.newComposition)throw new ge("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 we(i,(e=>Mt(e)))}))}createComposition(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.createCompositionRaw(e,t);return yield n.value()}))}createCompositionContentItemRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling createCompositionContentItem().');if(null==e.createCompositionContentItemRequest)throw new ge("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:Pt(e.createCompositionContentItemRequest)},t);return new we(i,(e=>St(e)))}))}createCompositionContentItem(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.createCompositionContentItemRaw(e,t);return yield n.value()}))}createCompositionDatabaseRecordRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling createCompositionDatabaseRecord().');if(null==e.body)throw new ge("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 we(i,(e=>et(e)))}))}createCompositionDatabaseRecord(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.createCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 ye(i)}))}deleteComposition(e,t){return lo(this,void 0,void 0,(function*(){yield this.deleteCompositionRaw(e,t)}))}deleteCompositionContentItemRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling deleteCompositionContentItem().');if(null==e.itemId)throw new ge("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 we(i,(e=>Gt(e)))}))}deleteCompositionContentItem(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionContentItemRaw(e,t);return yield n.value()}))}deleteCompositionDataSourceRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>function(e){return null==e?e:{removed:e.removed}}(e)))}))}deleteCompositionDataSource(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDataSourceRaw(e,t);return yield n.value()}))}deleteCompositionDatabaseRecordRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling deleteCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("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 we(i,(e=>et(e)))}))}deleteCompositionDatabaseRecord(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}deleteCompositionEntryItemsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling deleteCompositionEntryItems().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling deleteCompositionEntryItems().');const n={};null!=e.ids&&(n.ids=e.ids),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}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"DELETE",headers:i,query:n},t);return new we(o,(e=>ct(e)))}))}deleteCompositionEntryItems(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.deleteCompositionEntryItemsRaw(e,t);return yield n.value()}))}describeCompositionEntriesRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>rt(e)))}))}describeCompositionEntries(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.describeCompositionEntriesRaw(e,t);return yield n.value()}))}duplicateCompositionRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Jt(e)))}))}duplicateComposition(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.duplicateCompositionRaw(e,t);return yield n.value()}))}exportCompositionEntryItemsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling exportCompositionEntryItems().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling exportCompositionEntryItems().');const n={};null!=e.format&&(n.format=e.format),null!=e.order&&(n.order=e.order),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}/export".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return this.isJsonMime(o.headers.get("content-type"))?new we(o):new Ie(o)}))}exportCompositionEntryItems(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.exportCompositionEntryItemsRaw(e,t);return yield n.value()}))}getAiAnswersKnowledgeRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>rn(e)))}))}getAiAnswersKnowledge(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getAiAnswersKnowledgeRaw(e,t);return yield n.value()}))}getAllCompositionsRaw(e,t){return lo(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 we(o,(e=>sn(e)))}))}getAllCompositions(){return lo(this,arguments,void 0,(function*(e={},t){const n=yield this.getAllCompositionsRaw(e,t);return yield n.value()}))}getCompositionByIdRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>fn(e)))}))}getCompositionById(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionByIdRaw(e,t);return yield n.value()}))}getCompositionContentRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getCompositionContent(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentRaw(e,t);return yield n.value()}))}getCompositionContentSchemaRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>mn(e)))}))}getCompositionContentSchema(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionContentSchemaRaw(e,t);return yield n.value()}))}getCompositionDataSourceRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Qe(e)))}))}getCompositionDataSource(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionDataSourceRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling getCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("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 we(i,(e=>et(e)))}))}getCompositionDatabaseRecord(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}getCompositionDatabaseRecordsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling getCompositionDatabaseRecords().');if(null==e.table)throw new ge("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 we(i,(e=>wn(e)))}))}getCompositionDatabaseRecords(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionDatabaseRecordsRaw(e,t);return yield n.value()}))}getCompositionDesignRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getCompositionDesign(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignRaw(e,t);return yield n.value()}))}getCompositionDesignSchemaRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>yn(e)))}))}getCompositionDesignSchema(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionDesignSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSchemaRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Rn(e)))}))}getCompositionEmbedSchema(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSchemaRaw(e,t);return yield n.value()}))}getCompositionEmbedSettingsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getCompositionEmbedSettings(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}getCompositionPreviewRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Cn(e)))}))}getCompositionPreview(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionPreviewRaw(e,t);return yield n.value()}))}getCompositionVersionsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Sn(e)))}))}getCompositionVersions(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionVersionsRaw(e,t);return yield n.value()}))}getCompositionsBatchRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.getCompositionsBatchRequest)throw new ge("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 we(i,(e=>xn(e)))}))}getCompositionsBatch(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.getCompositionsBatchRaw(e,t);return yield n.value()}))}listCompositionEntryItemsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling listCompositionEntryItems().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling listCompositionEntryItems().');const n={};null!=e.limit&&(n.limit=e.limit),null!=e.order&&(n.order=e.order),null!=e.since&&(n.since=e.since.toISOString()),null!=e.until&&(n.until=e.until.toISOString()),null!=e.cursor&&(n.cursor=e.cursor),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}/items".replace("{id}",encodeURIComponent(String(e.id))).replace("{table}",encodeURIComponent(String(e.table))),method:"GET",headers:i,query:n},t);return new we(o,(e=>gt(e)))}))}listCompositionEntryItems(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.listCompositionEntryItemsRaw(e,t);return yield n.value()}))}patchCompositionContentItemRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling patchCompositionContentItem().');if(null==e.list)throw new ge("list",'Required parameter "list" was null or undefined when calling patchCompositionContentItem().');if(null==e.itemId)throw new ge("itemId",'Required parameter "itemId" was null or undefined when calling patchCompositionContentItem().');if(null==e.requestBody)throw new ge("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 we(i,(e=>St(e)))}))}patchCompositionContentItem(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.patchCompositionContentItemRaw(e,t);return yield n.value()}))}planCompositionContentFromFilesRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling planCompositionContentFromFiles().');if(null==e.planCompositionContentFromFilesRequest)throw new ge("planCompositionContentFromFilesRequest",'Required parameter "planCompositionContentFromFilesRequest" was null or undefined when calling planCompositionContentFromFiles().');const n={"Content-Type":"application/json"};if(null!=e.ifMatch&&(n["If-Match"]=String(e.ifMatch)),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-items/from-files".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:si(e.planCompositionContentFromFilesRequest)},t);return new we(i,(e=>At(e)))}))}planCompositionContentFromFiles(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.planCompositionContentFromFilesRaw(e,t);return yield n.value()}))}putCompositionEmbedSettingsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling putCompositionEmbedSettings().');if(null==e.putCompositionEmbedSettingsRequest)throw new ge("putCompositionEmbedSettingsRequest",'Required parameter "putCompositionEmbedSettingsRequest" was null or undefined when calling putCompositionEmbedSettings().');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/{id}/embed-settings".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:(r=e.putCompositionEmbedSettingsRequest,o=r,null==o?o:{settings:o.settings})},t);var o,r;return new we(i,(e=>nt(e)))}))}putCompositionEmbedSettings(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.putCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}readCompositionEntriesRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling readCompositionEntries().');if(null==e.table)throw new ge("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 we(o,(e=>ut(e)))}))}readCompositionEntries(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.readCompositionEntriesRaw(e,t);return yield n.value()}))}removeAiAnswersKnowledgeDocumentRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeAiAnswersKnowledgeDocument().');if(null==e.documentId)throw new ge("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 we(i,(e=>di(e)))}))}removeAiAnswersKnowledgeDocument(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.removeAiAnswersKnowledgeDocumentRaw(e,t);return yield n.value()}))}resolveCompositionEmbedSettingsRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling resolveCompositionEmbedSettings().');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}/embed-settings/resolved".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:{}},t);return new we(i,(e=>nt(e)))}))}resolveCompositionEmbedSettings(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.resolveCompositionEmbedSettingsRaw(e,t);return yield n.value()}))}setCompositionDataSourceRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setCompositionDataSource().');if(null==e.setCompositionDataSourceRequest)throw new ge("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 we(i,(e=>Qe(e)))}))}setCompositionDataSource(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.setCompositionDataSourceRaw(e,t);return yield n.value()}))}setDynamicContentRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setDynamicContent().');if(null==e.setDynamicContentRequest)throw new ge("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 we(i,(e=>hi(e)))}))}setDynamicContent(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.setDynamicContentRaw(e,t);return yield n.value()}))}streamEmbedAssistantRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling streamEmbedAssistant().');if(null==e.streamEmbedAssistantRequest)throw new ge("streamEmbedAssistantRequest",'Required parameter "streamEmbedAssistantRequest" was null or undefined when calling streamEmbedAssistant().');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}/embed-assistant/stream".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:n,query:{},body:Ti(e.streamEmbedAssistantRequest)},t);return this.isJsonMime(i.headers.get("content-type"))?new we(i):new Ie(i)}))}streamEmbedAssistant(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.streamEmbedAssistantRaw(e,t);return yield n.value()}))}updateCompositionRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateComposition().');if(null==e.updateComposition)throw new ge("updateComposition",'Required parameter "updateComposition" was null or undefined when calling updateComposition().');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}".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 we(i,(e=>fn(e)))}))}updateComposition(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.updateCompositionRaw(e,t);return yield n.value()}))}updateCompositionDatabaseRecordRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.table)throw new ge("table",'Required parameter "table" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.recordId)throw new ge("recordId",'Required parameter "recordId" was null or undefined when calling updateCompositionDatabaseRecord().');if(null==e.body)throw new ge("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 we(i,(e=>et(e)))}))}updateCompositionDatabaseRecord(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.updateCompositionDatabaseRecordRaw(e,t);return yield n.value()}))}updateCompositionStatusRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateCompositionStatus().');if(null==e.updateCompositionStatusRequest)throw new ge("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 we(i,(e=>Ze(e)))}))}updateCompositionStatus(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.updateCompositionStatusRaw(e,t);return yield n.value()}))}validateCompositionContentRaw(e,t){return lo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling validateCompositionContent().');if(null==e.requestBody)throw new ge("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 we(i,(e=>Li(e)))}))}validateCompositionContent(e,t){return lo(this,void 0,void 0,(function*(){const n=yield this.validateCompositionContentRaw(e,t);return yield n.value()}))}}var po="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 ho extends ce{exchangeTokenRaw(e,t){return po(this,void 0,void 0,(function*(){if(null==e.exchangeTokenRequest)throw new ge("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 we(i,(e=>tn(e)))}))}exchangeToken(e,t){return po(this,void 0,void 0,(function*(){const n=yield this.exchangeTokenRaw(e,t);return yield n.value()}))}validateTokenRaw(e){return po(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 we(n,(e=>Gi(e)))}))}validateToken(e){return po(this,void 0,void 0,(function*(){const t=yield this.validateTokenRaw(e);return yield t.value()}))}}var go="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 fo extends ce{addLanguagesToTranslationRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling addLanguagesToTranslation().');if(null==e.addLanguagesToTranslationRequest)throw new ge("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 we(i,(e=>Be(e)))}))}addLanguagesToTranslation(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.addLanguagesToTranslationRaw(e,t);return yield n.value()}))}createTranslationRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.createTranslationRequest)throw new ge("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 we(i,(e=>Ot(e)))}))}createTranslation(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.createTranslationRaw(e,t);return yield n.value()}))}deleteTranslationRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Vt(e)))}))}deleteTranslation(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.deleteTranslationRaw(e,t);return yield n.value()}))}getLanguagePresetsRaw(e){return go(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/language-presets",method:"GET",headers:{},query:{}},e);return new we(t,(e=>Dn(e)))}))}getLanguagePresets(e){return go(this,void 0,void 0,(function*(){const t=yield this.getLanguagePresetsRaw(e);return yield t.value()}))}getSupportedLanguagesRaw(e){return go(this,void 0,void 0,(function*(){const t=yield this.request({path:"/translations/supported-languages",method:"GET",headers:{},query:{}},e);return new we(t,(e=>Pn(e)))}))}getSupportedLanguages(e){return go(this,void 0,void 0,(function*(){const t=yield this.getSupportedLanguagesRaw(e);return yield t.value()}))}getTranslationRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Wn(e)))}))}getTranslation(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.getTranslationRaw(e,t);return yield n.value()}))}getTranslationAnalyticsRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(o,(e=>Ln(e)))}))}getTranslationAnalytics(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.getTranslationAnalyticsRaw(e,t);return yield n.value()}))}getTranslationConfigRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(n,(e=>jn(e)))}))}getTranslationConfig(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.getTranslationConfigRaw(e,t);return yield n.value()}))}getTranslationsRaw(e,t){return go(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 we(o,(e=>Nn(e)))}))}getTranslations(){return go(this,arguments,void 0,(function*(e={},t){const n=yield this.getTranslationsRaw(e,t);return yield n.value()}))}removeLanguageFromTranslationRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling removeLanguageFromTranslation().');if(null==e.languageCode)throw new ge("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 we(i,(e=>Be(e)))}))}removeLanguageFromTranslation(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.removeLanguageFromTranslationRaw(e,t);return yield n.value()}))}retranslateExperimentRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Vt(e)))}))}retranslateExperiment(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.retranslateExperimentRaw(e,t);return yield n.value()}))}submitTranslationAnalyticsEventRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling submitTranslationAnalyticsEvent().');if(null==e.submitTranslationAnalyticsEventRequest)throw new ge("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 ye(i)}))}submitTranslationAnalyticsEvent(e,t){return go(this,void 0,void 0,(function*(){yield this.submitTranslationAnalyticsEventRaw(e,t)}))}updateTranslationStatusRaw(e,t){return go(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateTranslationStatus().');if(null==e.updateTranslationStatusRequest)throw new ge("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 we(i,(e=>Be(e)))}))}updateTranslationStatus(e,t){return go(this,void 0,void 0,(function*(){const n=yield this.updateTranslationStatusRaw(e,t);return yield n.value()}))}}var mo="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 vo extends ce{checkWidgetAccessRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Xe(e)))}))}checkWidgetAccess(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.checkWidgetAccessRaw(e,t);return yield n.value()}))}createCompositionFromWidgetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling createCompositionFromWidget().');if(null==e.createCompositionFromWidgetRequest)throw new ge("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 we(i,(e=>Kt(e)))}))}createCompositionFromWidget(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.createCompositionFromWidgetRaw(e,t);return yield n.value()}))}createWidgetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.newWidget)throw new ge("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 we(i,(e=>Lt(e)))}))}createWidget(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.createWidgetRaw(e,t);return yield n.value()}))}deleteWidgetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 ye(i)}))}deleteWidget(e,t){return mo(this,void 0,void 0,(function*(){yield this.deleteWidgetRaw(e,t)}))}detachWidgetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 ye(i)}))}detachWidget(e,t){return mo(this,void 0,void 0,(function*(){yield this.detachWidgetRaw(e,t)}))}duplicateWidgetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i,(e=>Qt(e)))}))}duplicateWidget(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.duplicateWidgetRaw(e,t);return yield n.value()}))}getWidgetContentSchemaRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getWidgetContentSchema(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.getWidgetContentSchemaRaw(e,t);return yield n.value()}))}getWidgetDesignSchemaRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("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 we(i)}))}getWidgetDesignSchema(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.getWidgetDesignSchemaRaw(e,t);return yield n.value()}))}getWidgetPublishHistoryRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("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 we(i,(e=>Fn(e)))}))}getWidgetPublishHistory(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.getWidgetPublishHistoryRaw(e,t);return yield n.value()}))}getWidgetsRaw(e,t){return mo(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 we(o,(e=>Hn(e)))}))}getWidgets(){return mo(this,arguments,void 0,(function*(e={},t){const n=yield this.getWidgetsRaw(e,t);return yield n.value()}))}getWidgetsBatchRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.getWidgetsBatchRequest)throw new ge("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 we(i,(e=>Yn(e)))}))}getWidgetsBatch(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.getWidgetsBatchRaw(e,t);return yield n.value()}))}listWidgetPresetsRaw(e){return mo(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:"/widgets/presets",method:"GET",headers:t,query:{}},e);return new we(n,(e=>ti(e)))}))}listWidgetPresets(e){return mo(this,void 0,void 0,(function*(){const t=yield this.listWidgetPresetsRaw(e);return yield t.value()}))}listWorkspaceWidgetTemplatesRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling listWorkspaceWidgetTemplates().');const n={};null!=e.search&&(n.search=e.search),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("apiKeyAuth",[]);t&&(i.Authorization=`Bearer ${t}`)}const o=yield this.request({path:"/workspaces/{workspaceId}/widgets/templates".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:i,query:n},t);return new we(o,(e=>ai(e)))}))}listWorkspaceWidgetTemplates(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.listWorkspaceWidgetTemplatesRaw(e,t);return yield n.value()}))}renameWidgetPublishHistoryTitleRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.version)throw new ge("version",'Required parameter "version" was null or undefined when calling renameWidgetPublishHistoryTitle().');if(null==e.renameWidgetPublishHistoryTitleRequest)throw new ge("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 we(i,(e=>li(e)))}))}renameWidgetPublishHistoryTitle(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.renameWidgetPublishHistoryTitleRaw(e,t);return yield n.value()}))}setWidgetPresetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling setWidgetPreset().');if(null==e.setWidgetPresetRequest)throw new ge("setWidgetPresetRequest",'Required parameter "setWidgetPresetRequest" was null or undefined when calling setWidgetPreset().');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/{id}/preset".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:n,query:{},body:(r=e.setWidgetPresetRequest,o=r,null==o?o:{isPreset:o.isPreset})},t);var o,r;return new we(i,(e=>gi(e)))}))}setWidgetPreset(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.setWidgetPresetRaw(e,t);return yield n.value()}))}setWidgetPublishHistoryLiveRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.widgetId)throw new ge("widgetId",'Required parameter "widgetId" was null or undefined when calling setWidgetPublishHistoryLive().');if(null==e.version)throw new ge("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 we(i,(e=>vi(e)))}))}setWidgetPublishHistoryLive(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.setWidgetPublishHistoryLiveRaw(e,t);return yield n.value()}))}updateWidgetRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidget().');if(null==e.updateWidgetRequest)throw new ge("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 ye(i)}))}updateWidget(e,t){return mo(this,void 0,void 0,(function*(){yield this.updateWidgetRaw(e,t)}))}updateWidgetRepositoryRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling updateWidgetRepository().');if(null==e.updateWidgetRepositoryRequest)throw new ge("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 we(i,(e=>Wi(e)))}))}updateWidgetRepository(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.updateWidgetRepositoryRaw(e,t);return yield n.value()}))}uploadWidgetThumbnailRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.id)throw new ge("id",'Required parameter "id" was null or undefined when calling uploadWidgetThumbnail().');if(null==e.uploadWidgetThumbnailRequest)throw new ge("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 we(i,(e=>Oi(e)))}))}uploadWidgetThumbnail(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.uploadWidgetThumbnailRaw(e,t);return yield n.value()}))}useWorkspaceWidgetTemplateRaw(e,t){return mo(this,void 0,void 0,(function*(){if(null==e.workspaceId)throw new ge("workspaceId",'Required parameter "workspaceId" was null or undefined when calling useWorkspaceWidgetTemplate().');if(null==e.templateId)throw new ge("templateId",'Required parameter "templateId" was null or undefined when calling useWorkspaceWidgetTemplate().');if(null==e.useWorkspaceWidgetTemplateRequest)throw new ge("useWorkspaceWidgetTemplateRequest",'Required parameter "useWorkspaceWidgetTemplateRequest" was null or undefined when calling useWorkspaceWidgetTemplate().');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:"/workspaces/{workspaceId}/widgets/templates/{templateId}/use".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{templateId}",encodeURIComponent(String(e.templateId))),method:"POST",headers:n,query:{},body:(r=e.useWorkspaceWidgetTemplateRequest,o=r,null==o?o:{projectId:o.projectId})},t);var o,r;return new we(i,(e=>zi(e)))}))}useWorkspaceWidgetTemplate(e,t){return mo(this,void 0,void 0,(function*(){const n=yield this.useWorkspaceWidgetTemplateRaw(e,t);return yield n.value()}))}}class wo extends Error{constructor(e,t,n){super(e),this.code=t,this.statusCode=n,this.name="AuthError"}}class yo{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 ue({basePath:this.config.apiUrl,apiKey:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${W}`}});return new ho(n)}createTokensApiForAccessToken(t){const n=new ue({basePath:this.config.apiUrl,accessToken:()=>e(this,void 0,void 0,(function*(){return t})),headers:{"X-SDK-Version":`embed-sdk/${W}`}});return new ho(n)}setApiKey(e){this.apiKey=e,this.currentToken={token:e,tokenType:"API-Key",expiresAt:null,scopes:[]},this.config.debug&&te.debug("AuthManager: API key set")}getValidToken(t){return e(this,void 0,void 0,(function*(){if(this.currentToken&&this.isTokenValid(this.currentToken)){if(yo.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 wo("No authentication method available","NO_AUTH_METHOD")}))}exchangeApiKeyForJWT(t){return e(this,void 0,void 0,(function*(){var e;if(!this.apiKey)throw new wo("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 wo("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&&te.info("AuthManager: Token exchanged successfully",{scopes:a.scopes,expiresAt:a.expiresAt}),a}catch(e){const t=e instanceof wo?e:new wo(`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(yo.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)?(yo.validatedTokens.add(this.currentToken.token),!0):(this.clearToken(),!1)}catch(e){return this.config.debug&&te.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&&yo.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&&te.info("AuthManager: Token refreshed automatically")}catch(e){this.config.debug&&te.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&&te.debug("AuthManager: Disposed")}}yo.validatedTokens=new Set;const Io=P,Ro={};let To=null,ko=null;const Ao={API_URL:O.PROD_API_URL,API_VERSION:O.VERSION,CLIENT_URL:O.PROD_CLIENT_URL,PRODUCTION_URL:O.PROD_CDN_URL,NODE_ENV:"production",ENABLE_EDITING:O.ENABLE_EDITING,API_KEY:Ro.PUBLIC_API_KEY,AXIOM_API_KEY:Ro.PUBLIC_AXIOM_API_KEY,STATSIG_KEY:Ro.PUBLIC_STATSIG_KEY};function Co(e){To=e}function qo(){return To}function So(){return ko||(ko=new yo({apiUrl:xo(),debug:Ko.enabled})),ko}function bo(e){So().setApiKey(e)}function Eo(){return e(this,void 0,void 0,(function*(){if(ko&&ko.hasAuthMethod())try{return yield ko.getValidToken()}catch(e){}if(To)return yield To.getToken();const e=Ao.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 Uo(e){const t=(null==e?void 0:e.tokenProvider)||To;if(!t){const t=(null==e?void 0:e.apiKey)||Ao.API_KEY;return{apiKey:t,basePath:(null==e?void 0:e.basePath)||xo(),tokenProvider:t?new re(t):void 0}}return{basePath:(null==e?void 0:e.basePath)||xo(),tokenProvider:t}}function xo(){return Ao.API_URL}function _o(){return Ao.PRODUCTION_URL}function Do(){return`${xo()}${Ao.API_VERSION}`}const Bo={isProduction:"production"===Ao.NODE_ENV,apiUrl:xo(),apiKey:Ao.API_KEY},Mo={renderMode:z,displayMode:L,resize:$,width:j,height:N,autoscale:G},Po={customElements:V.CUSTOM_ELEMENTS,http3:V.HTTP3,resizeObserver:V.RESIZE_OBSERVER},Wo={batchSize:F,loadTimeout:X,retryAttempts:H},Ko={enabled:B,logLevel:M},Oo={AXIOM_API_KEY:Ao.AXIOM_API_KEY||"",AXIOM_DATASET:i,AXIOM_API_ENDPOINT:n,STATSIG_API_KEY:Ao.STATSIG_KEY||"",STATSIG_API_ENDPOINT:o,ENABLE_PERFORMANCE_TRACKING:r,PERFORMANCE_SAMPLE_RATE:a,PERFORMANCE_REPORTING_ENDPOINT:d,LCP_THRESHOLD:u,LCP_WARNING_THRESHOLD:l,FID_THRESHOLD:c,FID_WARNING_THRESHOLD:p,CLS_THRESHOLD:h,CLS_WARNING_THRESHOLD:g,FCP_THRESHOLD:f,FCP_WARNING_THRESHOLD:m,TTFB_THRESHOLD:v,TTFB_WARNING_THRESHOLD:w,WIDGET_LOAD_THRESHOLD:y,WIDGET_LOAD_WARNING_THRESHOLD:I,BUNDLE_SIZE_THRESHOLD:R,BUNDLE_SIZE_WARNING_THRESHOLD:T,MAX_METRICS_BUFFER:s},zo={ROOT_MARGIN:k,THRESHOLD:A,MAX_CONCURRENT:C,RETRY_ATTEMPTS:q,RETRY_DELAY:S},Lo={MAX_PRELOAD_REQUESTS:b,PREFETCH_TIMEOUT:E,CACHE_DURATION:U,MAX_CONCURRENT_REQUESTS:x,DNS_PREFETCH_ENABLED:_,PRECONNECT_ENABLED:D},$o={DEBUG:B,LOG_LEVEL:M,VERSION:P};function jo(){return Uo()}var No=Object.freeze({__proto__:null,BROWSER_FEATURES:Po,DEBUG:Ko,DEFAULT_WIDGET_CONFIG:Mo,LAZY_LOADING_CONFIG:zo,PERFORMANCE:Wo,PERFORMANCE_CONFIG:Oo,RESOURCE_CONFIG:Lo,SDK_CONFIG:$o,VERSION:Io,config:Ao,createSdkConfig:Uo,environment:Bo,getApiUrl:xo,getAuthManager:So,getAuthToken:Eo,getCdnUrl:_o,getConfiguration:jo,getTokenProvider:qo,getVersionedApiUrl:Do,setApiKey:bo,setTokenProvider:Co});const Go="widgetic_session_id",Vo=new Map;let Fo=null;function Xo(e){var t;try{const t=localStorage.getItem(e);if(null!==t)return t}catch(e){}return null!==(t=Vo.get(e))&&void 0!==t?t:null}function Ho(e,t){Vo.set(e,t);try{localStorage.setItem(e,t)}catch(t){ee.debug("localStorage is not available; keeping the A/B test state in memory",{key:e,error:t})}}function Yo(e){Vo.delete(e);try{localStorage.removeItem(e)}catch(t){ee.debug("localStorage is not available; the value was only forgotten in memory",{key:e,error:t})}}function Jo(){const e=Xo(Go);return e||(Fo||(Fo=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(Go,Fo),Fo)}function Zo(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 Qo(e,t,n){if(!e||0===e.length)return null;const i=Zo(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 er(e,t){if(!e||!t)return!1;try{return null!==e.closest(t)}catch(e){return ee.warn("The goal target is not a selector this browser understands",{goalTarget:t,error:e}),!1}}export{yo as A,Jo as B,ue as C,Mo as D,ie as E,oe as F,Qo as G,No as H,Oo as P,ne as S,fo as T,Io as V,vo as W,Do as a,co as b,_o as c,Ao as d,ee as e,Ko as f,Eo as g,jo as h,bo as i,re as j,qo as k,te as l,xo as m,O as n,uo as o,Uo as p,Yo as q,Xo as r,Co as s,er as t,ao as u,wo as v,Ho as w,So as x,oo as y,Go as z};
|