@datocms/cma-client-browser 5.4.4 → 5.4.6
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/index.js +5 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
package/dist/browser/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
1
|
+
var es=Object.create;var Ei=Object.defineProperty;var ts=Object.getOwnPropertyDescriptor;var is=Object.getOwnPropertyNames;var rs=Object.getPrototypeOf,ss=Object.prototype.hasOwnProperty;var Ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nr=(t,e)=>{for(var i in e)Ei(t,i,{get:e[i],enumerable:!0})},ns=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of is(e))!ss.call(t,n)&&n!==i&&Ei(t,n,{get:()=>e[n],enumerable:!(r=ts(e,n))||r.enumerable});return t};var os=(t,e,i)=>(i=t!=null?es(rs(t)):{},ns(e||!t||!t.__esModule?Ei(i,"default",{value:t,enumerable:!0}):i,t));var Si=Ze(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.TaskCollisionStrategy=void 0;var ds;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.KEEP_THIS=1]="KEEP_THIS",t[t.KEEP_OTHER=2]="KEEP_OTHER",t[t.KEEP_BOTH=3]="KEEP_BOTH",t[t.RESOLVE_THIS=4]="RESOLVE_THIS",t[t.RESOLVE_OTHER=5]="RESOLVE_OTHER"})(ds=Ut.TaskCollisionStrategy||(Ut.TaskCollisionStrategy={}))});var zi=Ze(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});var Pi=class{constructor(e,i){this._code=e,this._message=i}get code(){return this._code}get message(){return this._message}};ki.default=Pi});var qi=Ze(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.mutexEquality=rt.mutexBitwiseAnd=void 0;function cs(t,e){return(t&e)!==0}rt.mutexBitwiseAnd=cs;function fs(t,e){return t===e}rt.mutexEquality=fs});var ur=Ze(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var Oi=class{constructor(e,i){this._meta=void 0,this._task=e,this._scheduler=i}withDescriptor(e){return this._descriptor=e,this}withMutex(e){return this._mutex=e,this}withMeta(e){return this._meta=e,this}runBeforeExecuting(e){return this._onPreExecute=e,this}handleCollisions(e){return this._onTaskCollision=e,this}execute(e){return this._scheduler.enqueue({priority:e,mutex:this._mutex,descriptor:this._descriptor,meta:this._meta,execute:this._task,onPreExecute:this._onPreExecute,onTaskCollision:this._onTaskCollision})}};Vi.default=Oi});var fr=Ze(Me=>{"use strict";var ps=Me&&Me.__awaiter||function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},cr=Me&&Me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Me,"__esModule",{value:!0});var M=Si(),hs=cr(zi()),ms=qi(),ys=cr(ur()),$;(function(t){t[t.PENDING=0]="PENDING",t[t.EXECUTING=1]="EXECUTING",t[t.TERMINATED=2]="TERMINATED"})($||($={}));function dr(t,e){for(let i of t.listeners)i.reject(e)}var Li=class{constructor(e,i={}){this._queue=[],this._isExecuting=!1,this._idleListeners=[],this._maxConcurrentTasks=e,this._samePriorityMutex=!!i.samePriorityMutex,this._mutexStrategy=i.mutexStrategy||ms.mutexEquality,i.disableLogging?this._errorLog=()=>{}:this._errorLog=console.error}enqueue(e){return new Promise((i,r)=>{typeof e=="function"&&(e={priority:0,execute:e});let n=this._checkMutexes(e,i,r);n.task?this._addTask(n.task):n.canceled&&r(this.createCanceledError())})}prepare(e){return new ys.default(e,this)}_addTask(e){this._queue.push(e),this._applyPriorities(),this._isExecuting||(this._isExecuting=!0,setTimeout(this._executeNextTasks.bind(this)))}get executingTasks(){return this._queue.reduce((e,i)=>i.state===$.EXECUTING?e+1:e,0)}createCanceledError(){return new hs.default(50,"Task has been canceled in favor of another task")}_findFirstPendingTask(){return this._queue.find(e=>e.state===$.PENDING)}_isIdle(){return this._queue.length===0||!this._queue.find(e=>e.state!==$.TERMINATED)}_removeTaskAt(e){this._queue.splice(e,1)}_executeTask(e){return ps(this,void 0,void 0,function*(){try{return e.task.onPreExecute&&e.task.onPreExecute(),yield e.task.execute()}catch(i){throw i}finally{e.state=$.TERMINATED;let i=this._queue.indexOf(e);this._removeTaskAt(i),this._executeNextTasks()}})}_executeNextTasks(){let e=this.executingTasks;if(e>=this._maxConcurrentTasks)return;let i=this._maxConcurrentTasks-e;for(let r=0;r<i;r++){let n=this._findFirstPendingTask();if(!n){this._isIdle()&&this._switchToIdle();return}n.state=$.EXECUTING,this._executeTask(n).then(s=>{for(let{resolve:o}of n.listeners)try{o(s)}catch(l){this._errorLog("An error occurred while resolving listener",l)}}).catch(s=>{for(let{reject:o}of n.listeners)try{o(s)}catch(l){this._errorLog("An error occurred while rejecting listener",l)}})}}_switchToIdle(){this._isExecuting=!1;let e=this._idleListeners;this._idleListeners=[];for(let{resolve:i}of e)try{i()}catch(r){}}waitForIdle(){return this._isExecuting?new Promise((e,i)=>{this._idleListeners.push({resolve:e,reject:i})}):Promise.resolve()}_applyPriorities(){this._queue.sort((e,i)=>i.task.priority-e.task.priority)}_checkMutexes(e,i,r){for(let n=0;n<this._queue.length;n++){let s=this._queue[n];if(s.state===$.TERMINATED||this._samePriorityMutex&&s.task.priority!=e.priority||!s.task.mutex||!e.mutex||!this._mutexStrategy(s.task.mutex,e.mutex))continue;let o,l;if(s.task.onTaskCollision)if(o=s.task.onTaskCollision(e),o===M.TaskCollisionStrategy.KEEP_OTHER&&s.state!==$.EXECUTING){this._removeTaskAt(n--),dr(s,this.createCanceledError());continue}else{if(o===M.TaskCollisionStrategy.KEEP_THIS)return{canceled:!0};if(o===M.TaskCollisionStrategy.RESOLVE_OTHER)return this._removeTaskAt(n--),{canceled:!1,task:{task:e,state:$.PENDING,listeners:[{resolve:i,reject:r},...s.listeners]}};if(o===M.TaskCollisionStrategy.RESOLVE_THIS)return s.listeners=[...s.listeners,{resolve:i,reject:r}],{canceled:!1}}if(e.onTaskCollision){if(l=e.onTaskCollision(s.task),l===M.TaskCollisionStrategy.KEEP_OTHER)return{canceled:!0};if(l===M.TaskCollisionStrategy.KEEP_THIS){this._removeTaskAt(n--),dr(s,this.createCanceledError());continue}else{if(l===M.TaskCollisionStrategy.RESOLVE_OTHER)return s.listeners=[...s.listeners,{resolve:i,reject:r}],{canceled:!1};if(l===M.TaskCollisionStrategy.RESOLVE_THIS)return this._removeTaskAt(n--),{canceled:!1,task:{task:e,state:$.PENDING,listeners:[{resolve:i,reject:r},...s.listeners]}}}}if(!(o===M.TaskCollisionStrategy.KEEP_BOTH&&l===M.TaskCollisionStrategy.KEEP_BOTH))return{canceled:!0}}return{canceled:!1,task:{task:e,state:$.PENDING,listeners:[{resolve:i,reject:r}]}}}};Me.default=Li});var mr=Ze(O=>{"use strict";var pr=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(O,"__esModule",{value:!0});O.mutexEquality=O.mutexBitwiseAnd=O.SchedulerError=O.TaskCollisionStrategy=O.Scheduler=void 0;var _s=pr(fr());O.Scheduler=_s.default;var gs=Si();Object.defineProperty(O,"TaskCollisionStrategy",{enumerable:!0,get:function(){return gs.TaskCollisionStrategy}});var ws=pr(zi());O.SchedulerError=ws.default;var hr=qi();Object.defineProperty(O,"mutexBitwiseAnd",{enumerable:!0,get:function(){return hr.mutexBitwiseAnd}});Object.defineProperty(O,"mutexEquality",{enumerable:!0,get:function(){return hr.mutexEquality}})});function or(t){return typeof t=="object"&&!!t&&"data"in t}function ls(t){return typeof t=="object"&&!!t&&"included"in t}function R({__itemTypeId:t,id:e,type:i,attributes:r,relationships:n,meta:s}){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t?{__itemTypeId:t}:{}),e?{id:e}:{}),i?{type:i}:{}),r||{}),n?Object.fromEntries(Object.entries(n).map(([o,l])=>[o,l==null?void 0:l.data])):{}),s?{meta:s}:{})}function c(t){if(!or(t))throw new Error("Invalid body!");return Array.isArray(t.data)?t.data.map(R):R(t.data)}function lr(t){return Boolean(t&&typeof t=="object"&&"type"in t&&t.type==="item")}function Fi(t){if(Array.isArray(t))return t.map(Fi);if(t&&typeof t=="object"){if(lr(t))return et(t);let e={};for(let[i,r]of Object.entries(t))e[i]=Fi(r);return e}return t}function et(t){if(!lr(t))return t;let e=t.attributes?Fi(t.attributes):t.attributes;return Object.assign(Object.assign({},t),{attributes:e,__itemTypeId:t.relationships.item_type.data.id})}function P(t){if(!or(t))throw new Error("Invalid body!");let e;Array.isArray(t.data)?e=t.data.map(et):e=et(t.data);let i;return ls(t)&&(i=t.included.map(et)),Object.assign(Object.assign(Object.assign({},t),{data:e}),i?{included:i}:{})}function as(t){if(typeof t!="object"||t===null||!("data"in t))return!1;let e=t;if(!Array.isArray(e.data))return!1;let i=e;if(i.data.length===0)return!1;let r=i.data[0];return!(typeof r!="object"||r===null||!("id"in r)||!("type"in r)||!("attributes"in r)||r.type!=="api_error")}var tt=class extends Error{constructor(e){super("API Error!"),Object.setPrototypeOf(this,new.target.prototype),"captureStackTrace"in Error?Error.captureStackTrace(this,A):this.stack=new Error().stack,this.request=e.request,this.preCallStack=e.preCallStack,this.message=`${e.request.method} ${e.request.url}: Timeout error`,this.preCallStack&&(this.stack+=`
|
|
2
2
|
Caused By:
|
|
3
|
-
${this.preCallStack}`)}},
|
|
3
|
+
${this.preCallStack}`)}},A=class extends Error{constructor(e){super("API Error!"),Object.setPrototypeOf(this,new.target.prototype),"captureStackTrace"in Error?Error.captureStackTrace(this,A):this.stack=new Error().stack,this.request=e.request,this.response=e.response,this.preCallStack=e.preCallStack;let i=`${e.request.method} ${e.request.url}: ${this.response.status} ${this.response.statusText}`;this.errors.length>0&&(i+=`
|
|
4
4
|
|
|
5
5
|
${JSON.stringify(this.errors,null,2)}`),this.message=i,this.preCallStack&&(this.stack+=`
|
|
6
6
|
Caused By:
|
|
7
|
-
${this.preCallStack}`)}get errors(){return ls(this.response.body)?this.response.body.data:[]}findError(e,i){let r=Array.isArray(e)?e:[e];return this.errors.find(n=>r.includes(n.attributes.code)&&(!i||(typeof i=="function"?i(n.attributes.details):Object.entries(i).every(([s,o])=>n.attributes.details[s]===o))))}};var C=class extends Error{constructor(){super("Promise canceled!"),Object.setPrototypeOf(this,new.target.prototype)}};function G(t,e){let i=null,r=new Promise((n,s)=>{i=()=>{try{e&&e(),s(new C)}catch(l){s(l)}},(typeof t=="function"?t():t).then(n,s)});return i&&(r.cancel=i),r}function it(t){return new Promise(e=>{setTimeout(e,t)})}var as=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function lr(t){return as(this,void 0,void 0,function*(){let e,i=0;do try{i+=1,yield it(i*1e3),e=yield t()}catch(r){if(!(r instanceof N)||r.response.status!==404)throw r}while(!e);return e})}var mr=ns(pr());var We=function(t){return this instanceof We?(this.v=t,this):new We(t)},ws=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof We?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}};function T(t,e,i,r){return ws(this,arguments,function*(){let s=(i==null?void 0:i.perPage)||t.defaultLimit;if(s>t.maxLimit)throw new Error(`perPage option cannot exceed maximum value of ${t.maxLimit}`);let o=(i==null?void 0:i.concurrency)||1;if(o>10)throw new Error("concurrency option cannot exceed maximum value of 10");let l=yield We(e({limit:s,offset:0}));for(let h of l.data)yield yield We(h);let f=l.meta.total_count,a=new mr.Scheduler(o),d=[];for(let h=s;h<f;h+=s)d.push(a.enqueue(()=>e({limit:s,offset:h})));for(;d.length>0;){let h=yield We(d.shift());for(let u of h.data)yield yield We(r?et(u):u)}})}function B(t){t&&"page"in t&&console.warn("Passing a `page` query param on paged iterators has no effect: use the `perPage` option instead.")}var yr="__ARRAY_INDEX__";function bs(t){return t.reduce((e,i,r)=>r===0?i:i===yr?`${e}[]`:`${e}[${i}]`,"")}function vs(t){if(typeof t=="number"||typeof t=="string")return t.toString();if(t===!0)return"true";if(t===!1)return"false";throw`Don't know how to serialize param value ${JSON.stringify(t)}`}function Nt(t,e=[]){let i=[];if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i.push([bs(e),vs(t)]);else if(typeof t=="object"){if(Array.isArray(t))for(let r of t)for(let n of Nt(r,[...e,yr]))i.push(n);else if(t)for(let[r,n]of Object.entries(t))for(let s of Nt(n,[...e,r]))i.push(s)}return i}var xs=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},Is=typeof window!="undefined"&&typeof window.document!="undefined",Us=5,L;(function(t){t[t.NONE=0]="NONE",t[t.BASIC=1]="BASIC",t[t.BODY=2]="BODY",t[t.BODY_AND_HEADERS=3]="BODY_AND_HEADERS"})(L||(L={}));function Rs(t){let e={};return t.forEach((i,r)=>{e[r]=i}),e}function _r(t,e,i,r,n,s,o){return{request:{url:e,method:t,headers:i,body:r},response:{status:n.status,statusText:n.statusText,headers:Rs(n.headers),body:s},preCallStack:o}}function Ts(t,e,i,r,n){return{request:{url:e,method:t,headers:i,body:r},preCallStack:n}}function Bs(t,e,i,r,n,s,o){return{request:{url:e,method:t,headers:i,body:r},response:{status:n,statusText:"N/A",headers:{},body:s},preCallStack:o}}function Es(t){return typeof t=="object"&&!!t&&"code"in t}function Fs(t){return Object.fromEntries(Object.entries(t).map(([e,i])=>[e.toLowerCase(),i]))}var gr=1;function Ss(t){let e=t||(typeof fetch=="undefined"?void 0:fetch)||(typeof globalThis=="undefined"?void 0:globalThis.fetch);if(typeof e=="undefined")throw new Error("fetch() is not available: either polyfill it globally, or provide it as fetchFn option.");return e}function Ut(t){var e;return xs(this,void 0,void 0,function*(){let i=gr;gr+=1;let r=Ss(t.fetchFn),n=t.preCallStack,s=t.userAgent||"@datocms/rest-client-utils",o=t.retryCount||1,l=t.logLevel||L.NONE,f="autoRetry"in t?t.autoRetry:!0,a=t.logFn||(()=>!0),d=Object.assign({"content-type":"application/json",accept:"application/json",authorization:`Bearer ${t.apiToken}`,"user-agent":s},t.extraHeaders?Fs(t.extraHeaders):{});Is&&delete d["user-agent"];let h=t.baseUrl.replace(/\/$/,""),u=t.body?JSON.stringify(t.body,null,2):void 0,m=t.queryParams&&Object.keys(t.queryParams).length>0?`?${new URLSearchParams(Nt(t.queryParams)).toString()}`:"",g=`${h}${t.url}${m}`;if(l>=L.BASIC){if(a(`[${i}] ${t.method} ${g}`),l>=L.BODY_AND_HEADERS)for(let[v,F]of Object.entries(d||{}))a(`[${i}] ${v}: ${F}`);l>=L.BODY&&u&&a(`[${i}] ${u}`)}try{let v=G(r(g,{method:t.method,headers:d,body:u})),F=setTimeout(()=>{v.cancel()},t.requestTimeout||3e4),U=yield v;clearTimeout(F);let A=U.headers.get("Content-Type"),K=A&&!A.includes("application/json");if(U.status===429||K){if(!f||K&&t.method!=="GET")throw new N(_r(t.method,g,d,t.body,U,void 0,n));let O=U.headers.has("X-RateLimit-Reset")?Number.parseInt(U.headers.get("X-RateLimit-Reset"),10):o;return l>=L.BASIC&&(U.status===429?a(`[${i}] Rate limit exceeded, wait ${O} seconds then retry...`):a(`[${i}] Invalid response content type "${A}" (status ${U.status}). Wait ${O} seconds then retry...`)),yield it(O*1e3),Ut(Object.assign(Object.assign({},t),{retryCount:o+1}))}if(l>=L.BASIC&&(a(`[${i}] Status: ${U.status} (${U.statusText})`),l>=L.BODY_AND_HEADERS))for(let O of["x-api-version","x-environment","x-queue-time","x-ratelimit-remaining","x-request-id","cf-ray"]){let rr=U.headers.get(O);rr&&a(`[${i}] ${O}: ${rr}`)}let Ge=U.status===204?void 0:yield U.json();if(l>=L.BODY&&Ge&&a(`[${i}] ${JSON.stringify(Ge,null,2)}`),U.status===202){let O=yield t.fetchJobResult(Ge.data.id);if(O.status<200||O.status>=300)throw new N(Bs(t.method,g,d,t.body,O.status,O.payload,n));Ge=O.payload}if(U.status>=200&&U.status<300)return Ge;let At=new N(_r(t.method,g,d,t.body,U,Ge,n)),ir=(e=At.errors.find(O=>O.attributes.transient))===null||e===void 0?void 0:e.attributes.code;if(f&&ir)return l>=L.BASIC&&a(`[${i}] ${ir}, wait ${o} seconds then retry...`),yield it(o*1e3),Ut(Object.assign(Object.assign({},t),{retryCount:o+1}));throw At}catch(v){if(v instanceof C||Es(v)&&v.code.includes("ETIMEDOUT")){if(f&&o<Us)return l>=L.BASIC&&a(`[${i}] Timeout error, wait ${o} seconds then retry...`),yield it(o*1e3),Ut(Object.assign(Object.assign({},t),{retryCount:o+1}));throw new tt(Ts(t.method,g,d,t.body,n))}throw v}})}var br=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};function Ct(t){return typeof t=="object"&&!!t&&"id"in t&&"type"in t}function Li(t){return Array.isArray(t)&&t.every(Ct)}function y(t,e){if(typeof t!="object"||!t)throw new Error("Invalid body!");if(Array.isArray(t))return{data:t.map(a=>{var d;return(d=y(a,e))===null||d===void 0?void 0:d.data})};let i=t,{id:r,type:n,meta:s}=i,o=br(i,["id","type","meta"]),l={},f={};if(e.attributes==="*")for(let[a,d]of Object.entries(o))if(e.relationships.includes(a))if(Ct(d)){let{id:h,type:u}=d;f[a]={data:{id:h,type:u}}}else Li(d)?f[a]={data:d.map(({id:h,type:u})=>({id:h,type:u}))}:f[a]={data:null};else l[a]=d;else if(e.relationships==="*")for(let[a,d]of Object.entries(o))if(e.attributes.includes(a))l[a]=d;else if(Ct(d)){let{id:h,type:u}=d;f[a]={data:{id:h,type:u}}}else Li(d)?f[a]={data:d.map(({id:h,type:u})=>({id:h,type:u}))}:f[a]={data:null};else{for(let[a,d]of Object.entries(o))if(e.attributes.includes(a))l[a]=d;else if(e.relationships.includes(a))if(Ct(d)){let{id:h,type:u}=d;f[a]={data:{id:h,type:u}}}else Li(d)?f[a]={data:d.map(({id:h,type:u})=>({id:h,type:u}))}:f[a]={data:null};e.attributes.includes("type")&&(l.type=n)}return{data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r||e.id?{id:r||e.id}:{}),{type:e.type}),Object.keys(l).length>0?{attributes:l}:{}),Object.keys(f).length>0?{relationships:f}:{}),s?{meta:s}:{})}}function Ai(t){if(Array.isArray(t))return t.map(Ai);if(t&&typeof t=="object"){let e={};for(let[i,r]of Object.entries(t))i!=="__itemTypeId"&&(e[i]=Ai(r));return e}return t}function wr(t){if(!t||typeof t!="object")return t;let{__itemTypeId:e}=t,i=br(t,["__itemTypeId"]),r={};for(let[n,s]of Object.entries(i))r[n]=Ai(s);return r}function Rt(t){return!t||!("data"in t)?t:Array.isArray(t.data)?Object.assign(Object.assign({},t),{data:t.data.map(wr)}):Object.assign(Object.assign({},t),{data:wr(t.data)})}function p(t){return typeof t=="string"?t:t.id}var w={};sr(w,{AccessToken:()=>le,AuditLogEvent:()=>Z,BuildEvent:()=>fe,BuildTrigger:()=>Re,DailyUsage:()=>Ve,EditingSession:()=>Se,EmojiSuggestions:()=>ze,Environment:()=>ve,Field:()=>se,Fieldset:()=>ne,Item:()=>j,ItemType:()=>re,ItemTypeFilter:()=>Be,ItemVersion:()=>pe,JobResult:()=>ue,MaintenanceMode:()=>xe,MenuItem:()=>ee,Plugin:()=>ae,PublicInfo:()=>Oe,Role:()=>Je,ScheduledPublication:()=>ge,ScheduledUnpublishing:()=>we,SchemaMenuItem:()=>te,SearchIndex:()=>Te,SearchIndexEvent:()=>he,SearchResult:()=>be,Session:()=>oe,Site:()=>Ce,SiteInvitation:()=>Fe,SsoGroup:()=>Pe,SsoSettings:()=>ke,SsoUser:()=>Q,SubscriptionFeature:()=>ce,SubscriptionLimit:()=>de,Upload:()=>me,UploadCollection:()=>ie,UploadFilter:()=>Ee,UploadRequest:()=>ye,UploadSmartTag:()=>Ne,UploadTag:()=>Ae,UploadTrack:()=>_e,UsageCounter:()=>Le,User:()=>X,Webhook:()=>Ie,WebhookCall:()=>Ue,WhiteLabelSettings:()=>qe,Workflow:()=>$e});var _=class{constructor(e){this.client=e}};var st=class extends _{create(e){return this.rawCreate(y(e,{type:"role",attributes:["name","can_edit_favicon","can_edit_site","can_edit_schema","can_manage_menu","can_edit_environment","can_promote_environments","environments_access","can_manage_users","can_manage_shared_filters","can_manage_search_indexes","can_manage_upload_collections","can_manage_build_triggers","can_manage_webhooks","can_manage_environments","can_manage_sso","can_access_audit_log","can_manage_workflows","can_manage_access_tokens","can_perform_site_search","can_access_build_events_log","can_access_search_index_events_log","positive_item_type_permissions","negative_item_type_permissions","positive_upload_permissions","negative_upload_permissions","positive_build_trigger_permissions","negative_build_trigger_permissions","positive_search_index_permissions","negative_search_index_permissions"],relationships:["inherits_permissions_from"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/roles",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"role",attributes:["name","can_edit_favicon","can_edit_site","can_edit_schema","can_manage_menu","can_edit_environment","can_promote_environments","environments_access","can_manage_users","can_manage_shared_filters","can_manage_search_indexes","can_manage_upload_collections","can_manage_build_triggers","can_manage_webhooks","can_manage_environments","can_manage_sso","can_access_audit_log","can_manage_workflows","can_manage_access_tokens","can_perform_site_search","can_access_build_events_log","can_access_search_index_events_log","positive_item_type_permissions","negative_item_type_permissions","positive_upload_permissions","negative_upload_permissions","positive_build_trigger_permissions","negative_build_trigger_permissions","positive_search_index_permissions","negative_search_index_permissions"],relationships:["inherits_permissions_from"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/roles/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/roles"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/roles/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/roles/${e}`})}duplicate(e){return this.rawDuplicate(p(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/roles/${e}/duplicate`})}};st.TYPE="role";var Ps=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function vr(t,e){return t==null&&e==null?!0:t===e}function ks(t,e){for(let i in t)if(!vr(t[i],e[i]))return!1;for(let i in e)if(!vr(t[i],e[i]))return!1;return!0}function $t(t,e,i,r){if(!e)return t;let{add:n,remove:s}=e;return[...s?s.reduce((o,l)=>{let f=Object.assign(Object.assign({},l),{environment:i}),a=o.find(d=>ks(d,f));if(!a)throw new Error(`Cannot find rule ${JSON.stringify(f)} to remove in ${r}!`);return o.filter(d=>d!==a)},t):t,...n?n.map(o=>Object.assign({environment:i},o)):[]]}var Je=class extends st{updateCurrentEnvironmentPermissions(e,i){return Ps(this,void 0,void 0,function*(){let r=this.client.config.environment||(yield this.client.environments.list()).find(f=>f.meta.primary).id,n=yield this.find(e),s=Boolean(i.positive_item_type_permissions||i.negative_item_type_permissions),o=Boolean(i.positive_upload_permissions||i.negative_upload_permissions),l=Object.assign(Object.assign({},s?{positive_item_type_permissions:$t(n.positive_item_type_permissions,i.positive_item_type_permissions,r,"positive_item_type_permissions"),negative_item_type_permissions:$t(n.negative_item_type_permissions,i.negative_item_type_permissions,r,"negative_item_type_permissions")}:{}),o?{positive_upload_permissions:$t(n.positive_upload_permissions,i.positive_upload_permissions,r,"positive_upload_permissions"),negative_upload_permissions:$t(n.negative_upload_permissions,i.negative_upload_permissions,r,"negative_upload_permissions")}:{});return this.update(e,l)})}};var X=class extends _{update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"user",attributes:["is_active"],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/users/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/users"})}find(e,i){return this.rawFind(p(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/users/${e}`,queryParams:i})}findMe(e){return this.rawFindMe(e).then(i=>c(i))}rawFindMe(e){return this.client.request({method:"GET",url:"/users/me",queryParams:e})}destroy(e,i){return this.rawDestroy(p(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/users/${e}`,queryParams:i})}};X.TYPE="user";var Q=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/sso-users"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/sso-users/${e}`})}copyUsers(){return this.rawCopyUsers().then(e=>c(e))}rawCopyUsers(){return this.client.request({method:"POST",url:"/sso-users/copy-users"})}destroy(e,i){return this.rawDestroy(p(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/sso-users/${e}`,queryParams:i})}};Q.TYPE="sso_user";var Z=class extends _{query(e){return this.rawQuery(y(e,{type:"audit_log_query",attributes:["since","before","filter","next_token","detailed_log"],relationships:[]})).then(i=>c(i))}rawQuery(e){return this.client.request({method:"POST",url:"/audit-log-events/query",body:e})}};Z.TYPE="audit_log_event";var ee=class extends _{create(e){return this.rawCreate(y(e,{type:"menu_item",attributes:["label","external_url","position","open_in_new_tab"],relationships:["item_type","item_type_filter","parent"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/menu-items",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"menu_item",attributes:["label","external_url","position","open_in_new_tab"],relationships:["item_type","item_type_filter","parent"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/menu-items/${e}`,body:i})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/menu-items",queryParams:e})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/menu-items/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/menu-items/${e}`})}reorder(e){return this.rawReorder(y(e,{type:"menu_item",attributes:["position"],relationships:["parent"]})).then(i=>c(i))}rawReorder(e){return this.client.request({method:"POST",url:"/menu-items/reorder",body:e})}};ee.TYPE="menu_item";var te=class extends _{create(e){return this.rawCreate(y(e,{type:"schema_menu_item",attributes:["label","position","kind"],relationships:["item_type","parent"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/schema-menu-items",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"schema_menu_item",attributes:["label","position","kind"],relationships:["item_type","parent","children"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/schema-menu-items/${e}`,body:i})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/schema-menu-items",queryParams:e})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/schema-menu-items/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/schema-menu-items/${e}`})}reorder(e){return this.rawReorder(y(e,{type:"schema_menu_item",attributes:["position"],relationships:["parent"]})).then(i=>c(i))}rawReorder(e){return this.client.request({method:"POST",url:"/schema-menu-items/reorder",body:e})}};te.TYPE="schema_menu_item";var ie=class extends _{create(e){return this.rawCreate(y(e,{type:"upload_collection",attributes:["label","position"],relationships:["parent"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-collections",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"upload_collection",attributes:["label","position"],relationships:["parent","children"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/upload-collections/${e}`,body:i})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/upload-collections",queryParams:e})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/upload-collections/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/upload-collections/${e}`})}reorder(e){return this.rawReorder(y(e,{type:"upload_collection",attributes:["position"],relationships:["parent"]})).then(i=>c(i))}rawReorder(e){return this.client.request({method:"POST",url:"/upload-collections/reorder",body:e})}};ie.TYPE="upload_collection";var re=class extends _{create(e,i){return this.rawCreate(y(e,{type:"item_type",attributes:["name","api_key","singleton","all_locales_required","sortable","modular_block","draft_mode_active","draft_saving_active","tree","ordering_direction","ordering_meta","collection_appeareance","collection_appearance","hint","inverse_relationships_enabled"],relationships:["ordering_field","presentation_title_field","presentation_image_field","title_field","image_preview_field","excerpt_field","workflow"]}),i).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:"/item-types",body:e,queryParams:i})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"item_type",attributes:["name","api_key","collection_appeareance","collection_appearance","singleton","all_locales_required","sortable","modular_block","draft_mode_active","draft_saving_active","tree","ordering_direction","ordering_meta","has_singleton_item","hint","inverse_relationships_enabled"],relationships:["ordering_field","presentation_title_field","presentation_image_field","title_field","image_preview_field","excerpt_field","workflow"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/item-types/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/item-types"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/item-types/${e}`})}duplicate(e){return this.rawDuplicate(p(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/item-types/${e}/duplicate`})}destroy(e,i){return this.rawDestroy(p(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/item-types/${e}`,queryParams:i})}referencing(e){return this.rawReferencing(p(e)).then(i=>c(i))}rawReferencing(e){return this.client.request({method:"GET",url:`/item-types/${e}/referencing`})}rawReorderFieldsAndFieldsets(e,i){return this.client.request({method:"POST",url:`/item-types/${e}/reorder-fields-and-fieldsets`,body:i})}};re.TYPE="item_type";var se=class extends _{create(e,i){return this.rawCreate(p(e),y(i,{type:"field",attributes:["label","field_type","api_key","localized","validators","appeareance","appearance","position","hint","default_value","deep_filtering_enabled"],relationships:["fieldset"]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/item-types/${e}/fields`,body:i})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"field",attributes:["default_value","label","api_key","localized","validators","appeareance","appearance","position","field_type","hint","deep_filtering_enabled"],relationships:["fieldset"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/fields/${e}`,body:i})}list(e){return this.rawList(p(e)).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:`/item-types/${e}/fields`})}referencing(e){return this.rawReferencing(p(e)).then(i=>c(i))}rawReferencing(e){return this.client.request({method:"GET",url:`/item-types/${e}/fields/referencing`})}related(e){return this.rawRelated(p(e)).then(i=>c(i))}rawRelated(e){return this.client.request({method:"GET",url:`/item-types/${e}/fields/related`})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/fields/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/fields/${e}`})}duplicate(e){return this.rawDuplicate(p(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/fields/${e}/duplicate`})}};se.TYPE="field";var ne=class extends _{create(e,i){return this.rawCreate(p(e),y(i,{type:"fieldset",attributes:["title","hint","position","collapsible","start_collapsed"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/item-types/${e}/fieldsets`,body:i})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"fieldset",attributes:["title","hint","position","collapsible","start_collapsed"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/fieldsets/${e}`,body:i})}list(e){return this.rawList(p(e)).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:`/item-types/${e}/fieldsets`})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/fieldsets/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/fieldsets/${e}`})}};ne.TYPE="fieldset";var oe=class extends _{create(e){return this.rawCreate(y(e,{type:"email_credentials",attributes:["email","password","otp_code"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/sessions",body:e})}};oe.TYPE="session";var le=class extends _{create(e){return this.rawCreate(y(e,{type:"access_token",attributes:["name","can_access_cda","can_access_cda_preview","can_access_cma"],relationships:["role"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/access_tokens",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"access_token",attributes:["name","can_access_cda","can_access_cda_preview","can_access_cma"],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/access_tokens/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/access_tokens"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/access_tokens/${e}`})}regenerateToken(e){return this.rawRegenerateToken(p(e)).then(i=>c(i))}rawRegenerateToken(e){return this.client.request({method:"POST",url:`/access_tokens/${e}/regenerate_token`})}destroy(e,i){return this.rawDestroy(p(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/access_tokens/${e}`,queryParams:i})}};le.TYPE="access_token";var ae=class extends _{create(e){return this.rawCreate(y(e,{type:"plugin",attributes:["package_name","name","description","url","permissions","plugin_type","field_types","parameter_definitions","package_version"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/plugins",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"plugin",attributes:["name","description","url","parameters","package_version","permissions"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/plugins/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/plugins"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/plugins/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/plugins/${e}`})}fields(e){return this.rawFields(p(e)).then(i=>c(i))}rawFields(e){return this.client.request({method:"GET",url:`/plugins/${e}/fields`})}};ae.TYPE="plugin";var ue=class extends _{find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/job-results/${e}`})}};ue.TYPE="job_result";var de=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/subscription-limits"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/subscription-limits/${e}`})}};de.TYPE="subscription_limit";var ce=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/subscription-features"})}};ce.TYPE="subscription_feature";var zs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},nt=function(t){return this instanceof nt?(this.v=t,this):new nt(t)},qs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof nt?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},fe=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/build-events",queryParams:e})}listPagedIterator(e,i){return qs(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=zs(this.rawListPagedIterator(e,i)),d;d=yield nt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield nt(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield nt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/build-events/${e}`})}};fe.TYPE="build_event";var Os=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ot=function(t){return this instanceof ot?(this.v=t,this):new ot(t)},Vs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof ot?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},he=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/search-index-events",queryParams:e})}listPagedIterator(e,i){return Vs(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Os(this.rawListPagedIterator(e,i)),d;d=yield ot(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ot(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield ot(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/search-index-events/${e}`})}};he.TYPE="search_index_event";var Ls=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},lt=function(t){return this instanceof lt?(this.v=t,this):new lt(t)},As=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof lt?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},j=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/items",queryParams:e}).then(P)}listPagedIterator(e,i){return As(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Ls(this.rawListPagedIterator(e,i)),d;d=yield lt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield lt(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield lt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i,!0)}validateExisting(e,i){return this.rawValidateExisting(p(e),y(i,{id:p(e),type:"item",attributes:"*",relationships:["item_type","creator"]}))}rawValidateExisting(e,i){return this.client.request({method:"POST",url:`/items/${e}/validate`,body:Rt(i)})}validateNew(e){return this.rawValidateNew(y(e,{type:"item",attributes:"*",relationships:["item_type","creator"]}))}rawValidateNew(e){return this.client.request({method:"POST",url:"/items/validate",body:Rt(e)})}create(e){return this.rawCreate(y(e,{type:"item",attributes:"*",relationships:["item_type","creator"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/items",body:Rt(e)}).then(P)}duplicate(e){return this.rawDuplicate(p(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/items/${e}/duplicate`}).then(P)}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"item",attributes:"*",relationships:["item_type","creator"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/items/${e}`,body:Rt(i)}).then(P)}references(e,i){return this.rawReferences(p(e),i).then(r=>c(r))}rawReferences(e,i){return this.client.request({method:"GET",url:`/items/${e}/references`,queryParams:i}).then(P)}find(e,i){return this.rawFind(p(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/items/${e}`,queryParams:i}).then(P)}currentVsPublishedState(e){return this.rawCurrentVsPublishedState(p(e)).then(i=>c(i))}rawCurrentVsPublishedState(e){return this.client.request({method:"GET",url:`/items/${e}/current-vs-published-state`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/items/${e}`}).then(P)}publish(e,i,r){return this.rawPublish(p(e),i?y(i,{type:"selective_publish_operation",attributes:["content_in_locales","non_localized_content"],relationships:[]}):null,r).then(n=>c(n))}rawPublish(e,i,r){return this.client.request({method:"PUT",url:`/items/${e}/publish`,body:i,queryParams:r}).then(P)}unpublish(e,i,r){return this.rawUnpublish(p(e),i?y(i,{type:"selective_unpublish_operation",attributes:["content_in_locales"],relationships:[]}):null,r).then(n=>c(n))}rawUnpublish(e,i,r){return this.client.request({method:"PUT",url:`/items/${e}/unpublish`,body:i,queryParams:r}).then(P)}bulkPublish(e){return this.rawBulkPublish(y(e,{type:"item_bulk_publish_operation",attributes:[],relationships:["items"]})).then(i=>c(i))}rawBulkPublish(e){return this.client.request({method:"POST",url:"/items/bulk/publish",body:e})}bulkUnpublish(e){return this.rawBulkUnpublish(y(e,{type:"item_bulk_unpublish_operation",attributes:[],relationships:["items"]})).then(i=>c(i))}rawBulkUnpublish(e){return this.client.request({method:"POST",url:"/items/bulk/unpublish",body:e})}bulkDestroy(e){return this.rawBulkDestroy(y(e,{type:"item_bulk_destroy_operation",attributes:[],relationships:["items"]})).then(i=>c(i))}rawBulkDestroy(e){return this.client.request({method:"POST",url:"/items/bulk/destroy",body:e})}bulkMoveToStage(e){return this.rawBulkMoveToStage(y(e,{type:"item_bulk_move_to_stage_operation",attributes:["stage"],relationships:["items"]})).then(i=>c(i))}rawBulkMoveToStage(e){return this.client.request({method:"POST",url:"/items/bulk/move-to-stage",body:e})}};j.TYPE="item";var Ns=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},at=function(t){return this instanceof at?(this.v=t,this):new at(t)},Cs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof at?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},pe=class extends _{restore(e){return this.rawRestore(p(e)).then(i=>c(i))}rawRestore(e){return this.client.request({method:"POST",url:`/versions/${e}/restore`})}list(e,i){return this.rawList(p(e),i).then(r=>c(r))}rawList(e,i){return this.client.request({method:"GET",url:`/items/${e}/versions`,queryParams:i})}listPagedIterator(e,i,r){return Cs(this,arguments,function*(){var s,o,l,f;try{for(var a=!0,d=Ns(this.rawListPagedIterator(p(e),i,r)),h;h=yield at(d.next()),s=h.done,!s;){f=h.value,a=!1;try{yield yield at(R(f))}finally{a=!0}}}catch(u){o={error:u}}finally{try{!a&&!s&&(l=d.return)&&(yield at(l.call(d)))}finally{if(o)throw o.error}}})}rawListPagedIterator(e,i,r){return B(i),T({defaultLimit:15,maxLimit:50},n=>this.rawList(e,Object.assign(Object.assign({},i),{page:n})),r)}find(e,i){return this.rawFind(p(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/versions/${e}`,queryParams:i})}};pe.TYPE="item_version";var $s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ut=function(t){return this instanceof ut?(this.v=t,this):new ut(t)},Ds=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof ut?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},me=class extends _{create(e){return this.rawCreate(y(e,{type:"upload",attributes:["path","copyright","author","notes","default_field_metadata","tags"],relationships:["upload_collection"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/uploads",body:e})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/uploads",queryParams:e})}listPagedIterator(e,i){return Ds(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=$s(this.rawListPagedIterator(e,i)),d;d=yield ut(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ut(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield ut(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/uploads/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/uploads/${e}`})}update(e,i,r){return this.rawUpdate(p(e),y(i,{id:p(e),type:"upload",attributes:["path","basename","copyright","author","notes","tags","default_field_metadata"],relationships:["creator","upload_collection"]}),r).then(n=>c(n))}rawUpdate(e,i,r){return this.client.request({method:"PUT",url:`/uploads/${e}`,body:i,queryParams:r})}references(e,i){return this.rawReferences(p(e),i).then(r=>c(r))}rawReferences(e,i){return this.client.request({method:"GET",url:`/uploads/${e}/references`,queryParams:i}).then(P)}bulkTag(e){return this.rawBulkTag(y(e,{type:"upload_bulk_tag_operation",attributes:["tags"],relationships:["uploads"]})).then(i=>c(i))}rawBulkTag(e){return this.client.request({method:"POST",url:"/uploads/bulk/tag",body:e})}bulkSetUploadCollection(e){return this.rawBulkSetUploadCollection(y(e,{type:"upload_bulk_set_upload_collection_operation",attributes:[],relationships:["upload_collection","uploads"]})).then(i=>c(i))}rawBulkSetUploadCollection(e){return this.client.request({method:"POST",url:"/uploads/bulk/set-upload-collection",body:e})}bulkDestroy(e){return this.rawBulkDestroy(y(e,{type:"upload_bulk_destroy_operation",attributes:[],relationships:["uploads"]})).then(i=>c(i))}rawBulkDestroy(e){return this.client.request({method:"POST",url:"/uploads/bulk/destroy",body:e})}};me.TYPE="upload";var ye=class extends _{create(e){return this.rawCreate(y(e,{type:"upload_request",attributes:["filename"],relationships:["upload_collection"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-requests",body:e})}};ye.TYPE="upload_request";var _e=class extends _{create(e,i){return this.rawCreate(p(e),y(i,{type:"upload_track",attributes:["url_or_upload_request_id","type","name","language_code","closed_captions"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/uploads/${e}/tracks`,body:i})}list(e){return this.rawList(p(e)).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:`/uploads/${e}/tracks`})}destroy(e,i){return this.rawDestroy(p(e),p(i)).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/uploads/${e}/tracks/${i}`})}generateSubtitles(e,i){return this.rawGenerateSubtitles(p(e),y(i,{type:"upload_track",attributes:["name","language_code"],relationships:[]})).then(r=>c(r))}rawGenerateSubtitles(e,i){return this.client.request({method:"POST",url:`/uploads/${e}/tracks/generate-subtitles`,body:i})}};_e.TYPE="upload_track";var ge=class extends _{create(e,i){return this.rawCreate(p(e),y(i,{type:"scheduled_publication",attributes:["publication_scheduled_at","selective_publication"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/items/${e}/scheduled-publication`,body:i})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/items/${e}/scheduled-publication`}).then(P)}};ge.TYPE="scheduled_publication";var we=class extends _{create(e,i){return this.rawCreate(p(e),y(i,{type:"scheduled_unpublishing",attributes:["unpublishing_scheduled_at","content_in_locales"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/items/${e}/scheduled-unpublishing`,body:i})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/items/${e}/scheduled-unpublishing`}).then(P)}};we.TYPE="scheduled_unpublishing";var js=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},dt=function(t){return this instanceof dt?(this.v=t,this):new dt(t)},Gs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof dt?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},be=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/search-results",queryParams:e})}listPagedIterator(e,i){return Gs(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=js(this.rawListPagedIterator(e,i)),d;d=yield dt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield dt(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield dt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:20,maxLimit:100},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}};be.TYPE="search_result";var ve=class extends _{fork(e,i,r){return this.rawFork(p(e),y(i,{id:p(e),type:"environment",attributes:[],relationships:[]}),r).then(n=>c(n))}rawFork(e,i,r){return this.client.request({method:"POST",url:`/environments/${e}/fork`,body:i,queryParams:r})}promote(e){return this.rawPromote(p(e)).then(i=>c(i))}rawPromote(e){return this.client.request({method:"PUT",url:`/environments/${e}/promote`})}rename(e,i){return this.rawRename(p(e),y(i,{id:p(e),type:"environment",attributes:[],relationships:[]})).then(r=>c(r))}rawRename(e,i){return this.client.request({method:"PUT",url:`/environments/${e}/rename`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/environments"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/environments/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/environments/${e}`})}};ve.TYPE="environment";var xe=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/maintenance-mode"})}activate(e){return this.rawActivate(e).then(i=>c(i))}rawActivate(e){return this.client.request({method:"PUT",url:"/maintenance-mode/activate",queryParams:e})}deactivate(){return this.rawDeactivate().then(e=>c(e))}rawDeactivate(){return this.client.request({method:"PUT",url:"/maintenance-mode/deactivate"})}};xe.TYPE="maintenance_mode";var Ie=class extends _{create(e){return this.rawCreate(y(e,{type:"webhook",attributes:["name","url","custom_payload","headers","events","http_basic_user","http_basic_password","enabled","payload_api_version","nested_items_in_payload","auto_retry"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/webhooks",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"webhook",attributes:["name","url","custom_payload","headers","events","http_basic_user","http_basic_password","enabled","payload_api_version","nested_items_in_payload","auto_retry"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/webhooks/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/webhooks"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/webhooks/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/webhooks/${e}`})}};Ie.TYPE="webhook";var Ms=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ct=function(t){return this instanceof ct?(this.v=t,this):new ct(t)},Ws=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof ct?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},Ue=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/webhook_calls",queryParams:e})}listPagedIterator(e,i){return Ws(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Ms(this.rawListPagedIterator(e,i)),d;d=yield ct(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ct(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield ct(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/webhook_calls/${e}`})}resendWebhook(e){return this.rawResendWebhook(p(e))}rawResendWebhook(e){return this.client.request({method:"POST",url:`/webhook_calls/${e}/resend_webhook`})}};Ue.TYPE="webhook_call";var Re=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/build-triggers"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/build-triggers/${e}`})}create(e){return this.rawCreate(y(e,{type:"build_trigger",attributes:["name","webhook_token","adapter","indexing_enabled","enabled","frontend_url","autotrigger_on_scheduled_publications","adapter_settings"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/build-triggers",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"build_trigger",attributes:["name","adapter","indexing_enabled","enabled","frontend_url","autotrigger_on_scheduled_publications","adapter_settings"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/build-triggers/${e}`,body:i})}trigger(e){return this.rawTrigger(p(e))}rawTrigger(e){return this.client.request({method:"POST",url:`/build-triggers/${e}/trigger`})}abort(e){return this.rawAbort(p(e))}rawAbort(e){return this.client.request({method:"DELETE",url:`/build-triggers/${e}/abort`})}abortIndexing(e){return this.rawAbortIndexing(p(e))}rawAbortIndexing(e){return this.client.request({method:"DELETE",url:`/build-triggers/${e}/abort_indexing`})}reindex(e){return this.rawReindex(p(e))}rawReindex(e){return this.client.request({method:"PUT",url:`/build-triggers/${e}/reindex`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/build-triggers/${e}`})}};Re.TYPE="build_trigger";var Te=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/search-indexes"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/search-indexes/${e}`})}create(e){return this.rawCreate(y(e,{type:"search_index",attributes:["name","enabled","frontend_url","user_agent_suffix"],relationships:["build_triggers"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/search-indexes",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"search_index",attributes:["name","enabled","frontend_url","user_agent_suffix"],relationships:["build_triggers"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/search-indexes/${e}`,body:i})}trigger(e){return this.rawTrigger(p(e))}rawTrigger(e){return this.client.request({method:"POST",url:`/search-indexes/${e}/trigger`})}abort(e){return this.rawAbort(p(e))}rawAbort(e){return this.client.request({method:"DELETE",url:`/search-indexes/${e}/abort`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/search-indexes/${e}`})}};Te.TYPE="search_index";var Be=class extends _{create(e){return this.rawCreate(y(e,{type:"item_type_filter",attributes:["name","filter","columns","order_by","shared"],relationships:["item_type"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/item-type-filters",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"item_type_filter",attributes:["name","columns","order_by","shared","filter"],relationships:["item_type"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/item-type-filters/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/item-type-filters"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/item-type-filters/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/item-type-filters/${e}`})}};Be.TYPE="item_type_filter";var Ee=class extends _{create(e){return this.rawCreate(y(e,{type:"upload_filter",attributes:["name","filter","shared"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-filters",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"upload_filter",attributes:["name","shared","filter"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/upload-filters/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/upload-filters"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/upload-filters/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/upload-filters/${e}`})}};Ee.TYPE="upload_filter";var Fe=class extends _{create(e){return this.rawCreate(y(e,{type:"site_invitation",attributes:["email"],relationships:["role"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/site-invitations",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"site_invitation",attributes:[],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/site-invitations/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/site-invitations"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/site-invitations/${e}`})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/site-invitations/${e}`})}resend(e){return this.rawResend(p(e)).then(i=>c(i))}rawResend(e){return this.client.request({method:"POST",url:`/site-invitations/${e}/resend`})}};Fe.TYPE="site_invitation";var Se=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/editing-sessions"})}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/editing-sessions/${e}`,body:i})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/editing-sessions/${e}`})}};Se.TYPE="editing_session";var Pe=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/sso-groups"})}copyRoles(e){return this.rawCopyRoles(p(e)).then(i=>c(i))}rawCopyRoles(e){return this.client.request({method:"POST",url:`/sso-groups/${e}/copy-roles`})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"sso_group",attributes:["priority"],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/sso-groups/${e}`,body:i})}destroy(e){return this.rawDestroy(p(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/sso-groups/${e}`})}};Pe.TYPE="sso_group";var ke=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/sso-settings"})}generateToken(){return this.rawGenerateToken().then(e=>c(e))}rawGenerateToken(){return this.client.request({method:"PUT",url:"/sso-settings/generate-token"})}update(e){return this.rawUpdate(y(e,{type:"sso_settings",attributes:["idp_saml_metadata_url","idp_saml_metadata_xml"],relationships:["default_role"]})).then(i=>c(i))}rawUpdate(e){return this.client.request({method:"PUT",url:"/sso-settings",body:e})}};ke.TYPE="sso_settings";var ze=class extends _{find(e){return this.rawFind(e).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:"/emoji-suggestions",queryParams:e})}};ze.TYPE="emoji_suggestions";var qe=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/white-label-settings"})}update(e){return this.rawUpdate(y(e,{type:"white_label_settings",attributes:["custom_i18n_messages_template_url"],relationships:[]})).then(i=>c(i))}rawUpdate(e){return this.client.request({method:"PUT",url:"/white-label-settings",body:e})}};qe.TYPE="white_label_settings";var Oe=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/public-info"})}};Oe.TYPE="public_info";var Ve=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/daily-site-usages"})}};Ve.TYPE="daily_usage";var Le=class extends _{find(e,i){return this.rawFind(p(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/usage-log-counters/${e}`,queryParams:i})}};Le.TYPE="usage_counter";var Js=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ft=function(t){return this instanceof ft?(this.v=t,this):new ft(t)},Ys=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof ft?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},Ae=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/upload-tags",queryParams:e})}listPagedIterator(e,i){return Ys(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Js(this.rawListPagedIterator(e,i)),d;d=yield ft(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ft(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield ft(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:50,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}create(e){return this.rawCreate(y(e,{type:"upload_tag",attributes:["name"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-tags",body:e})}};Ae.TYPE="upload_tag";var Hs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ht=function(t){return this instanceof ht?(this.v=t,this):new ht(t)},Ks=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof ht?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},Ne=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/upload-smart-tags",queryParams:e})}listPagedIterator(e,i){return Ks(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Hs(this.rawListPagedIterator(e,i)),d;d=yield ht(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ht(R(l))}finally{f=!0}}}catch(h){s={error:h}}finally{try{!f&&!n&&(o=a.return)&&(yield ht(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:50,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}};Ne.TYPE="upload_smart_tag";var Ce=class extends _{find(e){return this.rawFind(e).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:"/site",queryParams:e})}update(e){return this.rawUpdate(y(e,{type:"site",attributes:["no_index","favicon","global_seo","name","theme","locales","timezone","require_2fa","ip_tracking_enabled","force_use_of_sandbox_environments"],relationships:["sso_default_role"]})).then(i=>c(i))}rawUpdate(e){return this.client.request({method:"PUT",url:"/site",body:e})}activateImprovedTimezoneManagement(){return this.rawActivateImprovedTimezoneManagement().then(e=>c(e))}rawActivateImprovedTimezoneManagement(){return this.client.request({method:"PUT",url:"/site/activate-improved-timezone-management"})}activateImprovedHexManagement(){return this.rawActivateImprovedHexManagement().then(e=>c(e))}rawActivateImprovedHexManagement(){return this.client.request({method:"PUT",url:"/site/activate-improved-hex-management"})}activateImprovedGqlMultilocaleFields(){return this.rawActivateImprovedGqlMultilocaleFields().then(e=>c(e))}rawActivateImprovedGqlMultilocaleFields(){return this.client.request({method:"PUT",url:"/site/activate-improved-gql-multilocale-fields"})}activateImprovedGqlVisibilityControl(){return this.rawActivateImprovedGqlVisibilityControl().then(e=>c(e))}rawActivateImprovedGqlVisibilityControl(){return this.client.request({method:"PUT",url:"/site/activate-improved-gql-visibility-control"})}activateImprovedBooleanFields(){return this.rawActivateImprovedBooleanFields().then(e=>c(e))}rawActivateImprovedBooleanFields(){return this.client.request({method:"PUT",url:"/site/activate-improved-boolean-fields"})}activateDraftModeAsDefault(){return this.rawActivateDraftModeAsDefault().then(e=>c(e))}rawActivateDraftModeAsDefault(){return this.client.request({method:"PUT",url:"/site/activate-draft-mode-as-default"})}activateImprovedValidationAtPublishing(){return this.rawActivateImprovedValidationAtPublishing().then(e=>c(e))}rawActivateImprovedValidationAtPublishing(){return this.client.request({method:"PUT",url:"/site/activate-improved-validation-at-publishing"})}activateImprovedExposureOfInlineBlocksInCda(){return this.rawActivateImprovedExposureOfInlineBlocksInCda().then(e=>c(e))}rawActivateImprovedExposureOfInlineBlocksInCda(){return this.client.request({method:"PUT",url:"/site/activate-improved-exposure-of-inline-blocks-in-cda"})}activateImprovedItemsListing(){return this.rawActivateImprovedItemsListing().then(e=>c(e))}rawActivateImprovedItemsListing(){return this.client.request({method:"PUT",url:"/site/activate-improved-items-listing"})}activateMillisecondsInDatetime(){return this.rawActivateMillisecondsInDatetime().then(e=>c(e))}rawActivateMillisecondsInDatetime(){return this.client.request({method:"PUT",url:"/site/activate-milliseconds-in-datetime"})}updateAssetsCdnDefaultSettings(e){return this.rawUpdateAssetsCdnDefaultSettings(y(e,{type:"assets-cdn-default-settings",attributes:["assets_cdn_default_settings"],relationships:[]})).then(i=>c(i))}rawUpdateAssetsCdnDefaultSettings(e){return this.client.request({method:"PUT",url:"/site/assets-cdn-default-settings",body:e})}};Ce.TYPE="site";var $e=class extends _{create(e){return this.rawCreate(y(e,{type:"workflow",attributes:["name","api_key","stages"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/workflows",body:e})}update(e,i){return this.rawUpdate(p(e),y(i,{id:p(e),type:"workflow",attributes:["name","api_key","stages"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/workflows/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/workflows"})}find(e){return this.rawFind(p(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/workflows/${e}`})}destroy(e){return this.rawDestroy(p(e))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/workflows/${e}`})}};$e.TYPE="workflow";var Xs=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},De=class{constructor(e){this.config=e,this.roles=new Je(this),this.users=new X(this),this.ssoUsers=new Q(this),this.auditLogEvents=new Z(this),this.menuItems=new ee(this),this.schemaMenuItems=new te(this),this.uploadCollections=new ie(this),this.itemTypes=new re(this),this.fields=new se(this),this.fieldsets=new ne(this),this.session=new oe(this),this.accessTokens=new le(this),this.plugins=new ae(this),this.jobResults=new ue(this),this.subscriptionLimits=new de(this),this.subscriptionFeatures=new ce(this),this.buildEvents=new fe(this),this.searchIndexEvents=new he(this),this.items=new j(this),this.itemVersions=new pe(this),this.uploads=new me(this),this.uploadRequest=new ye(this),this.uploadTracks=new _e(this),this.scheduledPublication=new ge(this),this.scheduledUnpublishing=new we(this),this.searchResults=new be(this),this.environments=new ve(this),this.maintenanceMode=new xe(this),this.webhooks=new Ie(this),this.webhookCalls=new Ue(this),this.buildTriggers=new Re(this),this.searchIndexes=new Te(this),this.itemTypeFilters=new Be(this),this.uploadFilters=new Ee(this),this.siteInvitations=new Fe(this),this.editingSessions=new Se(this),this.ssoGroups=new Pe(this),this.ssoSettings=new ke(this),this.emojiSuggestions=new ze(this),this.whiteLabelSettings=new qe(this),this.publicInfo=new Oe(this),this.dailyUsages=new Ve(this),this.usageCounters=new Le(this),this.uploadTags=new Ae(this),this.uploadSmartTags=new Ne(this),this.site=new Ce(this),this.workflows=new $e(this)}get baseUrl(){return this.config.baseUrl||De.defaultBaseUrl}request(e){return Ut(Object.assign(Object.assign(Object.assign({},this.config),e),{logFn:this.config.logFn||console.log,userAgent:"@datocms/cma-client v5.4.4",baseUrl:this.baseUrl,preCallStack:new Error().stack,extraHeaders:Object.assign(Object.assign(Object.assign({},this.config.extraHeaders||{}),this.config.environment?{"X-Environment":this.config.environment}:{}),{"X-API-Version":"3"}),fetchJobResult:i=>this.jobResultsFetcher?this.jobResultsFetcher(i):lr(()=>this.jobResults.find(i))}))}eventsChannelName(){return Xs(this,void 0,void 0,function*(){if(this.cachedEventsChannelName)return this.cachedEventsChannelName;let{data:e}=yield this.site.rawFind();return this.cachedEventsChannelName=this.config.environment?`private-site-${e.id}-environment-${this.config.environment}`:`private-site-${e.id}`,this.cachedEventsChannelName})}};De.defaultBaseUrl="https://site-api.datocms.com";var je=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function Tt(t){return"attributes"in t?t.attributes.localized:t.localized}function b(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.keys(t);if(e.length===0)return!1;let i=/^[A-Za-z]{2,4}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?$/;return e.every(r=>i.test(r))}function Y(t,e){return Tt(e)?Object.entries(t).map(([r,n])=>({locale:r,value:n})):[{locale:void 0,value:t}]}function Bt(t,e){if(Tt(e))return Object.fromEntries(t.map(({locale:i,value:r})=>[i,r]));if(t.length===0)throw new Error("There must be at least one entry!");return t[0].value}function Qs(t,e,i){let n=Y(t,e).map(({locale:s,value:o})=>({locale:s,value:i(s,o)}));return Bt(n,e)}function Zs(t,e,i){return je(this,void 0,void 0,function*(){let r=Y(t,e),n=yield Promise.all(r.map(({locale:s,value:o})=>je(this,void 0,void 0,function*(){return{locale:s,value:yield i(s,o)}})));return Bt(n,e)})}function en(t,e,i){var r;let s=Y(t,e).filter(o=>i(o.locale,o.value));return Tt(e)?Bt(s,e):s.length>0?(r=s[0])===null||r===void 0?void 0:r.value:void 0}function tn(t,e,i){var r;return je(this,void 0,void 0,function*(){let n=Y(t,e),o=(yield Promise.all(n.map(({locale:l,value:f})=>je(this,void 0,void 0,function*(){return{locale:l,value:f,passed:yield i(l,f)}})))).filter(({passed:l})=>l).map(({locale:l,value:f})=>({locale:l,value:f}));return Tt(e)?Bt(o,e):o.length>0?(r=o[0])===null||r===void 0?void 0:r.value:void 0})}function xr(t,e,i){return Y(t,e).some(({locale:n,value:s})=>i(n,s))}function Ir(t,e,i){return je(this,void 0,void 0,function*(){let r=Y(t,e);return(yield Promise.all(r.map(({locale:s,value:o})=>i(s,o)))).some(s=>s)})}function rn(t,e,i){return!xr(t,e,(r,n)=>!i(r,n))}function sn(t,e,i){return je(this,void 0,void 0,function*(){return!(yield Ir(t,e,(r,n)=>je(this,void 0,void 0,function*(){return!(yield i(r,n))})))})}function nn(t,e,i){let r=Y(t,e);for(let{locale:n,value:s}of r)i(n,s)}function on(t,e,i){return je(this,void 0,void 0,function*(){let r=Y(t,e);yield Promise.all(r.map(({locale:n,value:s})=>i(n,s)))})}function Dt(t){return typeof t=="boolean"||t===null}function ln(t){return b(t)&&Object.values(t).every(Dt)}function jt(t){return t===null?!0:typeof t=="object"&&t!==null&&"red"in t&&"green"in t&&"blue"in t&&"alpha"in t}function an(t){return b(t)&&Object.values(t).every(jt)}function Gt(t){return t===null?!0:typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t)}function un(t){return b(t)&&Object.values(t).every(Gt)}function Mt(t){return t===null?!0:typeof t=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t)}function dn(t){return b(t)&&Object.values(t).every(Mt)}function pt(t){return t===null?!0:b(t)&&"upload_id"in t&&"alt"in t&&"title"in t&&"custom_data"in t&&"focal_point"in t}function mt(t){return t===null?!0:typeof t=="object"&&t!==null&&"upload_id"in t}function cn(t){return b(t)&&Object.values(t).every(pt)}function fn(t){return b(t)&&Object.values(t).every(mt)}function Wt(t){return typeof t=="number"||t===null}function hn(t){return b(t)&&Object.values(t).every(Wt)}function Jt(t){return Array.isArray(t)&&t.every(pt)}function Yt(t){return Array.isArray(t)&&t.every(mt)}function pn(t){return b(t)&&Object.values(t).every(Jt)}function mn(t){return b(t)&&Object.values(t).every(Yt)}function Ht(t){return typeof t=="number"||t===null}function yn(t){return b(t)&&Object.values(t).every(Ht)}function Kt(t){if(t===null)return!0;if(typeof t!="string")return!1;try{return JSON.parse(t),!0}catch(e){return!1}}function _n(t){return b(t)&&Object.values(t).every(Kt)}function Xt(t){return t===null?!0:typeof t=="object"&&t!==null&&"latitude"in t&&"longitude"in t}function gn(t){return b(t)&&Object.values(t).every(Xt)}var Qt,wn=new Uint8Array(16);function Ni(){if(!Qt&&(Qt=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qt(wn)}var S=[];for(let t=0;t<256;++t)S.push((t+256).toString(16).slice(1));function Ur(t,e=0){return S[t[e+0]]+S[t[e+1]]+S[t[e+2]]+S[t[e+3]]+"-"+S[t[e+4]]+S[t[e+5]]+"-"+S[t[e+6]]+S[t[e+7]]+"-"+S[t[e+8]]+S[t[e+9]]+"-"+S[t[e+10]]+S[t[e+11]]+S[t[e+12]]+S[t[e+13]]+S[t[e+14]]+S[t[e+15]]}var bn=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ci={randomUUID:bn};function vn(t,e,i){if(Ci.randomUUID&&!e&&!t)return Ci.randomUUID();t=t||{};let r=t.random||(t.rng||Ni)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){i=i||0;for(let n=0;n<16;++n)e[i+n]=r[n];return e}return Ur(r)}var $i=vn;function xn(t){return(typeof Buffer=="undefined"?btoa(Array.from(t,i=>String.fromCharCode(i)).join("")):Buffer.from(t).toString("base64")).replace(/\+/g,"-").replace(/\//g,"_").substring(0,22)}function In(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");return typeof Buffer=="undefined"?Uint8Array.from(atob(e),i=>i.charCodeAt(0)):new Uint8Array(Buffer.from(e,"base64"))}function M(t){if(/^\d+$/.test(t))return BigInt(t)<=0xffffffffffff;let e;try{e=In(t)}catch(n){return!1}return!(e.length!==16||(e.at(8)&192)!==128||e.at(6)>>4!==4)}function Un(){let t=$i(null,new Uint8Array(16));return t[0]=t[0]&127,xn(t)}function Zt(t){return typeof t=="string"&&M(t)||t===null}function Rn(t){return b(t)&&Object.values(t).every(Zt)}function ei(t){return Array.isArray(t)&&t.every(e=>typeof e=="string"&&M(e))}function Tn(t){return b(t)&&Object.values(t).every(ei)}function yt(t){return typeof t=="string"}function q(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="item"&&"attributes"in t&&"relationships"in t}function _t(t){return q(t)&&"id"in t&&typeof t.id=="string"}function ti(t){return typeof t=="string"&&M(t)||t===null}function Bn(t){return b(t)&&Object.values(t).every(ti)}function ii(t){return t===null||yt(t)?!0:q(t)}function En(t){return b(t)&&Object.values(t).every(ii)}function ri(t){return t===null?!0:_t(t)}function Fn(t){return b(t)&&Object.values(t).every(ri)}function si(t){return Array.isArray(t)&&t.every(e=>typeof e=="string"&&M(e))}function Sn(t){return b(t)&&Object.values(t).every(si)}function ni(t){return t===null?!0:Array.isArray(t)?t.every(e=>yt(e)?!0:q(e)):!1}function Pn(t){return b(t)&&Object.values(t).every(ni)}function oi(t){return Array.isArray(t)?t.every(e=>_t(e)):!1}function kn(t){return b(t)&&Object.values(t).every(oi)}function li(t){return t===null?!0:typeof t=="object"&&t!==null&&("title"in t||"description"in t||"image"in t||"twitter_card"in t||"no_index"in t)}function zn(t){return b(t)&&Object.values(t).every(li)}function ai(t){return t===null?!0:typeof t=="string"}function qn(t){return b(t)&&Object.values(t).every(ai)}function ui(t){return typeof t=="string"||t===null}function On(t){return b(t)&&Object.values(t).every(ui)}var k,z,di="blockquote",Et="block",hi="inlineBlock",Ft="code",St="heading",Di="inlineItem",pi="itemLink",mi="link",ci="listItem",gt="list",Ye="paragraph",ji="root",yi="span",fi="thematicBreak";var gc=(k={},k[di]=[Ye],k[Et]=[],k[hi]=[],k[Ft]=[],k[St]="inlineNodes",k[Di]=[],k[pi]="inlineNodes",k[mi]="inlineNodes",k[ci]=[Ye,gt],k[gt]=[ci],k[Ye]="inlineNodes",k[ji]=[di,Ft,gt,Ye,St,Et,fi],k[yi]=[],k[fi]=[],k);var wc=(z={},z[di]=["children","attribution"],z[Et]=["item"],z[hi]=["item"],z[Ft]=["language","highlight","code"],z[St]=["level","children","style"],z[Di]=["item"],z[pi]=["item","children","meta"],z[mi]=["url","children","meta"],z[ci]=["children"],z[gt]=["style","children"],z[Ye]=["children","style"],z[ji]=["children"],z[yi]=["value","marks"],z[fi]=[],z);function Rr(t){return"children"in t}function Tr(t){return t.type===St}function Br(t){return t.type===yi}function Er(t){return t.type===Ye}function Fr(t){return t.type===gt}function Pt(t){return t.type===Et}function kt(t){return t.type===hi}function Sr(t){return t.type===Ft}function Pr(t){return t.type===mi}function kr(t){return t.type===pi}function Vn(t){return Boolean(typeof t=="object"&&t)}function wt(t){return Boolean(Vn(t)&&"schema"in t&&"document"in t&&t.schema==="dast")}var Ln=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var r=Array(t),n=0,e=0;e<i;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,n++)r[n]=s[o];return r},An={MAX_WIDTH:80};function Nn(t){return Rr(t)}function Cn(t){return"(item: "+JSON.stringify(t)+")"}function $n(t){return wt(t)?t.document:t}function qr(t,e){e===void 0&&(e={});var i=$n(t),r=Or(i,e);return r.nodes&&r.nodes.length>0?r.nodes.length===1?r.nodes[0]:{label:"",nodes:r.nodes}:{label:""}}function Or(t,e){var i,r,n=(r=e.maxWidth)!==null&&r!==void 0?r:An.MAX_WIDTH,s=Math.max(20,n-8),o=Dn(t,e,s),l={label:o};if(Nn(t)){var f=t.children;if(f.length>0){l.nodes=[];for(var a=0,d=f;a<d.length;a++){var h=d[a];l.nodes.push(Or(h,e))}}}if((Pt(t)||kt(t))&&e.blockFormatter){var u=e.blockFormatter(t.item,s);typeof u!="string"&&(l.nodes||(l.nodes=[]),Array.isArray(u)?(i=l.nodes).push.apply(i,u):l.nodes.push(u))}return l}function Dn(t,e,i){var r=[],n="";if(Br(t))t.marks&&t.marks.length>0&&r.push("marks: "+t.marks.join(", ")),n=' "'+zr(t.value,i)+'"';else if(Sr(t))t.language&&r.push('language: "'+t.language+'"'),n=' "'+zr(t.code,i)+'"';else if(Tr(t))r.push("level: "+t.level);else if(Fr(t))r.push("style: "+t.style);else if(Pr(t)){if(r.push('url: "'+t.url+'"'),t.meta&&t.meta.length>0){var s=t.meta.map(function(d){return d.id+'="'+d.value+'"'}).join(", ");r.push("meta: {"+s+"}")}}else if(kr(t)){if(r.push('item: "'+t.item+'"'),t.meta&&t.meta.length>0){var s=t.meta.map(function(h){return h.id+'="'+h.value+'"'}).join(", ");r.push("meta: {"+s+"}")}}else if(Pt(t)||kt(t)){var o=e.blockFormatter||Cn,l=o(t.item,i);if(typeof l=="string"){var f=l.replace(/\n/g," ").trim();n=" "+f}}else Er(t)&&t.style&&r.push('style: "'+t.style+'"');var a=r.length>0?" ("+r.join(", ")+")":"";return""+t.type+a+n}function zr(t,e){return t.length<=e?t:t.substring(0,e-3)+"..."}function Vr(t){var e=typeof t=="string"?{label:t}:t,i=[];function r(n,s,o){var l=n.label.trim(),f=n.nodes||[];if(!l&&f.length>0){f.forEach(function(g,v){var F=v===f.length-1;r(g,s,F)});return}var a=s.map(function(g){return g?"\u2502 ":" "}).join(""),d=o?"\u2514":"\u251C",h=l.split(`
|
|
8
|
-
`);i.push(""+a+d+" "+
|
|
7
|
+
${this.preCallStack}`)}get errors(){return as(this.response.body)?this.response.body.data:[]}findError(e,i){let r=Array.isArray(e)?e:[e];return this.errors.find(n=>r.includes(n.attributes.code)&&(!i||(typeof i=="function"?i(n.attributes.details):Object.entries(i).every(([s,o])=>n.attributes.details[s]===o))))}};var N=class extends Error{constructor(){super("Promise canceled!"),Object.setPrototypeOf(this,new.target.prototype)}};function j(t,e){let i=null,r=new Promise((n,s)=>{i=()=>{try{e&&e(),s(new N)}catch(l){s(l)}},(typeof t=="function"?t():t).then(n,s)});return i&&(r.cancel=i),r}function it(t){return new Promise(e=>{setTimeout(e,t)})}var us=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function ar(t){return us(this,void 0,void 0,function*(){let e,i=0;do try{i+=1,yield it(i*1e3),e=yield t()}catch(r){if(!(r instanceof A)||r.response.status!==404)throw r}while(!e);return e})}var yr=os(mr());var We=function(t){return this instanceof We?(this.v=t,this):new We(t)},bs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof We?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}};function T(t,e,i,r){return bs(this,arguments,function*(){let s=(i==null?void 0:i.perPage)||t.defaultLimit;if(s>t.maxLimit)throw new Error(`perPage option cannot exceed maximum value of ${t.maxLimit}`);let o=(i==null?void 0:i.concurrency)||1;if(o>10)throw new Error("concurrency option cannot exceed maximum value of 10");let l=yield We(e({limit:s,offset:0}));for(let p of l.data)yield yield We(p);let f=l.meta.total_count,a=new yr.Scheduler(o),d=[];for(let p=s;p<f;p+=s)d.push(a.enqueue(()=>e({limit:s,offset:p})));for(;d.length>0;){let p=yield We(d.shift());for(let u of p.data)yield yield We(r?et(u):u)}})}function B(t){t&&"page"in t&&console.warn("Passing a `page` query param on paged iterators has no effect: use the `perPage` option instead.")}var _r="__ARRAY_INDEX__";function vs(t){return t.reduce((e,i,r)=>r===0?i:i===_r?`${e}[]`:`${e}[${i}]`,"")}function xs(t){if(typeof t=="number"||typeof t=="string")return t.toString();if(t===!0)return"true";if(t===!1)return"false";throw`Don't know how to serialize param value ${JSON.stringify(t)}`}function Ct(t,e=[]){let i=[];if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i.push([vs(e),xs(t)]);else if(typeof t=="object"){if(Array.isArray(t))for(let r of t)for(let n of Ct(r,[...e,_r]))i.push(n);else if(t)for(let[r,n]of Object.entries(t))for(let s of Ct(n,[...e,r]))i.push(s)}return i}var Is=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},Us=typeof window!="undefined"&&typeof window.document!="undefined",Rs=5,V;(function(t){t[t.NONE=0]="NONE",t[t.BASIC=1]="BASIC",t[t.BODY=2]="BODY",t[t.BODY_AND_HEADERS=3]="BODY_AND_HEADERS"})(V||(V={}));function Ts(t){let e={};return t.forEach((i,r)=>{e[r]=i}),e}function gr(t,e,i,r,n,s,o){return{request:{url:e,method:t,headers:i,body:r},response:{status:n.status,statusText:n.statusText,headers:Ts(n.headers),body:s},preCallStack:o}}function Bs(t,e,i,r,n){return{request:{url:e,method:t,headers:i,body:r},preCallStack:n}}function Es(t,e,i,r,n,s,o){return{request:{url:e,method:t,headers:i,body:r},response:{status:n,statusText:"N/A",headers:{},body:s},preCallStack:o}}function Fs(t){return typeof t=="object"&&!!t&&"code"in t}function Ss(t){return Object.fromEntries(Object.entries(t).map(([e,i])=>[e.toLowerCase(),i]))}var wr=1;function Ps(t){let e=t||(typeof fetch=="undefined"?void 0:fetch)||(typeof globalThis=="undefined"?void 0:globalThis.fetch);if(typeof e=="undefined")throw new Error("fetch() is not available: either polyfill it globally, or provide it as fetchFn option.");return e}function Rt(t){var e;return Is(this,void 0,void 0,function*(){let i=wr;wr+=1;let r=Ps(t.fetchFn),n=t.preCallStack,s=t.userAgent||"@datocms/rest-client-utils",o=t.retryCount||1,l=t.logLevel||V.NONE,f="autoRetry"in t?t.autoRetry:!0,a=t.logFn||(()=>!0),d=Object.assign({"content-type":"application/json",accept:"application/json",authorization:`Bearer ${t.apiToken}`,"user-agent":s},t.extraHeaders?Ss(t.extraHeaders):{});Us&&delete d["user-agent"];let p=t.baseUrl.replace(/\/$/,""),u=t.body?JSON.stringify(t.body,null,2):void 0,m=t.queryParams&&Object.keys(t.queryParams).length>0?`?${new URLSearchParams(Ct(t.queryParams)).toString()}`:"",g=`${p}${t.url}${m}`;if(l>=V.BASIC){if(a(`[${i}] ${t.method} ${g}`),l>=V.BODY_AND_HEADERS)for(let[v,F]of Object.entries(d||{}))a(`[${i}] ${v}: ${F}`);l>=V.BODY&&u&&a(`[${i}] ${u}`)}try{let v=j(r(g,{method:t.method,headers:d,body:u})),F=setTimeout(()=>{v.cancel()},t.requestTimeout||3e4),U=yield v;clearTimeout(F);let L=U.headers.get("Content-Type"),K=L&&!L.includes("application/json");if(U.status===429||K){if(!f||K&&t.method!=="GET")throw new A(gr(t.method,g,d,t.body,U,void 0,n));let q=U.headers.has("X-RateLimit-Reset")?Number.parseInt(U.headers.get("X-RateLimit-Reset"),10):o;return l>=V.BASIC&&(U.status===429?a(`[${i}] Rate limit exceeded, wait ${q} seconds then retry...`):a(`[${i}] Invalid response content type "${L}" (status ${U.status}). Wait ${q} seconds then retry...`)),yield it(q*1e3),Rt(Object.assign(Object.assign({},t),{retryCount:o+1}))}if(l>=V.BASIC&&(a(`[${i}] Status: ${U.status} (${U.statusText})`),l>=V.BODY_AND_HEADERS))for(let q of["x-api-version","x-environment","x-queue-time","x-ratelimit-remaining","x-request-id","cf-ray"]){let sr=U.headers.get(q);sr&&a(`[${i}] ${q}: ${sr}`)}let Ge=U.status===204?void 0:yield U.json();if(l>=V.BODY&&Ge&&a(`[${i}] ${JSON.stringify(Ge,null,2)}`),U.status===202){let q=yield t.fetchJobResult(Ge.data.id);if(q.status<200||q.status>=300)throw new A(Es(t.method,g,d,t.body,q.status,q.payload,n));Ge=q.payload}if(U.status>=200&&U.status<300)return Ge;let Nt=new A(gr(t.method,g,d,t.body,U,Ge,n)),rr=(e=Nt.errors.find(q=>q.attributes.transient))===null||e===void 0?void 0:e.attributes.code;if(f&&rr)return l>=V.BASIC&&a(`[${i}] ${rr}, wait ${o} seconds then retry...`),yield it(o*1e3),Rt(Object.assign(Object.assign({},t),{retryCount:o+1}));throw Nt}catch(v){if(v instanceof N||Fs(v)&&v.code.includes("ETIMEDOUT")){if(f&&o<Rs)return l>=V.BASIC&&a(`[${i}] Timeout error, wait ${o} seconds then retry...`),yield it(o*1e3),Rt(Object.assign(Object.assign({},t),{retryCount:o+1}));throw new tt(Bs(t.method,g,d,t.body,n))}throw v}})}var vr=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};function $t(t){return typeof t=="object"&&!!t&&"id"in t&&"type"in t}function Ai(t){return Array.isArray(t)&&t.every($t)}function y(t,e){if(typeof t!="object"||!t)throw new Error("Invalid body!");if(Array.isArray(t))return{data:t.map(a=>{var d;return(d=y(a,e))===null||d===void 0?void 0:d.data})};let i=t,{id:r,type:n,meta:s}=i,o=vr(i,["id","type","meta"]),l={},f={};if(e.attributes==="*")for(let[a,d]of Object.entries(o))if(e.relationships.includes(a))if($t(d)){let{id:p,type:u}=d;f[a]={data:{id:p,type:u}}}else Ai(d)?f[a]={data:d.map(({id:p,type:u})=>({id:p,type:u}))}:f[a]={data:null};else l[a]=d;else if(e.relationships==="*")for(let[a,d]of Object.entries(o))if(e.attributes.includes(a))l[a]=d;else if($t(d)){let{id:p,type:u}=d;f[a]={data:{id:p,type:u}}}else Ai(d)?f[a]={data:d.map(({id:p,type:u})=>({id:p,type:u}))}:f[a]={data:null};else{for(let[a,d]of Object.entries(o))if(e.attributes.includes(a))l[a]=d;else if(e.relationships.includes(a))if($t(d)){let{id:p,type:u}=d;f[a]={data:{id:p,type:u}}}else Ai(d)?f[a]={data:d.map(({id:p,type:u})=>({id:p,type:u}))}:f[a]={data:null};e.attributes.includes("type")&&(l.type=n)}return{data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r||e.id?{id:r||e.id}:{}),{type:e.type}),Object.keys(l).length>0?{attributes:l}:{}),Object.keys(f).length>0?{relationships:f}:{}),s?{meta:s}:{})}}function Ni(t){if(Array.isArray(t))return t.map(Ni);if(t&&typeof t=="object"){let e={};for(let[i,r]of Object.entries(t))i!=="__itemTypeId"&&(e[i]=Ni(r));return e}return t}function br(t){if(!t||typeof t!="object")return t;let{__itemTypeId:e}=t,i=vr(t,["__itemTypeId"]),r={};for(let[n,s]of Object.entries(i))r[n]=Ni(s);return r}function Tt(t){return!t||!("data"in t)?t:Array.isArray(t.data)?Object.assign(Object.assign({},t),{data:t.data.map(br)}):Object.assign(Object.assign({},t),{data:br(t.data)})}function h(t){return typeof t=="string"?t:t.id}var w={};nr(w,{AccessToken:()=>le,AuditLogEvent:()=>Z,BuildEvent:()=>fe,BuildTrigger:()=>Re,DailyUsage:()=>Ve,EditingSession:()=>Se,EmojiSuggestions:()=>ze,Environment:()=>ve,Field:()=>se,Fieldset:()=>ne,Item:()=>D,ItemType:()=>re,ItemTypeFilter:()=>Be,ItemVersion:()=>he,JobResult:()=>ue,MaintenanceMode:()=>xe,MenuItem:()=>ee,Plugin:()=>ae,PublicInfo:()=>Oe,Role:()=>Je,ScheduledPublication:()=>ge,ScheduledUnpublishing:()=>we,SchemaMenuItem:()=>te,SearchIndex:()=>Te,SearchIndexEvent:()=>pe,SearchResult:()=>be,Session:()=>oe,Site:()=>Ce,SiteInvitation:()=>Fe,SsoGroup:()=>Pe,SsoSettings:()=>ke,SsoUser:()=>Q,SubscriptionFeature:()=>ce,SubscriptionLimit:()=>de,Upload:()=>me,UploadCollection:()=>ie,UploadFilter:()=>Ee,UploadRequest:()=>ye,UploadSmartTag:()=>Ne,UploadTag:()=>Ae,UploadTrack:()=>_e,UsageCounter:()=>Le,User:()=>X,Webhook:()=>Ie,WebhookCall:()=>Ue,WhiteLabelSettings:()=>qe,Workflow:()=>$e});var _=class{constructor(e){this.client=e}};var st=class extends _{create(e){return this.rawCreate(y(e,{type:"role",attributes:["name","can_edit_favicon","can_edit_site","can_edit_schema","can_manage_menu","can_edit_environment","can_promote_environments","environments_access","can_manage_users","can_manage_shared_filters","can_manage_search_indexes","can_manage_upload_collections","can_manage_build_triggers","can_manage_webhooks","can_manage_environments","can_manage_sso","can_access_audit_log","can_manage_workflows","can_manage_access_tokens","can_perform_site_search","can_access_build_events_log","can_access_search_index_events_log","positive_item_type_permissions","negative_item_type_permissions","positive_upload_permissions","negative_upload_permissions","positive_build_trigger_permissions","negative_build_trigger_permissions","positive_search_index_permissions","negative_search_index_permissions"],relationships:["inherits_permissions_from"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/roles",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"role",attributes:["name","can_edit_favicon","can_edit_site","can_edit_schema","can_manage_menu","can_edit_environment","can_promote_environments","environments_access","can_manage_users","can_manage_shared_filters","can_manage_search_indexes","can_manage_upload_collections","can_manage_build_triggers","can_manage_webhooks","can_manage_environments","can_manage_sso","can_access_audit_log","can_manage_workflows","can_manage_access_tokens","can_perform_site_search","can_access_build_events_log","can_access_search_index_events_log","positive_item_type_permissions","negative_item_type_permissions","positive_upload_permissions","negative_upload_permissions","positive_build_trigger_permissions","negative_build_trigger_permissions","positive_search_index_permissions","negative_search_index_permissions"],relationships:["inherits_permissions_from"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/roles/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/roles"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/roles/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/roles/${e}`})}duplicate(e){return this.rawDuplicate(h(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/roles/${e}/duplicate`})}};st.TYPE="role";var ks=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function xr(t,e){return t==null&&e==null?!0:t===e}function zs(t,e){for(let i in t)if(!xr(t[i],e[i]))return!1;for(let i in e)if(!xr(t[i],e[i]))return!1;return!0}function Dt(t,e,i,r){if(!e)return t;let{add:n,remove:s}=e;return[...s?s.reduce((o,l)=>{let f=Object.assign(Object.assign({},l),{environment:i}),a=o.find(d=>zs(d,f));if(!a)throw new Error(`Cannot find rule ${JSON.stringify(f)} to remove in ${r}!`);return o.filter(d=>d!==a)},t):t,...n?n.map(o=>Object.assign({environment:i},o)):[]]}var Je=class extends st{updateCurrentEnvironmentPermissions(e,i){return ks(this,void 0,void 0,function*(){let r=this.client.config.environment||(yield this.client.environments.list()).find(f=>f.meta.primary).id,n=yield this.find(e),s=Boolean(i.positive_item_type_permissions||i.negative_item_type_permissions),o=Boolean(i.positive_upload_permissions||i.negative_upload_permissions),l=Object.assign(Object.assign({},s?{positive_item_type_permissions:Dt(n.positive_item_type_permissions,i.positive_item_type_permissions,r,"positive_item_type_permissions"),negative_item_type_permissions:Dt(n.negative_item_type_permissions,i.negative_item_type_permissions,r,"negative_item_type_permissions")}:{}),o?{positive_upload_permissions:Dt(n.positive_upload_permissions,i.positive_upload_permissions,r,"positive_upload_permissions"),negative_upload_permissions:Dt(n.negative_upload_permissions,i.negative_upload_permissions,r,"negative_upload_permissions")}:{});return this.update(e,l)})}};var X=class extends _{update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"user",attributes:["is_active"],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/users/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/users"})}find(e,i){return this.rawFind(h(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/users/${e}`,queryParams:i})}findMe(e){return this.rawFindMe(e).then(i=>c(i))}rawFindMe(e){return this.client.request({method:"GET",url:"/users/me",queryParams:e})}destroy(e,i){return this.rawDestroy(h(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/users/${e}`,queryParams:i})}};X.TYPE="user";var Q=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/sso-users"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/sso-users/${e}`})}copyUsers(){return this.rawCopyUsers().then(e=>c(e))}rawCopyUsers(){return this.client.request({method:"POST",url:"/sso-users/copy-users"})}destroy(e,i){return this.rawDestroy(h(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/sso-users/${e}`,queryParams:i})}};Q.TYPE="sso_user";var Z=class extends _{query(e){return this.rawQuery(y(e,{type:"audit_log_query",attributes:["since","before","filter","next_token","detailed_log"],relationships:[]})).then(i=>c(i))}rawQuery(e){return this.client.request({method:"POST",url:"/audit-log-events/query",body:e})}};Z.TYPE="audit_log_event";var ee=class extends _{create(e){return this.rawCreate(y(e,{type:"menu_item",attributes:["label","external_url","position","open_in_new_tab"],relationships:["item_type","item_type_filter","parent"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/menu-items",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"menu_item",attributes:["label","external_url","position","open_in_new_tab"],relationships:["item_type","item_type_filter","parent"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/menu-items/${e}`,body:i})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/menu-items",queryParams:e})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/menu-items/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/menu-items/${e}`})}reorder(e){return this.rawReorder(y(e,{type:"menu_item",attributes:["position"],relationships:["parent"]})).then(i=>c(i))}rawReorder(e){return this.client.request({method:"POST",url:"/menu-items/reorder",body:e})}};ee.TYPE="menu_item";var te=class extends _{create(e){return this.rawCreate(y(e,{type:"schema_menu_item",attributes:["label","position","kind"],relationships:["item_type","parent"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/schema-menu-items",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"schema_menu_item",attributes:["label","position","kind"],relationships:["item_type","parent","children"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/schema-menu-items/${e}`,body:i})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/schema-menu-items",queryParams:e})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/schema-menu-items/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/schema-menu-items/${e}`})}reorder(e){return this.rawReorder(y(e,{type:"schema_menu_item",attributes:["position"],relationships:["parent"]})).then(i=>c(i))}rawReorder(e){return this.client.request({method:"POST",url:"/schema-menu-items/reorder",body:e})}};te.TYPE="schema_menu_item";var ie=class extends _{create(e){return this.rawCreate(y(e,{type:"upload_collection",attributes:["label","position"],relationships:["parent"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-collections",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"upload_collection",attributes:["label","position"],relationships:["parent","children"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/upload-collections/${e}`,body:i})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/upload-collections",queryParams:e})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/upload-collections/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/upload-collections/${e}`})}reorder(e){return this.rawReorder(y(e,{type:"upload_collection",attributes:["position"],relationships:["parent"]})).then(i=>c(i))}rawReorder(e){return this.client.request({method:"POST",url:"/upload-collections/reorder",body:e})}};ie.TYPE="upload_collection";var re=class extends _{create(e,i){return this.rawCreate(y(e,{type:"item_type",attributes:["name","api_key","singleton","all_locales_required","sortable","modular_block","draft_mode_active","draft_saving_active","tree","ordering_direction","ordering_meta","collection_appeareance","collection_appearance","hint","inverse_relationships_enabled"],relationships:["ordering_field","presentation_title_field","presentation_image_field","title_field","image_preview_field","excerpt_field","workflow"]}),i).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:"/item-types",body:e,queryParams:i})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"item_type",attributes:["name","api_key","collection_appeareance","collection_appearance","singleton","all_locales_required","sortable","modular_block","draft_mode_active","draft_saving_active","tree","ordering_direction","ordering_meta","has_singleton_item","hint","inverse_relationships_enabled"],relationships:["ordering_field","presentation_title_field","presentation_image_field","title_field","image_preview_field","excerpt_field","workflow"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/item-types/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/item-types"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/item-types/${e}`})}duplicate(e){return this.rawDuplicate(h(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/item-types/${e}/duplicate`})}destroy(e,i){return this.rawDestroy(h(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/item-types/${e}`,queryParams:i})}referencing(e){return this.rawReferencing(h(e)).then(i=>c(i))}rawReferencing(e){return this.client.request({method:"GET",url:`/item-types/${e}/referencing`})}rawReorderFieldsAndFieldsets(e,i){return this.client.request({method:"POST",url:`/item-types/${e}/reorder-fields-and-fieldsets`,body:i})}};re.TYPE="item_type";var se=class extends _{create(e,i){return this.rawCreate(h(e),y(i,{type:"field",attributes:["label","field_type","api_key","localized","validators","appeareance","appearance","position","hint","default_value","deep_filtering_enabled"],relationships:["fieldset"]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/item-types/${e}/fields`,body:i})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"field",attributes:["default_value","label","api_key","localized","validators","appeareance","appearance","position","field_type","hint","deep_filtering_enabled"],relationships:["fieldset"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/fields/${e}`,body:i})}list(e){return this.rawList(h(e)).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:`/item-types/${e}/fields`})}referencing(e){return this.rawReferencing(h(e)).then(i=>c(i))}rawReferencing(e){return this.client.request({method:"GET",url:`/item-types/${e}/fields/referencing`})}related(e){return this.rawRelated(h(e)).then(i=>c(i))}rawRelated(e){return this.client.request({method:"GET",url:`/item-types/${e}/fields/related`})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/fields/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/fields/${e}`})}duplicate(e){return this.rawDuplicate(h(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/fields/${e}/duplicate`})}};se.TYPE="field";var ne=class extends _{create(e,i){return this.rawCreate(h(e),y(i,{type:"fieldset",attributes:["title","hint","position","collapsible","start_collapsed"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/item-types/${e}/fieldsets`,body:i})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"fieldset",attributes:["title","hint","position","collapsible","start_collapsed"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/fieldsets/${e}`,body:i})}list(e){return this.rawList(h(e)).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:`/item-types/${e}/fieldsets`})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/fieldsets/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/fieldsets/${e}`})}};ne.TYPE="fieldset";var oe=class extends _{create(e){return this.rawCreate(y(e,{type:"email_credentials",attributes:["email","password","otp_code"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/sessions",body:e})}};oe.TYPE="session";var le=class extends _{create(e){return this.rawCreate(y(e,{type:"access_token",attributes:["name","can_access_cda","can_access_cda_preview","can_access_cma"],relationships:["role"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/access_tokens",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"access_token",attributes:["name","can_access_cda","can_access_cda_preview","can_access_cma"],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/access_tokens/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/access_tokens"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/access_tokens/${e}`})}regenerateToken(e){return this.rawRegenerateToken(h(e)).then(i=>c(i))}rawRegenerateToken(e){return this.client.request({method:"POST",url:`/access_tokens/${e}/regenerate_token`})}destroy(e,i){return this.rawDestroy(h(e),i).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/access_tokens/${e}`,queryParams:i})}};le.TYPE="access_token";var ae=class extends _{create(e){return this.rawCreate(y(e,{type:"plugin",attributes:["package_name","name","description","url","permissions","plugin_type","field_types","parameter_definitions","package_version"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/plugins",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"plugin",attributes:["name","description","url","parameters","package_version","permissions"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/plugins/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/plugins"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/plugins/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/plugins/${e}`})}fields(e){return this.rawFields(h(e)).then(i=>c(i))}rawFields(e){return this.client.request({method:"GET",url:`/plugins/${e}/fields`})}};ae.TYPE="plugin";var ue=class extends _{find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/job-results/${e}`})}};ue.TYPE="job_result";var de=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/subscription-limits"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/subscription-limits/${e}`})}};de.TYPE="subscription_limit";var ce=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/subscription-features"})}};ce.TYPE="subscription_feature";var qs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},nt=function(t){return this instanceof nt?(this.v=t,this):new nt(t)},Os=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof nt?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},fe=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/build-events",queryParams:e})}listPagedIterator(e,i){return Os(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=qs(this.rawListPagedIterator(e,i)),d;d=yield nt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield nt(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield nt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/build-events/${e}`})}};fe.TYPE="build_event";var Vs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ot=function(t){return this instanceof ot?(this.v=t,this):new ot(t)},Ls=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof ot?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},pe=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/search-index-events",queryParams:e})}listPagedIterator(e,i){return Ls(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Vs(this.rawListPagedIterator(e,i)),d;d=yield ot(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ot(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield ot(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/search-index-events/${e}`})}};pe.TYPE="search_index_event";var As=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},lt=function(t){return this instanceof lt?(this.v=t,this):new lt(t)},Ns=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof lt?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},D=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/items",queryParams:e}).then(P)}listPagedIterator(e,i){return Ns(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=As(this.rawListPagedIterator(e,i)),d;d=yield lt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield lt(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield lt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i,!0)}validateExisting(e,i){return this.rawValidateExisting(h(e),y(i,{id:h(e),type:"item",attributes:"*",relationships:["item_type","creator"]}))}rawValidateExisting(e,i){return this.client.request({method:"POST",url:`/items/${e}/validate`,body:Tt(i)})}validateNew(e){return this.rawValidateNew(y(e,{type:"item",attributes:"*",relationships:["item_type","creator"]}))}rawValidateNew(e){return this.client.request({method:"POST",url:"/items/validate",body:Tt(e)})}create(e){return this.rawCreate(y(e,{type:"item",attributes:"*",relationships:["item_type","creator"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/items",body:Tt(e)}).then(P)}duplicate(e){return this.rawDuplicate(h(e)).then(i=>c(i))}rawDuplicate(e){return this.client.request({method:"POST",url:`/items/${e}/duplicate`}).then(P)}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"item",attributes:"*",relationships:["item_type","creator"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/items/${e}`,body:Tt(i)}).then(P)}references(e,i){return this.rawReferences(h(e),i).then(r=>c(r))}rawReferences(e,i){return this.client.request({method:"GET",url:`/items/${e}/references`,queryParams:i}).then(P)}find(e,i){return this.rawFind(h(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/items/${e}`,queryParams:i}).then(P)}currentVsPublishedState(e){return this.rawCurrentVsPublishedState(h(e)).then(i=>c(i))}rawCurrentVsPublishedState(e){return this.client.request({method:"GET",url:`/items/${e}/current-vs-published-state`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/items/${e}`}).then(P)}publish(e,i,r){return this.rawPublish(h(e),i?y(i,{type:"selective_publish_operation",attributes:["content_in_locales","non_localized_content"],relationships:[]}):null,r).then(n=>c(n))}rawPublish(e,i,r){return this.client.request({method:"PUT",url:`/items/${e}/publish`,body:i,queryParams:r}).then(P)}unpublish(e,i,r){return this.rawUnpublish(h(e),i?y(i,{type:"selective_unpublish_operation",attributes:["content_in_locales"],relationships:[]}):null,r).then(n=>c(n))}rawUnpublish(e,i,r){return this.client.request({method:"PUT",url:`/items/${e}/unpublish`,body:i,queryParams:r}).then(P)}bulkPublish(e){return this.rawBulkPublish(y(e,{type:"item_bulk_publish_operation",attributes:[],relationships:["items"]})).then(i=>c(i))}rawBulkPublish(e){return this.client.request({method:"POST",url:"/items/bulk/publish",body:e})}bulkUnpublish(e){return this.rawBulkUnpublish(y(e,{type:"item_bulk_unpublish_operation",attributes:[],relationships:["items"]})).then(i=>c(i))}rawBulkUnpublish(e){return this.client.request({method:"POST",url:"/items/bulk/unpublish",body:e})}bulkDestroy(e){return this.rawBulkDestroy(y(e,{type:"item_bulk_destroy_operation",attributes:[],relationships:["items"]})).then(i=>c(i))}rawBulkDestroy(e){return this.client.request({method:"POST",url:"/items/bulk/destroy",body:e})}bulkMoveToStage(e){return this.rawBulkMoveToStage(y(e,{type:"item_bulk_move_to_stage_operation",attributes:["stage"],relationships:["items"]})).then(i=>c(i))}rawBulkMoveToStage(e){return this.client.request({method:"POST",url:"/items/bulk/move-to-stage",body:e})}};D.TYPE="item";var Cs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},at=function(t){return this instanceof at?(this.v=t,this):new at(t)},$s=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof at?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},he=class extends _{restore(e){return this.rawRestore(h(e)).then(i=>c(i))}rawRestore(e){return this.client.request({method:"POST",url:`/versions/${e}/restore`})}list(e,i){return this.rawList(h(e),i).then(r=>c(r))}rawList(e,i){return this.client.request({method:"GET",url:`/items/${e}/versions`,queryParams:i})}listPagedIterator(e,i,r){return $s(this,arguments,function*(){var s,o,l,f;try{for(var a=!0,d=Cs(this.rawListPagedIterator(h(e),i,r)),p;p=yield at(d.next()),s=p.done,!s;){f=p.value,a=!1;try{yield yield at(R(f))}finally{a=!0}}}catch(u){o={error:u}}finally{try{!a&&!s&&(l=d.return)&&(yield at(l.call(d)))}finally{if(o)throw o.error}}})}rawListPagedIterator(e,i,r){return B(i),T({defaultLimit:15,maxLimit:50},n=>this.rawList(e,Object.assign(Object.assign({},i),{page:n})),r)}find(e,i){return this.rawFind(h(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/versions/${e}`,queryParams:i})}};he.TYPE="item_version";var Ds=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ut=function(t){return this instanceof ut?(this.v=t,this):new ut(t)},js=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof ut?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},me=class extends _{create(e){return this.rawCreate(y(e,{type:"upload",attributes:["path","copyright","author","notes","default_field_metadata","tags"],relationships:["upload_collection"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/uploads",body:e})}list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/uploads",queryParams:e})}listPagedIterator(e,i){return js(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Ds(this.rawListPagedIterator(e,i)),d;d=yield ut(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ut(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield ut(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/uploads/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/uploads/${e}`})}update(e,i,r){return this.rawUpdate(h(e),y(i,{id:h(e),type:"upload",attributes:["path","basename","copyright","author","notes","tags","default_field_metadata"],relationships:["creator","upload_collection"]}),r).then(n=>c(n))}rawUpdate(e,i,r){return this.client.request({method:"PUT",url:`/uploads/${e}`,body:i,queryParams:r})}references(e,i){return this.rawReferences(h(e),i).then(r=>c(r))}rawReferences(e,i){return this.client.request({method:"GET",url:`/uploads/${e}/references`,queryParams:i}).then(P)}bulkTag(e){return this.rawBulkTag(y(e,{type:"upload_bulk_tag_operation",attributes:["tags"],relationships:["uploads"]})).then(i=>c(i))}rawBulkTag(e){return this.client.request({method:"POST",url:"/uploads/bulk/tag",body:e})}bulkSetUploadCollection(e){return this.rawBulkSetUploadCollection(y(e,{type:"upload_bulk_set_upload_collection_operation",attributes:[],relationships:["upload_collection","uploads"]})).then(i=>c(i))}rawBulkSetUploadCollection(e){return this.client.request({method:"POST",url:"/uploads/bulk/set-upload-collection",body:e})}bulkDestroy(e){return this.rawBulkDestroy(y(e,{type:"upload_bulk_destroy_operation",attributes:[],relationships:["uploads"]})).then(i=>c(i))}rawBulkDestroy(e){return this.client.request({method:"POST",url:"/uploads/bulk/destroy",body:e})}};me.TYPE="upload";var ye=class extends _{create(e){return this.rawCreate(y(e,{type:"upload_request",attributes:["filename"],relationships:["upload_collection"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-requests",body:e})}};ye.TYPE="upload_request";var _e=class extends _{create(e,i){return this.rawCreate(h(e),y(i,{type:"upload_track",attributes:["url_or_upload_request_id","type","name","language_code","closed_captions"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/uploads/${e}/tracks`,body:i})}list(e){return this.rawList(h(e)).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:`/uploads/${e}/tracks`})}destroy(e,i){return this.rawDestroy(h(e),h(i)).then(r=>c(r))}rawDestroy(e,i){return this.client.request({method:"DELETE",url:`/uploads/${e}/tracks/${i}`})}generateSubtitles(e,i){return this.rawGenerateSubtitles(h(e),y(i,{type:"upload_track",attributes:["name","language_code"],relationships:[]})).then(r=>c(r))}rawGenerateSubtitles(e,i){return this.client.request({method:"POST",url:`/uploads/${e}/tracks/generate-subtitles`,body:i})}};_e.TYPE="upload_track";var ge=class extends _{create(e,i){return this.rawCreate(h(e),y(i,{type:"scheduled_publication",attributes:["publication_scheduled_at","selective_publication"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/items/${e}/scheduled-publication`,body:i})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/items/${e}/scheduled-publication`}).then(P)}};ge.TYPE="scheduled_publication";var we=class extends _{create(e,i){return this.rawCreate(h(e),y(i,{type:"scheduled_unpublishing",attributes:["unpublishing_scheduled_at","content_in_locales"],relationships:[]})).then(r=>c(r))}rawCreate(e,i){return this.client.request({method:"POST",url:`/items/${e}/scheduled-unpublishing`,body:i})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/items/${e}/scheduled-unpublishing`}).then(P)}};we.TYPE="scheduled_unpublishing";var Gs=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},dt=function(t){return this instanceof dt?(this.v=t,this):new dt(t)},Ms=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof dt?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},be=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/search-results",queryParams:e})}listPagedIterator(e,i){return Ms(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Gs(this.rawListPagedIterator(e,i)),d;d=yield dt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield dt(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield dt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:20,maxLimit:100},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}};be.TYPE="search_result";var ve=class extends _{fork(e,i,r){return this.rawFork(h(e),y(i,{id:h(e),type:"environment",attributes:[],relationships:[]}),r).then(n=>c(n))}rawFork(e,i,r){return this.client.request({method:"POST",url:`/environments/${e}/fork`,body:i,queryParams:r})}promote(e){return this.rawPromote(h(e)).then(i=>c(i))}rawPromote(e){return this.client.request({method:"PUT",url:`/environments/${e}/promote`})}rename(e,i){return this.rawRename(h(e),y(i,{id:h(e),type:"environment",attributes:[],relationships:[]})).then(r=>c(r))}rawRename(e,i){return this.client.request({method:"PUT",url:`/environments/${e}/rename`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/environments"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/environments/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/environments/${e}`})}};ve.TYPE="environment";var xe=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/maintenance-mode"})}activate(e){return this.rawActivate(e).then(i=>c(i))}rawActivate(e){return this.client.request({method:"PUT",url:"/maintenance-mode/activate",queryParams:e})}deactivate(){return this.rawDeactivate().then(e=>c(e))}rawDeactivate(){return this.client.request({method:"PUT",url:"/maintenance-mode/deactivate"})}};xe.TYPE="maintenance_mode";var Ie=class extends _{create(e){return this.rawCreate(y(e,{type:"webhook",attributes:["name","url","custom_payload","headers","events","http_basic_user","http_basic_password","enabled","payload_api_version","nested_items_in_payload","auto_retry"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/webhooks",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"webhook",attributes:["name","url","custom_payload","headers","events","http_basic_user","http_basic_password","enabled","payload_api_version","nested_items_in_payload","auto_retry"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/webhooks/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/webhooks"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/webhooks/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/webhooks/${e}`})}};Ie.TYPE="webhook";var Ws=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ct=function(t){return this instanceof ct?(this.v=t,this):new ct(t)},Js=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof ct?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},Ue=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/webhook_calls",queryParams:e})}listPagedIterator(e,i){return Js(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Ws(this.rawListPagedIterator(e,i)),d;d=yield ct(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ct(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield ct(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:30,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/webhook_calls/${e}`})}resendWebhook(e){return this.rawResendWebhook(h(e))}rawResendWebhook(e){return this.client.request({method:"POST",url:`/webhook_calls/${e}/resend_webhook`})}};Ue.TYPE="webhook_call";var Re=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/build-triggers"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/build-triggers/${e}`})}create(e){return this.rawCreate(y(e,{type:"build_trigger",attributes:["name","webhook_token","adapter","indexing_enabled","enabled","frontend_url","autotrigger_on_scheduled_publications","adapter_settings"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/build-triggers",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"build_trigger",attributes:["name","adapter","indexing_enabled","enabled","frontend_url","autotrigger_on_scheduled_publications","adapter_settings"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/build-triggers/${e}`,body:i})}trigger(e){return this.rawTrigger(h(e))}rawTrigger(e){return this.client.request({method:"POST",url:`/build-triggers/${e}/trigger`})}abort(e){return this.rawAbort(h(e))}rawAbort(e){return this.client.request({method:"DELETE",url:`/build-triggers/${e}/abort`})}abortIndexing(e){return this.rawAbortIndexing(h(e))}rawAbortIndexing(e){return this.client.request({method:"DELETE",url:`/build-triggers/${e}/abort_indexing`})}reindex(e){return this.rawReindex(h(e))}rawReindex(e){return this.client.request({method:"PUT",url:`/build-triggers/${e}/reindex`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/build-triggers/${e}`})}};Re.TYPE="build_trigger";var Te=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/search-indexes"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/search-indexes/${e}`})}create(e){return this.rawCreate(y(e,{type:"search_index",attributes:["name","enabled","frontend_url","user_agent_suffix"],relationships:["build_triggers"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/search-indexes",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"search_index",attributes:["name","enabled","frontend_url","user_agent_suffix"],relationships:["build_triggers"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/search-indexes/${e}`,body:i})}trigger(e){return this.rawTrigger(h(e))}rawTrigger(e){return this.client.request({method:"POST",url:`/search-indexes/${e}/trigger`})}abort(e){return this.rawAbort(h(e))}rawAbort(e){return this.client.request({method:"DELETE",url:`/search-indexes/${e}/abort`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/search-indexes/${e}`})}};Te.TYPE="search_index";var Be=class extends _{create(e){return this.rawCreate(y(e,{type:"item_type_filter",attributes:["name","filter","columns","order_by","shared"],relationships:["item_type"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/item-type-filters",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"item_type_filter",attributes:["name","columns","order_by","shared","filter"],relationships:["item_type"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/item-type-filters/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/item-type-filters"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/item-type-filters/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/item-type-filters/${e}`})}};Be.TYPE="item_type_filter";var Ee=class extends _{create(e){return this.rawCreate(y(e,{type:"upload_filter",attributes:["name","filter","shared"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-filters",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"upload_filter",attributes:["name","shared","filter"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/upload-filters/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/upload-filters"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/upload-filters/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/upload-filters/${e}`})}};Ee.TYPE="upload_filter";var Fe=class extends _{create(e){return this.rawCreate(y(e,{type:"site_invitation",attributes:["email"],relationships:["role"]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/site-invitations",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"site_invitation",attributes:[],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/site-invitations/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/site-invitations"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/site-invitations/${e}`})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/site-invitations/${e}`})}resend(e){return this.rawResend(h(e)).then(i=>c(i))}rawResend(e){return this.client.request({method:"POST",url:`/site-invitations/${e}/resend`})}};Fe.TYPE="site_invitation";var Se=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/editing-sessions"})}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/editing-sessions/${e}`,body:i})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/editing-sessions/${e}`})}};Se.TYPE="editing_session";var Pe=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/sso-groups"})}copyRoles(e){return this.rawCopyRoles(h(e)).then(i=>c(i))}rawCopyRoles(e){return this.client.request({method:"POST",url:`/sso-groups/${e}/copy-roles`})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"sso_group",attributes:["priority"],relationships:["role"]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/sso-groups/${e}`,body:i})}destroy(e){return this.rawDestroy(h(e)).then(i=>c(i))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/sso-groups/${e}`})}};Pe.TYPE="sso_group";var ke=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/sso-settings"})}generateToken(){return this.rawGenerateToken().then(e=>c(e))}rawGenerateToken(){return this.client.request({method:"PUT",url:"/sso-settings/generate-token"})}update(e){return this.rawUpdate(y(e,{type:"sso_settings",attributes:["idp_saml_metadata_url","idp_saml_metadata_xml"],relationships:["default_role"]})).then(i=>c(i))}rawUpdate(e){return this.client.request({method:"PUT",url:"/sso-settings",body:e})}};ke.TYPE="sso_settings";var ze=class extends _{find(e){return this.rawFind(e).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:"/emoji-suggestions",queryParams:e})}};ze.TYPE="emoji_suggestions";var qe=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/white-label-settings"})}update(e){return this.rawUpdate(y(e,{type:"white_label_settings",attributes:["custom_i18n_messages_template_url"],relationships:[]})).then(i=>c(i))}rawUpdate(e){return this.client.request({method:"PUT",url:"/white-label-settings",body:e})}};qe.TYPE="white_label_settings";var Oe=class extends _{find(){return this.rawFind().then(e=>c(e))}rawFind(){return this.client.request({method:"GET",url:"/public-info"})}};Oe.TYPE="public_info";var Ve=class extends _{list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/daily-site-usages"})}};Ve.TYPE="daily_usage";var Le=class extends _{find(e,i){return this.rawFind(h(e),i).then(r=>c(r))}rawFind(e,i){return this.client.request({method:"GET",url:`/usage-log-counters/${e}`,queryParams:i})}};Le.TYPE="usage_counter";var Ys=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},ft=function(t){return this instanceof ft?(this.v=t,this):new ft(t)},Hs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof ft?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},Ae=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/upload-tags",queryParams:e})}listPagedIterator(e,i){return Hs(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Ys(this.rawListPagedIterator(e,i)),d;d=yield ft(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield ft(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield ft(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:50,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}create(e){return this.rawCreate(y(e,{type:"upload_tag",attributes:["name"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/upload-tags",body:e})}};Ae.TYPE="upload_tag";var Ks=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}},pt=function(t){return this instanceof pt?(this.v=t,this):new pt(t)},Xs=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof pt?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},Ne=class extends _{list(e){return this.rawList(e).then(i=>c(i))}rawList(e){return this.client.request({method:"GET",url:"/upload-smart-tags",queryParams:e})}listPagedIterator(e,i){return Xs(this,arguments,function*(){var n,s,o,l;try{for(var f=!0,a=Ks(this.rawListPagedIterator(e,i)),d;d=yield pt(a.next()),n=d.done,!n;){l=d.value,f=!1;try{yield yield pt(R(l))}finally{f=!0}}}catch(p){s={error:p}}finally{try{!f&&!n&&(o=a.return)&&(yield pt(o.call(a)))}finally{if(s)throw s.error}}})}rawListPagedIterator(e,i){return B(e),T({defaultLimit:50,maxLimit:500},r=>this.rawList(Object.assign(Object.assign({},e),{page:r})),i)}};Ne.TYPE="upload_smart_tag";var Ce=class extends _{find(e){return this.rawFind(e).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:"/site",queryParams:e})}update(e){return this.rawUpdate(y(e,{type:"site",attributes:["no_index","favicon","global_seo","name","theme","locales","timezone","require_2fa","ip_tracking_enabled","force_use_of_sandbox_environments"],relationships:["sso_default_role"]})).then(i=>c(i))}rawUpdate(e){return this.client.request({method:"PUT",url:"/site",body:e})}activateImprovedTimezoneManagement(){return this.rawActivateImprovedTimezoneManagement().then(e=>c(e))}rawActivateImprovedTimezoneManagement(){return this.client.request({method:"PUT",url:"/site/activate-improved-timezone-management"})}activateImprovedHexManagement(){return this.rawActivateImprovedHexManagement().then(e=>c(e))}rawActivateImprovedHexManagement(){return this.client.request({method:"PUT",url:"/site/activate-improved-hex-management"})}activateImprovedGqlMultilocaleFields(){return this.rawActivateImprovedGqlMultilocaleFields().then(e=>c(e))}rawActivateImprovedGqlMultilocaleFields(){return this.client.request({method:"PUT",url:"/site/activate-improved-gql-multilocale-fields"})}activateImprovedGqlVisibilityControl(){return this.rawActivateImprovedGqlVisibilityControl().then(e=>c(e))}rawActivateImprovedGqlVisibilityControl(){return this.client.request({method:"PUT",url:"/site/activate-improved-gql-visibility-control"})}activateImprovedBooleanFields(){return this.rawActivateImprovedBooleanFields().then(e=>c(e))}rawActivateImprovedBooleanFields(){return this.client.request({method:"PUT",url:"/site/activate-improved-boolean-fields"})}activateDraftModeAsDefault(){return this.rawActivateDraftModeAsDefault().then(e=>c(e))}rawActivateDraftModeAsDefault(){return this.client.request({method:"PUT",url:"/site/activate-draft-mode-as-default"})}activateImprovedValidationAtPublishing(){return this.rawActivateImprovedValidationAtPublishing().then(e=>c(e))}rawActivateImprovedValidationAtPublishing(){return this.client.request({method:"PUT",url:"/site/activate-improved-validation-at-publishing"})}activateImprovedExposureOfInlineBlocksInCda(){return this.rawActivateImprovedExposureOfInlineBlocksInCda().then(e=>c(e))}rawActivateImprovedExposureOfInlineBlocksInCda(){return this.client.request({method:"PUT",url:"/site/activate-improved-exposure-of-inline-blocks-in-cda"})}activateImprovedItemsListing(){return this.rawActivateImprovedItemsListing().then(e=>c(e))}rawActivateImprovedItemsListing(){return this.client.request({method:"PUT",url:"/site/activate-improved-items-listing"})}activateMillisecondsInDatetime(){return this.rawActivateMillisecondsInDatetime().then(e=>c(e))}rawActivateMillisecondsInDatetime(){return this.client.request({method:"PUT",url:"/site/activate-milliseconds-in-datetime"})}updateAssetsCdnDefaultSettings(e){return this.rawUpdateAssetsCdnDefaultSettings(y(e,{type:"assets-cdn-default-settings",attributes:["assets_cdn_default_settings"],relationships:[]})).then(i=>c(i))}rawUpdateAssetsCdnDefaultSettings(e){return this.client.request({method:"PUT",url:"/site/assets-cdn-default-settings",body:e})}};Ce.TYPE="site";var $e=class extends _{create(e){return this.rawCreate(y(e,{type:"workflow",attributes:["name","api_key","stages"],relationships:[]})).then(i=>c(i))}rawCreate(e){return this.client.request({method:"POST",url:"/workflows",body:e})}update(e,i){return this.rawUpdate(h(e),y(i,{id:h(e),type:"workflow",attributes:["name","api_key","stages"],relationships:[]})).then(r=>c(r))}rawUpdate(e,i){return this.client.request({method:"PUT",url:`/workflows/${e}`,body:i})}list(){return this.rawList().then(e=>c(e))}rawList(){return this.client.request({method:"GET",url:"/workflows"})}find(e){return this.rawFind(h(e)).then(i=>c(i))}rawFind(e){return this.client.request({method:"GET",url:`/workflows/${e}`})}destroy(e){return this.rawDestroy(h(e))}rawDestroy(e){return this.client.request({method:"DELETE",url:`/workflows/${e}`})}};$e.TYPE="workflow";var Qs=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},De=class{constructor(e){this.config=e,this.roles=new Je(this),this.users=new X(this),this.ssoUsers=new Q(this),this.auditLogEvents=new Z(this),this.menuItems=new ee(this),this.schemaMenuItems=new te(this),this.uploadCollections=new ie(this),this.itemTypes=new re(this),this.fields=new se(this),this.fieldsets=new ne(this),this.session=new oe(this),this.accessTokens=new le(this),this.plugins=new ae(this),this.jobResults=new ue(this),this.subscriptionLimits=new de(this),this.subscriptionFeatures=new ce(this),this.buildEvents=new fe(this),this.searchIndexEvents=new pe(this),this.items=new D(this),this.itemVersions=new he(this),this.uploads=new me(this),this.uploadRequest=new ye(this),this.uploadTracks=new _e(this),this.scheduledPublication=new ge(this),this.scheduledUnpublishing=new we(this),this.searchResults=new be(this),this.environments=new ve(this),this.maintenanceMode=new xe(this),this.webhooks=new Ie(this),this.webhookCalls=new Ue(this),this.buildTriggers=new Re(this),this.searchIndexes=new Te(this),this.itemTypeFilters=new Be(this),this.uploadFilters=new Ee(this),this.siteInvitations=new Fe(this),this.editingSessions=new Se(this),this.ssoGroups=new Pe(this),this.ssoSettings=new ke(this),this.emojiSuggestions=new ze(this),this.whiteLabelSettings=new qe(this),this.publicInfo=new Oe(this),this.dailyUsages=new Ve(this),this.usageCounters=new Le(this),this.uploadTags=new Ae(this),this.uploadSmartTags=new Ne(this),this.site=new Ce(this),this.workflows=new $e(this)}get baseUrl(){return this.config.baseUrl||De.defaultBaseUrl}request(e){return Rt(Object.assign(Object.assign(Object.assign({},this.config),e),{logFn:this.config.logFn||console.log,userAgent:"@datocms/cma-client v5.4.6",baseUrl:this.baseUrl,preCallStack:new Error().stack,extraHeaders:Object.assign(Object.assign(Object.assign({},this.config.extraHeaders||{}),this.config.environment?{"X-Environment":this.config.environment}:{}),{"X-API-Version":"3"}),fetchJobResult:i=>this.jobResultsFetcher?this.jobResultsFetcher(i):ar(()=>this.jobResults.find(i))}))}eventsChannelName(){return Qs(this,void 0,void 0,function*(){if(this.cachedEventsChannelName)return this.cachedEventsChannelName;let{data:e}=yield this.site.rawFind();return this.cachedEventsChannelName=this.config.environment?`private-site-${e.id}-environment-${this.config.environment}`:`private-site-${e.id}`,this.cachedEventsChannelName})}};De.defaultBaseUrl="https://site-api.datocms.com";var je=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function Bt(t){return"attributes"in t?t.attributes.localized:t.localized}function b(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=Object.keys(t);if(e.length===0)return!1;let i=/^[A-Za-z]{2,4}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?$/;return e.every(r=>i.test(r))}function Y(t,e){return Bt(e)?Object.entries(t).map(([r,n])=>({locale:r,value:n})):[{locale:void 0,value:t}]}function Et(t,e){if(Bt(e))return Object.fromEntries(t.map(({locale:i,value:r})=>[i,r]));if(t.length===0)throw new Error("There must be at least one entry!");return t[0].value}function Zs(t,e,i){let n=Y(t,e).map(({locale:s,value:o})=>({locale:s,value:i(s,o)}));return Et(n,e)}function en(t,e,i){return je(this,void 0,void 0,function*(){let r=Y(t,e),n=yield Promise.all(r.map(({locale:s,value:o})=>je(this,void 0,void 0,function*(){return{locale:s,value:yield i(s,o)}})));return Et(n,e)})}function tn(t,e,i){var r;let s=Y(t,e).filter(o=>i(o.locale,o.value));return Bt(e)?Et(s,e):s.length>0?(r=s[0])===null||r===void 0?void 0:r.value:void 0}function rn(t,e,i){var r;return je(this,void 0,void 0,function*(){let n=Y(t,e),o=(yield Promise.all(n.map(({locale:l,value:f})=>je(this,void 0,void 0,function*(){return{locale:l,value:f,passed:yield i(l,f)}})))).filter(({passed:l})=>l).map(({locale:l,value:f})=>({locale:l,value:f}));return Bt(e)?Et(o,e):o.length>0?(r=o[0])===null||r===void 0?void 0:r.value:void 0})}function Ir(t,e,i){return Y(t,e).some(({locale:n,value:s})=>i(n,s))}function Ur(t,e,i){return je(this,void 0,void 0,function*(){let r=Y(t,e);return(yield Promise.all(r.map(({locale:s,value:o})=>i(s,o)))).some(s=>s)})}function sn(t,e,i){return!Ir(t,e,(r,n)=>!i(r,n))}function nn(t,e,i){return je(this,void 0,void 0,function*(){return!(yield Ur(t,e,(r,n)=>je(this,void 0,void 0,function*(){return!(yield i(r,n))})))})}function on(t,e,i){let r=Y(t,e);for(let{locale:n,value:s}of r)i(n,s)}function ln(t,e,i){return je(this,void 0,void 0,function*(){let r=Y(t,e);yield Promise.all(r.map(({locale:n,value:s})=>i(n,s)))})}function jt(t){return typeof t=="boolean"||t===null}function an(t){return b(t)&&Object.values(t).every(jt)}function Gt(t){return t===null?!0:typeof t=="object"&&t!==null&&"red"in t&&"green"in t&&"blue"in t&&"alpha"in t}function un(t){return b(t)&&Object.values(t).every(Gt)}function Mt(t){return t===null?!0:typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t)}function dn(t){return b(t)&&Object.values(t).every(Mt)}function Wt(t){return t===null?!0:typeof t=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t)}function cn(t){return b(t)&&Object.values(t).every(Wt)}function ht(t){return t===null?!0:b(t)&&"upload_id"in t&&"alt"in t&&"title"in t&&"custom_data"in t&&"focal_point"in t}function mt(t){return t===null?!0:typeof t=="object"&&t!==null&&"upload_id"in t}function fn(t){return b(t)&&Object.values(t).every(ht)}function pn(t){return b(t)&&Object.values(t).every(mt)}function Jt(t){return typeof t=="number"||t===null}function hn(t){return b(t)&&Object.values(t).every(Jt)}function Yt(t){return Array.isArray(t)&&t.every(ht)}function Ht(t){return Array.isArray(t)&&t.every(mt)}function mn(t){return b(t)&&Object.values(t).every(Yt)}function yn(t){return b(t)&&Object.values(t).every(Ht)}function Kt(t){return typeof t=="number"||t===null}function _n(t){return b(t)&&Object.values(t).every(Kt)}function Xt(t){if(t===null)return!0;if(typeof t!="string")return!1;try{return JSON.parse(t),!0}catch(e){return!1}}function gn(t){return b(t)&&Object.values(t).every(Xt)}function Qt(t){return t===null?!0:typeof t=="object"&&t!==null&&"latitude"in t&&"longitude"in t}function wn(t){return b(t)&&Object.values(t).every(Qt)}var Zt,bn=new Uint8Array(16);function Ci(){if(!Zt&&(Zt=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zt(bn)}var S=[];for(let t=0;t<256;++t)S.push((t+256).toString(16).slice(1));function Rr(t,e=0){return S[t[e+0]]+S[t[e+1]]+S[t[e+2]]+S[t[e+3]]+"-"+S[t[e+4]]+S[t[e+5]]+"-"+S[t[e+6]]+S[t[e+7]]+"-"+S[t[e+8]]+S[t[e+9]]+"-"+S[t[e+10]]+S[t[e+11]]+S[t[e+12]]+S[t[e+13]]+S[t[e+14]]+S[t[e+15]]}var vn=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$i={randomUUID:vn};function xn(t,e,i){if($i.randomUUID&&!e&&!t)return $i.randomUUID();t=t||{};let r=t.random||(t.rng||Ci)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){i=i||0;for(let n=0;n<16;++n)e[i+n]=r[n];return e}return Rr(r)}var Di=xn;function In(t){return(typeof Buffer=="undefined"?btoa(Array.from(t,i=>String.fromCharCode(i)).join("")):Buffer.from(t).toString("base64")).replace(/\+/g,"-").replace(/\//g,"_").substring(0,22)}function Un(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");return typeof Buffer=="undefined"?Uint8Array.from(atob(e),i=>i.charCodeAt(0)):new Uint8Array(Buffer.from(e,"base64"))}function G(t){if(/^\d+$/.test(t))return BigInt(t)<=0xffffffffffff;let e;try{e=Un(t)}catch(n){return!1}return!(e.length!==16||(e.at(8)&192)!==128||e.at(6)>>4!==4)}function Rn(){let t=Di(null,new Uint8Array(16));return t[0]=t[0]&127,In(t)}function ei(t){return typeof t=="string"&&G(t)||t===null}function Tn(t){return b(t)&&Object.values(t).every(ei)}function ti(t){return Array.isArray(t)&&t.every(e=>typeof e=="string"&&G(e))}function Bn(t){return b(t)&&Object.values(t).every(ti)}function yt(t){return typeof t=="string"}function W(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="item"&&"attributes"in t&&"relationships"in t}function _t(t){return W(t)&&"id"in t&&typeof t.id=="string"}function ii(t){return typeof t=="string"&&G(t)||t===null}function En(t){return b(t)&&Object.values(t).every(ii)}function gt(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="item"&&"attributes"in t}function ri(t){return t===null||yt(t)?!0:gt(t)}function Fn(t){return b(t)&&Object.values(t).every(ri)}function si(t){return t===null?!0:_t(t)}function Sn(t){return b(t)&&Object.values(t).every(si)}function ni(t){return Array.isArray(t)&&t.every(e=>typeof e=="string"&&G(e))}function Pn(t){return b(t)&&Object.values(t).every(ni)}function oi(t){return t===null?!0:Array.isArray(t)?t.every(e=>yt(e)?!0:gt(e)):!1}function kn(t){return b(t)&&Object.values(t).every(oi)}function li(t){return Array.isArray(t)?t.every(e=>_t(e)):!1}function zn(t){return b(t)&&Object.values(t).every(li)}function ai(t){return t===null?!0:typeof t=="object"&&t!==null&&("title"in t||"description"in t||"image"in t||"twitter_card"in t||"no_index"in t)}function qn(t){return b(t)&&Object.values(t).every(ai)}function ui(t){return t===null?!0:typeof t=="string"}function On(t){return b(t)&&Object.values(t).every(ui)}function di(t){return typeof t=="string"||t===null}function Vn(t){return b(t)&&Object.values(t).every(di)}var k,z,ci="blockquote",Ft="block",hi="inlineBlock",St="code",Pt="heading",ji="inlineItem",mi="itemLink",yi="link",fi="listItem",wt="list",Ye="paragraph",Gi="root",_i="span",pi="thematicBreak";var wc=(k={},k[ci]=[Ye],k[Ft]=[],k[hi]=[],k[St]=[],k[Pt]="inlineNodes",k[ji]=[],k[mi]="inlineNodes",k[yi]="inlineNodes",k[fi]=[Ye,wt],k[wt]=[fi],k[Ye]="inlineNodes",k[Gi]=[ci,St,wt,Ye,Pt,Ft,pi],k[_i]=[],k[pi]=[],k);var bc=(z={},z[ci]=["children","attribution"],z[Ft]=["item"],z[hi]=["item"],z[St]=["language","highlight","code"],z[Pt]=["level","children","style"],z[ji]=["item"],z[mi]=["item","children","meta"],z[yi]=["url","children","meta"],z[fi]=["children"],z[wt]=["style","children"],z[Ye]=["children","style"],z[Gi]=["children"],z[_i]=["value","marks"],z[pi]=[],z);function Tr(t){return"children"in t}function Br(t){return t.type===Pt}function Er(t){return t.type===_i}function Fr(t){return t.type===Ye}function Sr(t){return t.type===wt}function kt(t){return t.type===Ft}function zt(t){return t.type===hi}function Pr(t){return t.type===St}function kr(t){return t.type===yi}function zr(t){return t.type===mi}function Ln(t){return Boolean(typeof t=="object"&&t)}function bt(t){return Boolean(Ln(t)&&"schema"in t&&"document"in t&&t.schema==="dast")}var An=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var r=Array(t),n=0,e=0;e<i;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,n++)r[n]=s[o];return r},Nn={MAX_WIDTH:80};function Cn(t){return Tr(t)}function $n(t){return"(item: "+JSON.stringify(t)+")"}function Dn(t){return bt(t)?t.document:t}function Or(t,e){e===void 0&&(e={});var i=Dn(t),r=Vr(i,e);return r.nodes&&r.nodes.length>0?r.nodes.length===1?r.nodes[0]:{label:"",nodes:r.nodes}:{label:""}}function Vr(t,e){var i,r,n=(r=e.maxWidth)!==null&&r!==void 0?r:Nn.MAX_WIDTH,s=Math.max(20,n-8),o=jn(t,e,s),l={label:o};if(Cn(t)){var f=t.children;if(f.length>0){l.nodes=[];for(var a=0,d=f;a<d.length;a++){var p=d[a];l.nodes.push(Vr(p,e))}}}if((kt(t)||zt(t))&&e.blockFormatter){var u=e.blockFormatter(t.item,s);typeof u!="string"&&(l.nodes||(l.nodes=[]),Array.isArray(u)?(i=l.nodes).push.apply(i,u):l.nodes.push(u))}return l}function jn(t,e,i){var r=[],n="";if(Er(t))t.marks&&t.marks.length>0&&r.push("marks: "+t.marks.join(", ")),n=' "'+qr(t.value,i)+'"';else if(Pr(t))t.language&&r.push('language: "'+t.language+'"'),n=' "'+qr(t.code,i)+'"';else if(Br(t))r.push("level: "+t.level);else if(Sr(t))r.push("style: "+t.style);else if(kr(t)){if(r.push('url: "'+t.url+'"'),t.meta&&t.meta.length>0){var s=t.meta.map(function(d){return d.id+'="'+d.value+'"'}).join(", ");r.push("meta: {"+s+"}")}}else if(zr(t)){if(r.push('item: "'+t.item+'"'),t.meta&&t.meta.length>0){var s=t.meta.map(function(p){return p.id+'="'+p.value+'"'}).join(", ");r.push("meta: {"+s+"}")}}else if(kt(t)||zt(t)){var o=e.blockFormatter||$n,l=o(t.item,i);if(typeof l=="string"){var f=l.replace(/\n/g," ").trim();n=" "+f}}else Fr(t)&&t.style&&r.push('style: "'+t.style+'"');var a=r.length>0?" ("+r.join(", ")+")":"";return""+t.type+a+n}function qr(t,e){return t.length<=e?t:t.substring(0,e-3)+"..."}function Lr(t){var e=typeof t=="string"?{label:t}:t,i=[];function r(n,s,o){var l=n.label.trim(),f=n.nodes||[];if(!l&&f.length>0){f.forEach(function(g,v){var F=v===f.length-1;r(g,s,F)});return}var a=s.map(function(g){return g?"\u2502 ":" "}).join(""),d=o?"\u2514":"\u251C",p=l.split(`
|
|
8
|
+
`);i.push(""+a+d+" "+p[0]);for(var u=a+(o?" ":"\u2502 "),m=1;m<p.length;m++)i.push(""+u+p[m]);f.forEach(function(g,v){var F=v===f.length-1;r(g,An(s,[!o]),F)})}return r(e,[],!0),i.join(`
|
|
9
9
|
`)+`
|
|
10
|
-
`}var bt=function(){return bt=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},bt.apply(this,arguments)},He=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},Ke=function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(d){return f([a,d])}}function f(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(s=a[0]&2?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(d){a=[6,d],n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},_i=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var r=Array(t),n=0,e=0;e<i;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,n++)r[n]=s[o];return r};function Gi(t){return typeof t=="object"&&t!==null&&"schema"in t&&t.schema==="dast"&&"document"in t}function Xe(t){return Gi(t)?t.document:t}function gi(t){return typeof t=="object"&&t!==null&&"children"in t&&Array.isArray(t.children)}function Lr(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s,o;return Ke(this,function(l){switch(l.label){case 0:return n=Xe(t),[4,e(n,i,r)];case 1:if(l.sent(),!gi(n))return[3,5];s=0,l.label=2;case 2:return s<n.children.length?(o=n.children[s],[4,Lr(o,e,n,_i(r,["children",s]))]):[3,5];case 3:l.sent(),l.label=4;case 4:return s++,[3,2];case 5:return[2]}})})}function Mi(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s,o,l,f=this;return Ke(this,function(a){switch(a.label){case 0:return n=Xe(t),[4,e(n,i,r)];case 1:return s=a.sent(),gi(n)&&typeof s=="object"&&s!==null?[4,Promise.all(n.children.map(function(d,h){return He(f,void 0,void 0,function(){var u;return Ke(this,function(m){switch(m.label){case 0:return u=Xe,[4,Mi(d,e,n,_i(r,["children",h]))];case 1:return[2,u.apply(void 0,[m.sent()])]}})})}))]:[3,3];case 2:return l=a.sent(),o=bt(bt({},s),{children:l}),[3,4];case 3:o=s,a.label=4;case 4:return Gi(t)?[2,{schema:"dast",document:o}]:[2,o]}})})}function Ar(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s=this;return Ke(this,function(o){switch(o.label){case 0:return n=[],[4,Lr(t,function(l,f,a){return He(s,void 0,void 0,function(){return Ke(this,function(d){switch(d.label){case 0:return[4,e(l,f,a)];case 1:return d.sent()&&n.push({node:l,path:a}),[2]}})})},i,r)];case 1:return o.sent(),[2,n]}})})}function Wi(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s,o,l,f=this;return Ke(this,function(a){switch(a.label){case 0:return n=Xe(t),[4,e(n,i,r)];case 1:return a.sent()?gi(n)?[3,2]:(s=n,[3,4]):[2,null];case 2:return[4,Promise.all(n.children.map(function(d,h){return He(f,void 0,void 0,function(){var u;return Ke(this,function(m){switch(m.label){case 0:return[4,Wi(d,e,n,_i(r,["children",h]))];case 1:return u=m.sent(),[2,u?Xe(u):null]}})})}))];case 3:o=a.sent(),l=o.filter(function(d){return d!==null}),s=bt(bt({},n),{children:l}),a.label=4;case 4:return Gi(t)?[2,{schema:"dast",document:s}]:[2,s]}})})}function Nr(t,e,i,r){i===void 0&&(i=null),r===void 0&&(r=[]);var n=Xe(t);if(e(n,i,r))return!0;if(gi(n))for(var s=0;s<n.children.length;s++){var o=n.children[s];if(Nr(o,e,n,_i(r,["children",s])))return!0}return!1}function Cr(t,e,i,r){i===void 0&&(i=null),r===void 0&&(r=[]);var n=Xe(t);return!Nr(n,function(s,o,l){return!e(s,o,l)},i,r)}function Ji(t,e){return Cr(t,i=>Pt(i)||kt(i)?e(i):!0)}function wi(t){return t===null?!0:wt(t)?Ji(t.document,e=>typeof e.item=="string"&&M(e.item)):!1}function jn(t){return b(t)&&Object.values(t).every(wi)}function bi(t){return t===null?!0:wt(t)?Ji(t.document,e=>{let i=e.item;return yt(i)?!0:q(i)}):!1}function Gn(t){return b(t)&&Object.values(t).every(bi)}function vi(t){return t===null?!0:wt(t)?Ji(t.document,e=>{let i=e.item;return _t(i)}):!1}function Mn(t){return b(t)&&Object.values(t).every(vi)}function xi(t){return typeof t=="string"||t===null}function Wn(t){return b(t)&&Object.values(t).every(xi)}function Ii(t){return t===null?!0:typeof t=="object"&&t!==null&&"provider"in t&&"provider_uid"in t&&"url"in t}function Jn(t){return b(t)&&Object.values(t).every(Ii)}function Yn(t){let e=y(t,{type:j.TYPE,attributes:"*",relationships:["item_type"]}).data;return Object.assign(Object.assign({},e),{__itemTypeId:e.relationships.item_type.data.id})}var H=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},J=function(t){return this instanceof J?(this.v=t,this):new J(t)},Hn=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){h(s[0][3],g)}}function f(u){u.value instanceof J?Promise.resolve(u.value.v).then(a,d):h(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function h(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},vt=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}};function xt(t,e){return Hn(this,arguments,function*(){if(t==="rich_text"){let r=e;if(r)for(let n=0;n<r.length;n++){let s=r[n];yield yield J({item:s,path:[n]})}return yield J(void 0)}if(t==="single_block"){let r=e;return r&&(yield yield J({item:r,path:[]})),yield J(void 0)}if(t==="structured_text"){let r=e;if(r){let n=yield J(Ar(r.document,s=>H(this,void 0,void 0,function*(){return s.type==="block"||s.type==="inlineBlock"})));for(let{node:s,path:o}of n)(s.type==="block"||s.type==="inlineBlock")&&(yield yield J({item:s.item,path:o}))}return yield J(void 0)}})}function zt(t,e,i){var r,n,s,o;return H(this,void 0,void 0,function*(){try{for(var l=!0,f=vt(xt(t,e)),a;a=yield f.next(),r=a.done,!r;){o=a.value,l=!1;try{let{item:d,path:h}=o;yield i(d,h)}finally{l=!0}}}catch(d){n={error:d}}finally{try{!l&&!r&&(s=f.return)&&(yield s.call(f))}finally{if(n)throw n.error}}})}function Yi(t,e,i){return H(this,void 0,void 0,function*(){if(t==="rich_text"){let r=e;return r&&(yield Promise.all(r.map((n,s)=>i(n,[s]))))}if(t==="single_block"){let r=e;return r?yield i(r,[]):null}if(t==="structured_text"){let r=e;return r?{schema:"dast",document:yield Mi(r.document,(n,s,o)=>H(this,void 0,void 0,function*(){return n.type==="block"||n.type==="inlineBlock"?Object.assign(Object.assign({},n),{item:yield i(n.item,o)}):n}))}:null}return e})}function $r(t,e,i){var r,n,s,o;return H(this,void 0,void 0,function*(){let l=[];try{for(var f=!0,a=vt(xt(t,e)),d;d=yield a.next(),r=d.done,!r;){o=d.value,f=!1;try{let{item:h,path:u}=o;(yield i(h,u))&&l.push({item:h,path:u})}finally{f=!0}}}catch(h){n={error:h}}finally{try{!f&&!r&&(s=a.return)&&(yield s.call(a))}finally{if(n)throw n.error}}return l})}function Dr(t,e,i){var r,n,s,o,l,f,a,d;return H(this,void 0,void 0,function*(){if(t==="rich_text"){let U=[];try{for(var h=!0,u=vt(xt(t,e)),m;m=yield u.next(),r=m.done,!r;){o=m.value,h=!1;try{let{item:A,path:K}=o;(yield i(A,K))&&U.push(A)}finally{h=!0}}}catch(A){n={error:A}}finally{try{!h&&!r&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return U}if(t==="single_block"){try{for(var g=!0,v=vt(xt(t,e)),F;F=yield v.next(),l=F.done,!l;){d=F.value,g=!1;try{let{item:U,path:A}=d;if(yield i(U,A))return U}finally{g=!0}}}catch(U){f={error:U}}finally{try{!g&&!l&&(a=v.return)&&(yield a.call(v))}finally{if(f)throw f.error}}return null}if(t==="structured_text"){let U=e;if(!U)return null;let A=yield Wi(U.document,(K,Ge,At)=>H(this,void 0,void 0,function*(){return K.type==="block"||K.type==="inlineBlock"?yield i(K.item,At):!0}));return A?{schema:"dast",document:A}:null}return e})}function jr(t,e,i,r){var n,s,o,l;return H(this,void 0,void 0,function*(){let f=r;try{for(var a=!0,d=vt(xt(t,e)),h;h=yield d.next(),n=h.done,!n;){l=h.value,a=!1;try{let{item:u,path:m}=l;f=yield i(f,u,m)}finally{a=!0}}}catch(u){s={error:u}}finally{try{!a&&!n&&(o=d.return)&&(yield o.call(d))}finally{if(s)throw s.error}}return f})}function Gr(t,e,i){var r,n,s,o;return H(this,void 0,void 0,function*(){try{for(var l=!0,f=vt(xt(t,e)),a;a=yield f.next(),r=a.done,!r;){o=a.value,l=!1;try{let{item:d,path:h}=o;if(yield i(d,h))return!0}finally{l=!0}}}catch(d){n={error:d}}finally{try{!l&&!r&&(s=f.return)&&(yield s.call(f))}finally{if(n)throw n.error}}return!1})}var E=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function Mr(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){yield zt(e,t,(s,o)=>E(this,void 0,void 0,function*(){if(yield r(s,[...n,...o]),!q(s))return;let l=yield i.getRawItemTypeById(s.relationships.item_type.data.id),f=yield i.getRawItemTypeFields(l);for(let a of f)yield Mr(s.attributes[a.attributes.api_key],a.attributes.field_type,i,r,[...n,...o,"attributes",a.attributes.api_key])}))})}function Wr(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){let s=[],o=yield $r(e,t,(l,f)=>E(this,void 0,void 0,function*(){return yield r(l,[...n,...f])}));return s.push(...o.map(({item:l,path:f})=>({item:l,path:[...n,...f]}))),yield zt(e,t,(l,f)=>E(this,void 0,void 0,function*(){if(!q(l))return;let a=yield i.getRawItemTypeById(l.relationships.item_type.data.id),d=yield i.getRawItemTypeFields(a);for(let h of d){let u=yield Wr(l.attributes[h.attributes.api_key],h.attributes.field_type,i,r,[...n,...f,"attributes",h.attributes.api_key]);s.push(...u)}})),s})}function Hi(t,e,i,r,n={},s=[]){return E(this,void 0,void 0,function*(){let{traversalDirection:o="top-down"}=n,f=yield Yi(e,t,(a,d)=>E(this,void 0,void 0,function*(){let h=[...s,...d];if(!q(a))return a;let u=yield i.getRawItemTypeById(a.relationships.item_type.data.id),m=yield i.getRawItemTypeFields(u);if(o==="top-down"){let v=Object.assign(Object.assign({},a),{attributes:Object.assign({},a.attributes)});for(let F of m)v.attributes[F.attributes.api_key]=yield Hi(v.attributes[F.attributes.api_key],F.attributes.field_type,i,r,n,[...h,"attributes",F.attributes.api_key]);return v}let g=Object.assign(Object.assign({},a),{attributes:Object.assign({},a.attributes)});for(let v of m)g.attributes[v.attributes.api_key]=yield Hi(g.attributes[v.attributes.api_key],v.attributes.field_type,i,r,n,[...h,"attributes",v.attributes.api_key]);return g}));return Dr(e,f,(a,d)=>E(this,void 0,void 0,function*(){let h=[...s,...d];return yield r(a,h)}))})}function Jr(t,e,i,r,n,s=[]){return E(this,void 0,void 0,function*(){let o=yield jr(e,t,(l,f,a)=>E(this,void 0,void 0,function*(){return yield r(l,f,[...s,...a])}),n);return yield zt(e,t,(l,f)=>E(this,void 0,void 0,function*(){if(!q(l))return;let a=yield i.getRawItemTypeById(l.relationships.item_type.data.id),d=yield i.getRawItemTypeFields(a);for(let h of d)o=yield Jr(l.attributes[h.attributes.api_key],h.attributes.field_type,i,r,o,[...s,...f,"attributes",h.attributes.api_key])})),o})}function Ki(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){if(yield Gr(e,t,(l,f)=>E(this,void 0,void 0,function*(){return yield r(l,[...n,...f])})))return!0;let o=!1;return yield zt(e,t,(l,f)=>E(this,void 0,void 0,function*(){if(o||!q(l))return;let a=yield i.getRawItemTypeById(l.relationships.item_type.data.id),d=yield i.getRawItemTypeFields(a);for(let h of d){if(o)break;(yield Ki(l.attributes[h.attributes.api_key],h.attributes.field_type,i,r,[...n,...f,"attributes",h.attributes.api_key]))&&(o=!0)}})),o})}function Kn(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){return!(yield Ki(t,e,i,(s,o)=>E(this,void 0,void 0,function*(){return!(yield r(s,o))}),n))})}function qt(t,e,i,r,n={},s=[]){return E(this,void 0,void 0,function*(){let{traversalDirection:o="top-down"}=n;return Yi(e,t,(l,f)=>E(this,void 0,void 0,function*(){let a=[...s,...f];if(!q(l))return yield r(l,a);let d=yield i.getRawItemTypeById(l.relationships.item_type.data.id),h=yield i.getRawItemTypeFields(d);if(o==="top-down"){let m=yield r(l,a);if(!q(m))return m;for(let g of h)m.attributes[g.attributes.api_key]=yield qt(m.attributes[g.attributes.api_key],g.attributes.field_type,i,r,n,[...a,"attributes",g.attributes.api_key]);return m}let u=Object.assign({},l);for(let m of h)u.attributes[m.attributes.api_key]=yield qt(u.attributes[m.attributes.api_key],m.attributes.field_type,i,r,n,[...a,"attributes",m.attributes.api_key]);return yield r(u,a)}))})}var Xn=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},Yr=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};function Qn(t,e){return Xn(this,void 0,void 0,function*(){let{__itemTypeId:i,type:r,attributes:n,relationships:s}=t,o=yield e.getRawItemTypeById(t.relationships.item_type.data.id),l={__itemTypeId:i,type:r,relationships:s,attributes:n},f=yield e.getRawItemTypeFields(o);for(let a of f)l.attributes[a.attributes.api_key]=yield qt(l.attributes[a.attributes.api_key],a.attributes.field_type,e,(d,h)=>{if(typeof d=="string")throw new Error(`Block cannot be duplicated as it contains nested block at ${h.join(".")} that is expressed as ID (${d}) instead of full object!`);if("id"in d){let{id:g,meta:v}=d;return Yr(d,["id","meta"])}let{meta:u}=d;return Yr(d,["meta"])});return l})}function Xi(t){let e="attributes"in t?t.attributes:t;switch(e.field_type){case"link":return e.validators.item_item_type.item_types;case"links":return e.validators.items_item_type.item_types;case"structured_text":return e.validators.structured_text_links.item_types;default:return[]}}function Ot(t){let e="attributes"in t?t.attributes:t;switch(e.field_type){case"single_block":return e.validators.single_block_blocks.item_types;case"rich_text":return e.validators.rich_text_blocks.item_types;case"structured_text":return[...e.validators.structured_text_blocks.item_types,...e.validators.structured_text_inline_blocks?e.validators.structured_text_inline_blocks.item_types:[]];default:return[]}}var Zn=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i},Hr=[{guard:Dt,inspect:so},{guard:Wt,inspect:ao},{guard:Ht,inspect:uo},{guard:jt,inspect:no},{guard:Gt,inspect:oo},{guard:Mt,inspect:lo},{guard:Jt,inspect:Xr},{guard:Yt,inspect:Xr},{guard:pt,inspect:Kr},{guard:mt,inspect:Kr},{guard:Kt,inspect:co},{guard:ai,inspect:yo},{guard:ui,inspect:_o},{guard:xi,inspect:go},{guard:Xt,inspect:fo},{guard:Zt,inspect:ho},{guard:ei,inspect:po},{guard:li,inspect:mo},{guard:Ii,inspect:wo},{guard:wi,inspect:Qi},{guard:bi,inspect:Qi},{guard:vi,inspect:Qi},{guard:ti,inspect:Ui},{guard:ii,inspect:Ui},{guard:ri,inspect:Ui},{guard:si,inspect:Zi},{guard:ni,inspect:Zi},{guard:oi,inspect:Zi}];function eo(t,e){return typeof e=="string"?{label:`${t}: ${e}`}:Array.isArray(e)?{label:t,nodes:e}:{label:t,nodes:[e]}}function to(t,e){if(b(t)){for(let i of Hr)if(Object.values(t).every(r=>i.guard(r)))return Object.entries(t).sort(([n],[s])=>n.localeCompare(s)).map(([n,s])=>{let o=i.inspect(s,e);return typeof o=="string"?{label:`${n}: ${o}`}:Array.isArray(o)?{label:n,nodes:o}:{label:n,nodes:[o]}})}for(let i of Hr)if(i.guard(t))return i.inspect(t,e);return`UNKNOWN: ${JSON.stringify(t)}`}function io(t){if("attributes"in t)return t;let{__itemTypeId:e}=t,i=Zn(t,["__itemTypeId"]);return y(i,{type:j.TYPE,attributes:"*",relationships:["item_type","creator"]}).data}function ro(t,e){return Vr(er(t,e))}function er(t,e){var i,r;let n,s=io(t);if("relationships"in s&&s.relationships){let f=s.relationships;!((r=(i=f.item_type)===null||i===void 0?void 0:i.data)===null||r===void 0)&&r.id&&(n=f.item_type.data.id)}let o=["Item","id"in t?JSON.stringify(s.id):null,n?`(item_type: ${JSON.stringify(n)})`:null].filter(Boolean).join(" "),l=[];if("attributes"in s)for(let[f,a]of Object.entries(s.attributes)){let d=to(a,e);l.push(eo(f,d))}return{label:o,nodes:l.length>0?l:void 0}}function Qi(t,e){return t===null?"null":qr(t,{maxWidth:(e==null?void 0:e.maxWidth)||80,blockFormatter:(i,r)=>typeof i=="string"?JSON.stringify(i):er(i,e)})}function Ui(t,e){return t===null?"null":typeof t=="string"?JSON.stringify(t):er(t,e)}function Zi(t,e){return t===null?"null":t.map((i,r)=>{let n=Ui(i,e);return typeof n=="string"?{label:`[${r}] ${n}`}:(n.label=`[${r}] ${n.label}`,n)})}function so(t){return JSON.stringify(t)}function no(t){if(t===null)return"null";let{red:e,green:i,blue:r,alpha:n}=t,s=`#${e.toString(16).padStart(2,"0").toUpperCase()}${i.toString(16).padStart(2,"0").toUpperCase()}${r.toString(16).padStart(2,"0").toUpperCase()}`;if(n===255)return s;let o=Math.round(n/255*100);return`${s} ${o}%`}function oo(t){return t===null?"null":t}function lo(t){return t===null?"null":t}function Kr(t,e){if(t===null)return"null";let i=[];if(i.push({label:`upload_id: ${JSON.stringify(t.upload_id)}`}),t.alt&&i.push({label:`alt: ${JSON.stringify($(t.alt,(e==null?void 0:e.maxWidth)||80))}`}),t.title&&i.push({label:`title: ${JSON.stringify($(t.title,(e==null?void 0:e.maxWidth)||80))}`}),t.custom_data&&Object.keys(t.custom_data).length>0&&i.push({label:`custom_data: ${$(JSON.stringify(t.custom_data),(e==null?void 0:e.maxWidth)||80)}`}),t.focal_point){let r=t.focal_point.x*100,n=t.focal_point.y*100;i.push({label:`focal_point: x=${r}% y=${n}%`})}return i}function ao(t){return t===null?"null":t.toString()}function Xr(t,e){return!t||t.length===0?"[]":t.map((r,n)=>{let s=[];if(s.push({label:`upload_id: ${JSON.stringify(r.upload_id)}`}),r.alt&&s.push({label:`alt: ${JSON.stringify($(r.alt,(e==null?void 0:e.maxWidth)||80))}`}),r.title&&s.push({label:`title: ${JSON.stringify($(r.title,(e==null?void 0:e.maxWidth)||80))}`}),r.custom_data&&Object.keys(r.custom_data).length>0&&s.push({label:`custom_data: ${$(JSON.stringify(r.custom_data),(e==null?void 0:e.maxWidth)||80)}`}),r.focal_point){let o=r.focal_point.x*100,l=r.focal_point.y*100;s.push({label:`focal_point: x=${o}% y=${l}%`})}return{label:`[${n}]`,nodes:s}})}function uo(t){return t===null?"null":t.toString()}function co(t,e){return t===null?"null":$(JSON.stringify(JSON.parse(t)),(e==null?void 0:e.maxWidth)||80)}function fo(t){return t===null?"null":[{label:`latitude: ${t.latitude}`},{label:`longitude: ${t.longitude}`}]}function ho(t){return t===null?"null":JSON.stringify(t)}function po(t){return t===null?"null":t.map((e,i)=>({label:`[${i}]: ${JSON.stringify(e)}`}))}function mo(t,e){if(t===null)return"null";let i=[];return t.title&&i.push({label:`title: ${JSON.stringify($(t.title,(e==null?void 0:e.maxWidth)||80))}`}),t.description&&i.push({label:`description: ${JSON.stringify($(t.description,(e==null?void 0:e.maxWidth)||80))}`}),t.image&&i.push({label:`image: ${t.image}`}),t.twitter_card&&i.push({label:`twitter_card: ${t.twitter_card}`}),t.no_index!==void 0&&i.push({label:`no_index: ${t.no_index}`}),i}function yo(t,e){return t===null?"null":JSON.stringify($(t,(e==null?void 0:e.maxWidth)||80))}function _o(t,e){return t===null?"null":JSON.stringify($(t,(e==null?void 0:e.maxWidth)||80))}function go(t,e){return t===null?"null":JSON.stringify($(t,(e==null?void 0:e.maxWidth)||80))}function wo(t,e){if(t===null)return"null";let i=[];return i.push({label:`provider: ${t.provider}`}),i.push({label:`provider_uid: ${t.provider_uid}`}),i.push({label:`url: ${t.url}`}),i.push({label:`size: ${t.width}\u2A2F${t.height}px`}),i.push({label:`thumbnail_url: ${t.thumbnail_url}`}),t.title&&i.push({label:`title: ${JSON.stringify($(t.title,(e==null?void 0:e.maxWidth)||80))}`}),i}function $(t,e){return t.length<=e?t:`${t.slice(0,e-3)}...`}function bo(t){return e=>{if(typeof e!="object"||e===null)return!1;let i=e.relationships;if(typeof i!="object"||i===null)return!1;let r=i.item_type;if(typeof r!="object"||r===null)return!1;let n=r.data;return typeof n!="object"||n===null?!1:n.id===t}}var I=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(h){o(h)}}function f(d){try{a(r.throw(d))}catch(h){o(h)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},tr=class{constructor(e){this.itemTypesPromise=null,this.itemTypesByApiKey=new Map,this.itemTypesById=new Map,this.fieldsByItemType=new Map,this.fieldsetsByItemType=new Map,this.pluginsPromise=null,this.pluginsById=new Map,this.pluginsByPackageName=new Map,this.prefetchPromise=null,this.client=e}loadItemTypes(){return I(this,void 0,void 0,function*(){return this.itemTypesPromise||(this.itemTypesPromise=(()=>I(this,void 0,void 0,function*(){let{data:e}=yield this.client.itemTypes.rawList();for(let i of e)this.itemTypesByApiKey.set(i.attributes.api_key,i),this.itemTypesById.set(i.id,i);return e}))()),this.itemTypesPromise})}getAllItemTypes(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawItemTypes();return c({data:e})})}getAllRawItemTypes(){return I(this,void 0,void 0,function*(){return yield this.loadItemTypes()})}getAllModels(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawModels();return c({data:e})})}getAllRawModels(){return I(this,void 0,void 0,function*(){return(yield this.loadItemTypes()).filter(i=>!i.attributes.modular_block)})}getAllBlockModels(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawBlockModels();return c({data:e})})}getAllRawBlockModels(){return I(this,void 0,void 0,function*(){return(yield this.loadItemTypes()).filter(i=>i.attributes.modular_block)})}getItemTypeByApiKey(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeByApiKey(e);return c({data:i})})}getRawItemTypeByApiKey(e){return I(this,void 0,void 0,function*(){yield this.loadItemTypes();let i=this.itemTypesByApiKey.get(e);if(!i)throw new Error(`Item type with API key '${e}' not found`);return i})}getItemTypeById(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeById(e);return c({data:i})})}getRawItemTypeById(e){return I(this,void 0,void 0,function*(){yield this.loadItemTypes();let i=this.itemTypesById.get(e);if(!i)throw new Error(`Item type with ID '${e}' not found`);return i})}getItemTypeFields(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeFields(e);return c({data:i})})}getRawItemTypeFields(e){return I(this,void 0,void 0,function*(){let i=this.fieldsByItemType.get(e.id);if(i)return i;let{data:r}=yield this.client.fields.rawList(e.id);return this.fieldsByItemType.set(e.id,r),r})}getItemTypeFieldsets(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeFieldsets(e);return c({data:i})})}getRawItemTypeFieldsets(e){return I(this,void 0,void 0,function*(){let i=this.fieldsetsByItemType.get(e.id);if(i)return i;let{data:r}=yield this.client.fieldsets.rawList(e.id);return this.fieldsetsByItemType.set(e.id,r),r})}loadPlugins(){return I(this,void 0,void 0,function*(){return this.pluginsPromise||(this.pluginsPromise=(()=>I(this,void 0,void 0,function*(){let{data:e}=yield this.client.plugins.rawList();for(let i of e)this.pluginsById.set(i.id,i),i.attributes.package_name&&this.pluginsByPackageName.set(i.attributes.package_name,i);return e}))()),this.pluginsPromise})}getAllPlugins(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawPlugins();return c({data:e})})}getAllRawPlugins(){return I(this,void 0,void 0,function*(){return yield this.loadPlugins()})}getPluginById(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawPluginById(e);return c({data:i})})}getRawPluginById(e){return I(this,void 0,void 0,function*(){yield this.loadPlugins();let i=this.pluginsById.get(e);if(!i)throw new Error(`Plugin with ID '${e}' not found`);return i})}getPluginByPackageName(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawPluginByPackageName(e);return c({data:i})})}getRawPluginByPackageName(e){return I(this,void 0,void 0,function*(){yield this.loadPlugins();let i=this.pluginsByPackageName.get(e);if(!i)throw new Error(`Plugin with package name '${e}' not found`);return i})}prefetchAllModelsAndFields(){return I(this,void 0,void 0,function*(){if(this.prefetchPromise)return this.prefetchPromise;let e=()=>I(this,void 0,void 0,function*(){let{included:i}=yield this.client.site.rawFind({include:"item_types,item_types.fields"});if(!i)return;let r=i.filter(o=>o.type==="item_type"),n=i.filter(o=>o.type==="field");this.itemTypesPromise=Promise.resolve(r);for(let o of r)this.itemTypesByApiKey.set(o.attributes.api_key,o),this.itemTypesById.set(o.id,o);let s=new Map;for(let o of n){let l=o.relationships.item_type.data.id;s.has(l)||s.set(l,[]),s.get(l).push(o)}for(let[o,l]of s)this.fieldsByItemType.set(o,l)});return this.prefetchPromise=e(),this.prefetchPromise})}getRawModelsEmbeddingBlocks(e){return I(this,void 0,void 0,function*(){yield this.prefetchAllModelsAndFields();let i=yield this.getAllRawItemTypes(),r=new Set(e.map(o=>o.id)),n=[],s=(o,l=new Set)=>I(this,void 0,void 0,function*(){if(l.has(o.id))return!1;l.add(o.id);let f=yield this.getRawItemTypeFields(o);for(let a of f){let d=Ot(a);if(d.some(u=>r.has(u)))return!0;let h=d.map(u=>i.find(m=>m.id===u));for(let u of h)if(yield s(u,new Set(l)))return!0}return!1});for(let o of i)(yield s(o))&&n.push(o);return n})}getModelsEmbeddingBlocks(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawModelsEmbeddingBlocks(e);return c({data:i})})}getRawNestedBlocks(e){return I(this,void 0,void 0,function*(){yield this.prefetchAllModelsAndFields();let i=yield this.getAllRawItemTypes(),r=new Set,n=[],s=(o,l=new Set)=>I(this,void 0,void 0,function*(){if(l.has(o.id))return;l.add(o.id);let f=yield this.getRawItemTypeFields(o);for(let a of f){let d=Ot(a);for(let h of d)if(!r.has(h)){r.add(h);let u=i.find(m=>m.id===h);u&&(n.push(u),yield s(u,new Set(l)))}}});for(let o of e)yield s(o);return n})}getNestedBlocks(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawNestedBlocks(e);return c({data:i})})}getRawNestedModels(e){return I(this,void 0,void 0,function*(){yield this.prefetchAllModelsAndFields();let i=yield this.getAllRawItemTypes(),r=new Set,n=[],s=(o,l=new Set)=>I(this,void 0,void 0,function*(){if(l.has(o.id))return;l.add(o.id);let f=yield this.getRawItemTypeFields(o);for(let a of f){let d=Xi(a);for(let u of d)if(!r.has(u)){r.add(u);let m=i.find(g=>g.id===u);m&&n.push(m)}let h=Ot(a);for(let u of h){let m=i.find(g=>g.id===u);m&&(yield s(m,new Set(l)))}}});for(let o of e)yield s(o);return n})}getNestedModels(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawNestedModels(e);return c({data:i})})}};var Ri={};sr(Ri,{AccessToken:()=>ko,AuditLogEvent:()=>Uo,BuildEvent:()=>Lo,BuildTrigger:()=>Ho,DailyUsage:()=>ol,EditingSession:()=>el,EmojiSuggestions:()=>rl,Environment:()=>Mo,Field:()=>Fo,Fieldset:()=>So,Item:()=>No,ItemType:()=>Eo,ItemTypeFilter:()=>Xo,ItemVersion:()=>Co,JobResult:()=>qo,MaintenanceMode:()=>Wo,MenuItem:()=>Ro,Plugin:()=>zo,PublicInfo:()=>nl,Role:()=>vo,ScheduledPublication:()=>Do,ScheduledUnpublishing:()=>jo,SchemaMenuItem:()=>To,SearchIndex:()=>Ko,SearchIndexEvent:()=>Ao,SearchResult:()=>Go,Session:()=>Po,Site:()=>dl,SiteInvitation:()=>Zo,SsoGroup:()=>tl,SsoSettings:()=>il,SsoUser:()=>Io,SubscriptionFeature:()=>Vo,SubscriptionLimit:()=>Oo,Upload:()=>Qe,UploadCollection:()=>Bo,UploadFilter:()=>Qo,UploadRequest:()=>$o,UploadSmartTag:()=>ul,UploadTag:()=>al,UploadTrack:()=>Lt,UsageCounter:()=>ll,User:()=>xo,Webhook:()=>Jo,WebhookCall:()=>Yo,WhiteLabelSettings:()=>sl,Workflow:()=>cl});function Qr(t,e,{onProgress:i,additionalHeaders:r}={}){let n=new XMLHttpRequest;return G(new Promise((s,o)=>{if(i&&n.upload&&(n.upload.onprogress=l=>{l.lengthComputable&&i({type:"UPLOADING_FILE",payload:{progress:Math.round(l.loaded/l.total*100)}})}),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200?s():o(new Error(`Status ${n.status}`)))},n.addEventListener("error",o,!1),n.open("PUT",e,!0),r)for(let[l,f]of Object.entries(r))n.setRequestHeader(l,f);n.send(t)}),()=>{n.onreadystatechange=null,n.abort()})}function Vt(t,e,i={}){let r=i.filename||("name"in e?e.name:void 0);if(!r)throw new Error("Missing filename, please provide it as an option!");let n=!1,s;return G(async()=>{i.onProgress&&(i==null||i.onProgress({type:"REQUESTING_UPLOAD_URL",payload:{filename:r}}));let{id:o,url:l,request_headers:f}=await t.uploadRequest.create({filename:r});if(n)throw new C;return i.onProgress&&i.onProgress({type:"UPLOADING_FILE",payload:{progress:0}}),s=Qr(e,l,{...i,additionalHeaders:f}),await s,o},()=>{s?s.cancel():n=!0})}var Qe=class extends w.Upload{createFromFileOrBlob(e){let i=!1,r;return G(async()=>{if(i)throw new C;let{fileOrBlob:n,filename:s,onProgress:o,...l}=e;r=Vt(this.client,n,{filename:s,onProgress:o});let f=await r;return o&&o({type:"CREATING_UPLOAD_OBJECT"}),this.create({...l,path:f})},()=>{r?r.cancel():i=!0})}updateFromFileOrBlob(e,i){let r=!1,n;return G(async()=>{if(r)throw new C;let{fileOrBlob:s,filename:o,onProgress:l,...f}=i;n=Vt(this.client,s,{filename:o,onProgress:l});let a=await n;return l&&l({type:"CREATING_UPLOAD_OBJECT"}),this.update(e,{...f,path:a})},()=>{n?n.cancel():r=!0})}};var Lt=class extends w.UploadTrack{createFromFileOrBlob(e,i){let r=!1,n;return G(async()=>{if(r)throw new C;let{fileOrBlob:s,onProgress:o,...l}=i;n=Vt(this.client,s,{onProgress:o});let f=await n;return o&&o({type:"CREATING_UPLOAD_TRACK_OBJECT"}),this.create(e,{...l,url_or_upload_request_id:f})},()=>{n?n.cancel():r=!0})}};var vo=w.Role,xo=w.User,Io=w.SsoUser,Uo=w.AuditLogEvent,Ro=w.MenuItem,To=w.SchemaMenuItem,Bo=w.UploadCollection,Eo=w.ItemType,Fo=w.Field,So=w.Fieldset,Po=w.Session,ko=w.AccessToken,zo=w.Plugin,qo=w.JobResult,Oo=w.SubscriptionLimit,Vo=w.SubscriptionFeature,Lo=w.BuildEvent,Ao=w.SearchIndexEvent,No=w.Item,Co=w.ItemVersion,$o=w.UploadRequest,Do=w.ScheduledPublication,jo=w.ScheduledUnpublishing,Go=w.SearchResult,Mo=w.Environment,Wo=w.MaintenanceMode,Jo=w.Webhook,Yo=w.WebhookCall,Ho=w.BuildTrigger,Ko=w.SearchIndex,Xo=w.ItemTypeFilter,Qo=w.UploadFilter,Zo=w.SiteInvitation,el=w.EditingSession,tl=w.SsoGroup,il=w.SsoSettings,rl=w.EmojiSuggestions,sl=w.WhiteLabelSettings,nl=w.PublicInfo,ol=w.DailyUsage,ll=w.UsageCounter,al=w.UploadTag,ul=w.UploadSmartTag,dl=w.Site,cl=w.Workflow;var Ti=class extends De{constructor(i){super(i);this.uploads=new Qe(this)}};function Af(t){return new Ti(t)}export{N as ApiError,C as CanceledPromiseError,Ti as Client,L as LogLevel,Ri as Resources,tr as SchemaRepository,tt as TimeoutError,Ot as blockModelIdsReferencedInField,Yn as buildBlockRecord,Af as buildClient,Qn as duplicateBlockRecord,Kn as everyBlockInNonLocalizedFieldValue,rn as everyNormalizedFieldValue,sn as everyNormalizedFieldValueAsync,Hi as filterBlocksInNonLocalizedFieldValue,en as filterNormalizedFieldValues,tn as filterNormalizedFieldValuesAsync,Wr as findAllBlocksInNonLocalizedFieldValue,Bt as fromNormalizedFieldValueEntries,Un as generateId,ro as inspectItem,bo as isBlockOfType,Dt as isBooleanFieldValue,jt as isColorFieldValue,Gt as isDateFieldValue,Mt as isDateTimeFieldValue,pt as isFileFieldValue,mt as isFileFieldValueInRequest,Wt as isFloatFieldValue,Jt as isGalleryFieldValue,Yt as isGalleryFieldValueInRequest,Ht as isIntegerFieldValue,yt as isItemId,q as isItemWithOptionalIdAndMeta,_t as isItemWithOptionalMeta,Kt as isJsonFieldValue,Xt as isLatLonFieldValue,Zt as isLinkFieldValue,ei as isLinksFieldValue,Tt as isLocalized,ln as isLocalizedBooleanFieldValue,an as isLocalizedColorFieldValue,un as isLocalizedDateFieldValue,dn as isLocalizedDateTimeFieldValue,b as isLocalizedFieldValue,cn as isLocalizedFileFieldValue,fn as isLocalizedFileFieldValueInRequest,hn as isLocalizedFloatFieldValue,pn as isLocalizedGalleryFieldValue,mn as isLocalizedGalleryFieldValueInRequest,yn as isLocalizedIntegerFieldValue,_n as isLocalizedJsonFieldValue,gn as isLocalizedLatLonFieldValue,Rn as isLocalizedLinkFieldValue,Tn as isLocalizedLinksFieldValue,Sn as isLocalizedRichTextFieldValue,kn as isLocalizedRichTextFieldValueInNestedResponse,Pn as isLocalizedRichTextFieldValueInRequest,zn as isLocalizedSeoFieldValue,Bn as isLocalizedSingleBlockFieldValue,Fn as isLocalizedSingleBlockFieldValueInNestedResponse,En as isLocalizedSingleBlockFieldValueInRequest,qn as isLocalizedSlugFieldValue,On as isLocalizedStringFieldValue,jn as isLocalizedStructuredTextFieldValue,Mn as isLocalizedStructuredTextFieldValueInNestedResponse,Gn as isLocalizedStructuredTextFieldValueInRequest,Wn as isLocalizedTextFieldValue,Jn as isLocalizedVideoFieldValue,si as isRichTextFieldValue,oi as isRichTextFieldValueInNestedResponse,ni as isRichTextFieldValueInRequest,li as isSeoFieldValue,ti as isSingleBlockFieldValue,ri as isSingleBlockFieldValueInNestedResponse,ii as isSingleBlockFieldValueInRequest,ai as isSlugFieldValue,ui as isStringFieldValue,wi as isStructuredTextFieldValue,vi as isStructuredTextFieldValueInNestedResponse,bi as isStructuredTextFieldValueInRequest,xi as isTextFieldValue,M as isValidId,Ii as isVideoFieldValue,qt as mapBlocksInNonLocalizedFieldValue,Qs as mapNormalizedFieldValues,Zs as mapNormalizedFieldValuesAsync,Xi as modelIdsReferencedInField,Jr as reduceBlocksInNonLocalizedFieldValue,Ki as someBlocksInNonLocalizedFieldValue,xr as someNormalizedFieldValues,Ir as someNormalizedFieldValuesAsync,Y as toNormalizedFieldValueEntries,Vt as uploadFileOrBlobAndReturnPath,Qr as uploadFileOrBlobToS3,Mr as visitBlocksInNonLocalizedFieldValue,nn as visitNormalizedFieldValues,on as visitNormalizedFieldValuesAsync};
|
|
10
|
+
`}var vt=function(){return vt=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},vt.apply(this,arguments)},He=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},Ke=function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(d){return f([a,d])}}function f(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(s=a[0]&2?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(d){a=[6,d],n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},gi=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var r=Array(t),n=0,e=0;e<i;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,n++)r[n]=s[o];return r};function Mi(t){return typeof t=="object"&&t!==null&&"schema"in t&&t.schema==="dast"&&"document"in t}function Xe(t){return Mi(t)?t.document:t}function wi(t){return typeof t=="object"&&t!==null&&"children"in t&&Array.isArray(t.children)}function Ar(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s,o;return Ke(this,function(l){switch(l.label){case 0:return n=Xe(t),[4,e(n,i,r)];case 1:if(l.sent(),!wi(n))return[3,5];s=0,l.label=2;case 2:return s<n.children.length?(o=n.children[s],[4,Ar(o,e,n,gi(r,["children",s]))]):[3,5];case 3:l.sent(),l.label=4;case 4:return s++,[3,2];case 5:return[2]}})})}function Wi(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s,o,l,f=this;return Ke(this,function(a){switch(a.label){case 0:return n=Xe(t),[4,e(n,i,r)];case 1:return s=a.sent(),wi(n)&&typeof s=="object"&&s!==null?[4,Promise.all(n.children.map(function(d,p){return He(f,void 0,void 0,function(){var u;return Ke(this,function(m){switch(m.label){case 0:return u=Xe,[4,Wi(d,e,n,gi(r,["children",p]))];case 1:return[2,u.apply(void 0,[m.sent()])]}})})}))]:[3,3];case 2:return l=a.sent(),o=vt(vt({},s),{children:l}),[3,4];case 3:o=s,a.label=4;case 4:return Mi(t)?[2,{schema:"dast",document:o}]:[2,o]}})})}function Nr(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s=this;return Ke(this,function(o){switch(o.label){case 0:return n=[],[4,Ar(t,function(l,f,a){return He(s,void 0,void 0,function(){return Ke(this,function(d){switch(d.label){case 0:return[4,e(l,f,a)];case 1:return d.sent()&&n.push({node:l,path:a}),[2]}})})},i,r)];case 1:return o.sent(),[2,n]}})})}function Ji(t,e,i,r){return i===void 0&&(i=null),r===void 0&&(r=[]),He(this,void 0,void 0,function(){var n,s,o,l,f=this;return Ke(this,function(a){switch(a.label){case 0:return n=Xe(t),[4,e(n,i,r)];case 1:return a.sent()?wi(n)?[3,2]:(s=n,[3,4]):[2,null];case 2:return[4,Promise.all(n.children.map(function(d,p){return He(f,void 0,void 0,function(){var u;return Ke(this,function(m){switch(m.label){case 0:return[4,Ji(d,e,n,gi(r,["children",p]))];case 1:return u=m.sent(),[2,u?Xe(u):null]}})})}))];case 3:o=a.sent(),l=o.filter(function(d){return d!==null}),s=vt(vt({},n),{children:l}),a.label=4;case 4:return Mi(t)?[2,{schema:"dast",document:s}]:[2,s]}})})}function Cr(t,e,i,r){i===void 0&&(i=null),r===void 0&&(r=[]);var n=Xe(t);if(e(n,i,r))return!0;if(wi(n))for(var s=0;s<n.children.length;s++){var o=n.children[s];if(Cr(o,e,n,gi(r,["children",s])))return!0}return!1}function $r(t,e,i,r){i===void 0&&(i=null),r===void 0&&(r=[]);var n=Xe(t);return!Cr(n,function(s,o,l){return!e(s,o,l)},i,r)}function Yi(t,e){return $r(t,i=>kt(i)||zt(i)?e(i):!0)}function bi(t){return t===null?!0:bt(t)?Yi(t.document,e=>typeof e.item=="string"&&G(e.item)):!1}function Gn(t){return b(t)&&Object.values(t).every(bi)}function vi(t){return t===null?!0:bt(t)?Yi(t.document,e=>{let i=e.item;return yt(i)?!0:gt(i)}):!1}function Mn(t){return b(t)&&Object.values(t).every(vi)}function xi(t){return t===null?!0:bt(t)?Yi(t.document,e=>{let i=e.item;return _t(i)}):!1}function Wn(t){return b(t)&&Object.values(t).every(xi)}function Ii(t){return typeof t=="string"||t===null}function Jn(t){return b(t)&&Object.values(t).every(Ii)}function Ui(t){return t===null?!0:typeof t=="object"&&t!==null&&"provider"in t&&"provider_uid"in t&&"url"in t}function Yn(t){return b(t)&&Object.values(t).every(Ui)}function Hn(t){var e,i,r,n,s,o;let l=y(t,{type:D.TYPE,attributes:"*",relationships:["item_type"]}).data,f=(r=(e=t.__itemTypeId)!==null&&e!==void 0?e:(i=t.item_type)===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:(o=(s=(n=l.relationships)===null||n===void 0?void 0:n.item_type)===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.id;return f===void 0?l:Object.assign(Object.assign({},l),{__itemTypeId:f})}var H=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},J=function(t){return this instanceof J?(this.v=t,this):new J(t)},Kn=function(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(u){r[u]&&(n[u]=function(m){return new Promise(function(g,v){s.push([u,m,g,v])>1||l(u,m)})})}function l(u,m){try{f(r[u](m))}catch(g){p(s[0][3],g)}}function f(u){u.value instanceof J?Promise.resolve(u.value.v).then(a,d):p(s[0][2],u)}function a(u){l("next",u)}function d(u){l("throw",u)}function p(u,m){u(m),s.shift(),s.length&&l(s[0][0],s[0][1])}},xt=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(s){i[s]=t[s]&&function(o){return new Promise(function(l,f){o=t[s](o),n(l,f,o.done,o.value)})}}function n(s,o,l,f){Promise.resolve(f).then(function(a){s({value:a,done:l})},o)}};function It(t,e){return Kn(this,arguments,function*(){if(t==="rich_text"){let r=e;if(r)for(let n=0;n<r.length;n++){let s=r[n];yield yield J({item:s,path:[n]})}return yield J(void 0)}if(t==="single_block"){let r=e;return r&&(yield yield J({item:r,path:[]})),yield J(void 0)}if(t==="structured_text"){let r=e;if(r){let n=yield J(Nr(r.document,s=>H(this,void 0,void 0,function*(){return s.type==="block"||s.type==="inlineBlock"})));for(let{node:s,path:o}of n)(s.type==="block"||s.type==="inlineBlock")&&(yield yield J({item:s.item,path:o}))}return yield J(void 0)}})}function qt(t,e,i){var r,n,s,o;return H(this,void 0,void 0,function*(){try{for(var l=!0,f=xt(It(t,e)),a;a=yield f.next(),r=a.done,!r;){o=a.value,l=!1;try{let{item:d,path:p}=o;yield i(d,p)}finally{l=!0}}}catch(d){n={error:d}}finally{try{!l&&!r&&(s=f.return)&&(yield s.call(f))}finally{if(n)throw n.error}}})}function Hi(t,e,i){return H(this,void 0,void 0,function*(){if(t==="rich_text"){let r=e;return r&&(yield Promise.all(r.map((n,s)=>i(n,[s]))))}if(t==="single_block"){let r=e;return r?yield i(r,[]):null}if(t==="structured_text"){let r=e;return r?{schema:"dast",document:yield Wi(r.document,(n,s,o)=>H(this,void 0,void 0,function*(){return n.type==="block"||n.type==="inlineBlock"?Object.assign(Object.assign({},n),{item:yield i(n.item,o)}):n}))}:null}return e})}function Dr(t,e,i){var r,n,s,o;return H(this,void 0,void 0,function*(){let l=[];try{for(var f=!0,a=xt(It(t,e)),d;d=yield a.next(),r=d.done,!r;){o=d.value,f=!1;try{let{item:p,path:u}=o;(yield i(p,u))&&l.push({item:p,path:u})}finally{f=!0}}}catch(p){n={error:p}}finally{try{!f&&!r&&(s=a.return)&&(yield s.call(a))}finally{if(n)throw n.error}}return l})}function jr(t,e,i){var r,n,s,o,l,f,a,d;return H(this,void 0,void 0,function*(){if(t==="rich_text"){let U=[];try{for(var p=!0,u=xt(It(t,e)),m;m=yield u.next(),r=m.done,!r;){o=m.value,p=!1;try{let{item:L,path:K}=o;(yield i(L,K))&&U.push(L)}finally{p=!0}}}catch(L){n={error:L}}finally{try{!p&&!r&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return U}if(t==="single_block"){try{for(var g=!0,v=xt(It(t,e)),F;F=yield v.next(),l=F.done,!l;){d=F.value,g=!1;try{let{item:U,path:L}=d;if(yield i(U,L))return U}finally{g=!0}}}catch(U){f={error:U}}finally{try{!g&&!l&&(a=v.return)&&(yield a.call(v))}finally{if(f)throw f.error}}return null}if(t==="structured_text"){let U=e;if(!U)return null;let L=yield Ji(U.document,(K,Ge,Nt)=>H(this,void 0,void 0,function*(){return K.type==="block"||K.type==="inlineBlock"?yield i(K.item,Nt):!0}));return L?{schema:"dast",document:L}:null}return e})}function Gr(t,e,i,r){var n,s,o,l;return H(this,void 0,void 0,function*(){let f=r;try{for(var a=!0,d=xt(It(t,e)),p;p=yield d.next(),n=p.done,!n;){l=p.value,a=!1;try{let{item:u,path:m}=l;f=yield i(f,u,m)}finally{a=!0}}}catch(u){s={error:u}}finally{try{!a&&!n&&(o=d.return)&&(yield o.call(d))}finally{if(s)throw s.error}}return f})}function Mr(t,e,i){var r,n,s,o;return H(this,void 0,void 0,function*(){try{for(var l=!0,f=xt(It(t,e)),a;a=yield f.next(),r=a.done,!r;){o=a.value,l=!1;try{let{item:d,path:p}=o;if(yield i(d,p))return!0}finally{l=!0}}}catch(d){n={error:d}}finally{try{!l&&!r&&(s=f.return)&&(yield s.call(f))}finally{if(n)throw n.error}}return!1})}var E=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})};function Wr(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){yield qt(e,t,(s,o)=>E(this,void 0,void 0,function*(){if(yield r(s,[...n,...o]),!W(s))return;let l=yield i.getRawItemTypeById(s.relationships.item_type.data.id),f=yield i.getRawItemTypeFields(l);for(let a of f)yield Wr(s.attributes[a.attributes.api_key],a.attributes.field_type,i,r,[...n,...o,"attributes",a.attributes.api_key])}))})}function Jr(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){let s=[],o=yield Dr(e,t,(l,f)=>E(this,void 0,void 0,function*(){return yield r(l,[...n,...f])}));return s.push(...o.map(({item:l,path:f})=>({item:l,path:[...n,...f]}))),yield qt(e,t,(l,f)=>E(this,void 0,void 0,function*(){if(!W(l))return;let a=yield i.getRawItemTypeById(l.relationships.item_type.data.id),d=yield i.getRawItemTypeFields(a);for(let p of d){let u=yield Jr(l.attributes[p.attributes.api_key],p.attributes.field_type,i,r,[...n,...f,"attributes",p.attributes.api_key]);s.push(...u)}})),s})}function Ki(t,e,i,r,n={},s=[]){return E(this,void 0,void 0,function*(){let{traversalDirection:o="top-down"}=n,f=yield Hi(e,t,(a,d)=>E(this,void 0,void 0,function*(){let p=[...s,...d];if(!W(a))return a;let u=yield i.getRawItemTypeById(a.relationships.item_type.data.id),m=yield i.getRawItemTypeFields(u);if(o==="top-down"){let v=Object.assign(Object.assign({},a),{attributes:Object.assign({},a.attributes)});for(let F of m)v.attributes[F.attributes.api_key]=yield Ki(v.attributes[F.attributes.api_key],F.attributes.field_type,i,r,n,[...p,"attributes",F.attributes.api_key]);return v}let g=Object.assign(Object.assign({},a),{attributes:Object.assign({},a.attributes)});for(let v of m)g.attributes[v.attributes.api_key]=yield Ki(g.attributes[v.attributes.api_key],v.attributes.field_type,i,r,n,[...p,"attributes",v.attributes.api_key]);return g}));return jr(e,f,(a,d)=>E(this,void 0,void 0,function*(){let p=[...s,...d];return yield r(a,p)}))})}function Yr(t,e,i,r,n,s=[]){return E(this,void 0,void 0,function*(){let o=yield Gr(e,t,(l,f,a)=>E(this,void 0,void 0,function*(){return yield r(l,f,[...s,...a])}),n);return yield qt(e,t,(l,f)=>E(this,void 0,void 0,function*(){if(!W(l))return;let a=yield i.getRawItemTypeById(l.relationships.item_type.data.id),d=yield i.getRawItemTypeFields(a);for(let p of d)o=yield Yr(l.attributes[p.attributes.api_key],p.attributes.field_type,i,r,o,[...s,...f,"attributes",p.attributes.api_key])})),o})}function Xi(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){if(yield Mr(e,t,(l,f)=>E(this,void 0,void 0,function*(){return yield r(l,[...n,...f])})))return!0;let o=!1;return yield qt(e,t,(l,f)=>E(this,void 0,void 0,function*(){if(o||!W(l))return;let a=yield i.getRawItemTypeById(l.relationships.item_type.data.id),d=yield i.getRawItemTypeFields(a);for(let p of d){if(o)break;(yield Xi(l.attributes[p.attributes.api_key],p.attributes.field_type,i,r,[...n,...f,"attributes",p.attributes.api_key]))&&(o=!0)}})),o})}function Xn(t,e,i,r,n=[]){return E(this,void 0,void 0,function*(){return!(yield Xi(t,e,i,(s,o)=>E(this,void 0,void 0,function*(){return!(yield r(s,o))}),n))})}function Ot(t,e,i,r,n={},s=[]){return E(this,void 0,void 0,function*(){let{traversalDirection:o="top-down"}=n;return Hi(e,t,(l,f)=>E(this,void 0,void 0,function*(){let a=[...s,...f];if(!W(l))return yield r(l,a);let d=yield i.getRawItemTypeById(l.relationships.item_type.data.id),p=yield i.getRawItemTypeFields(d);if(o==="top-down"){let m=yield r(l,a);if(!W(m))return m;for(let g of p)m.attributes[g.attributes.api_key]=yield Ot(m.attributes[g.attributes.api_key],g.attributes.field_type,i,r,n,[...a,"attributes",g.attributes.api_key]);return m}let u=Object.assign({},l);for(let m of p)u.attributes[m.attributes.api_key]=yield Ot(u.attributes[m.attributes.api_key],m.attributes.field_type,i,r,n,[...a,"attributes",m.attributes.api_key]);return yield r(u,a)}))})}var Qn=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},Hr=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i};function Zn(t,e){return Qn(this,void 0,void 0,function*(){let{__itemTypeId:i,type:r,attributes:n,relationships:s}=t,o=yield e.getRawItemTypeById(t.relationships.item_type.data.id),l={__itemTypeId:i,type:r,relationships:s,attributes:n},f=yield e.getRawItemTypeFields(o);for(let a of f)l.attributes[a.attributes.api_key]=yield Ot(l.attributes[a.attributes.api_key],a.attributes.field_type,e,(d,p)=>{if(typeof d=="string")throw new Error(`Block cannot be duplicated as it contains nested block at ${p.join(".")} that is expressed as ID (${d}) instead of full object!`);if("id"in d){let{id:g,meta:v}=d;return Hr(d,["id","meta"])}let{meta:u}=d;return Hr(d,["meta"])});return l})}function Qi(t){let e="attributes"in t?t.attributes:t;switch(e.field_type){case"link":return e.validators.item_item_type.item_types;case"links":return e.validators.items_item_type.item_types;case"structured_text":return e.validators.structured_text_links.item_types;default:return[]}}function Vt(t){let e="attributes"in t?t.attributes:t;switch(e.field_type){case"single_block":return e.validators.single_block_blocks.item_types;case"rich_text":return e.validators.rich_text_blocks.item_types;case"structured_text":return[...e.validators.structured_text_blocks.item_types,...e.validators.structured_text_inline_blocks?e.validators.structured_text_inline_blocks.item_types:[]];default:return[]}}var eo=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i},Kr=[{guard:jt,inspect:no},{guard:Jt,inspect:uo},{guard:Kt,inspect:co},{guard:Gt,inspect:oo},{guard:Mt,inspect:lo},{guard:Wt,inspect:ao},{guard:Yt,inspect:Qr},{guard:Ht,inspect:Qr},{guard:ht,inspect:Xr},{guard:mt,inspect:Xr},{guard:Xt,inspect:fo},{guard:ui,inspect:_o},{guard:di,inspect:go},{guard:Ii,inspect:wo},{guard:Qt,inspect:po},{guard:ei,inspect:ho},{guard:ti,inspect:mo},{guard:ai,inspect:yo},{guard:Ui,inspect:bo},{guard:bi,inspect:Zi},{guard:vi,inspect:Zi},{guard:xi,inspect:Zi},{guard:ii,inspect:Ri},{guard:ri,inspect:Ri},{guard:si,inspect:Ri},{guard:ni,inspect:er},{guard:oi,inspect:er},{guard:li,inspect:er}];function to(t,e){return typeof e=="string"?{label:`${t}: ${e}`}:Array.isArray(e)?{label:t,nodes:e}:{label:t,nodes:[e]}}function io(t,e){if(b(t)){for(let i of Kr)if(Object.values(t).every(r=>i.guard(r)))return Object.entries(t).sort(([n],[s])=>n.localeCompare(s)).map(([n,s])=>{let o=i.inspect(s,e);return typeof o=="string"?{label:`${n}: ${o}`}:Array.isArray(o)?{label:n,nodes:o}:{label:n,nodes:[o]}})}for(let i of Kr)if(i.guard(t))return i.inspect(t,e);return`UNKNOWN: ${JSON.stringify(t)}`}function ro(t){if("attributes"in t)return t;let{__itemTypeId:e}=t,i=eo(t,["__itemTypeId"]);return y(i,{type:D.TYPE,attributes:"*",relationships:["item_type","creator"]}).data}function so(t,e){return Lr(tr(t,e))}function tr(t,e){var i,r;let n,s=ro(t);if("relationships"in s&&s.relationships){let f=s.relationships;!((r=(i=f.item_type)===null||i===void 0?void 0:i.data)===null||r===void 0)&&r.id&&(n=f.item_type.data.id)}let o=["Item","id"in t?JSON.stringify(s.id):null,n?`(item_type: ${JSON.stringify(n)})`:null].filter(Boolean).join(" "),l=[];if("attributes"in s)for(let[f,a]of Object.entries(s.attributes)){let d=io(a,e);l.push(to(f,d))}return{label:o,nodes:l.length>0?l:void 0}}function Zi(t,e){return t===null?"null":Or(t,{maxWidth:(e==null?void 0:e.maxWidth)||80,blockFormatter:(i,r)=>typeof i=="string"?JSON.stringify(i):tr(i,e)})}function Ri(t,e){return t===null?"null":typeof t=="string"?JSON.stringify(t):tr(t,e)}function er(t,e){return t===null?"null":t.map((i,r)=>{let n=Ri(i,e);return typeof n=="string"?{label:`[${r}] ${n}`}:(n.label=`[${r}] ${n.label}`,n)})}function no(t){return JSON.stringify(t)}function oo(t){if(t===null)return"null";let{red:e,green:i,blue:r,alpha:n}=t,s=`#${e.toString(16).padStart(2,"0").toUpperCase()}${i.toString(16).padStart(2,"0").toUpperCase()}${r.toString(16).padStart(2,"0").toUpperCase()}`;if(n===255)return s;let o=Math.round(n/255*100);return`${s} ${o}%`}function lo(t){return t===null?"null":t}function ao(t){return t===null?"null":t}function Xr(t,e){if(t===null)return"null";let i=[];if(i.push({label:`upload_id: ${JSON.stringify(t.upload_id)}`}),t.alt&&i.push({label:`alt: ${JSON.stringify(C(t.alt,(e==null?void 0:e.maxWidth)||80))}`}),t.title&&i.push({label:`title: ${JSON.stringify(C(t.title,(e==null?void 0:e.maxWidth)||80))}`}),t.custom_data&&Object.keys(t.custom_data).length>0&&i.push({label:`custom_data: ${C(JSON.stringify(t.custom_data),(e==null?void 0:e.maxWidth)||80)}`}),t.focal_point){let r=t.focal_point.x*100,n=t.focal_point.y*100;i.push({label:`focal_point: x=${r}% y=${n}%`})}return i}function uo(t){return t===null?"null":t.toString()}function Qr(t,e){return!t||t.length===0?"[]":t.map((r,n)=>{let s=[];if(s.push({label:`upload_id: ${JSON.stringify(r.upload_id)}`}),r.alt&&s.push({label:`alt: ${JSON.stringify(C(r.alt,(e==null?void 0:e.maxWidth)||80))}`}),r.title&&s.push({label:`title: ${JSON.stringify(C(r.title,(e==null?void 0:e.maxWidth)||80))}`}),r.custom_data&&Object.keys(r.custom_data).length>0&&s.push({label:`custom_data: ${C(JSON.stringify(r.custom_data),(e==null?void 0:e.maxWidth)||80)}`}),r.focal_point){let o=r.focal_point.x*100,l=r.focal_point.y*100;s.push({label:`focal_point: x=${o}% y=${l}%`})}return{label:`[${n}]`,nodes:s}})}function co(t){return t===null?"null":t.toString()}function fo(t,e){return t===null?"null":C(JSON.stringify(JSON.parse(t)),(e==null?void 0:e.maxWidth)||80)}function po(t){return t===null?"null":[{label:`latitude: ${t.latitude}`},{label:`longitude: ${t.longitude}`}]}function ho(t){return t===null?"null":JSON.stringify(t)}function mo(t){return t===null?"null":t.map((e,i)=>({label:`[${i}]: ${JSON.stringify(e)}`}))}function yo(t,e){if(t===null)return"null";let i=[];return t.title&&i.push({label:`title: ${JSON.stringify(C(t.title,(e==null?void 0:e.maxWidth)||80))}`}),t.description&&i.push({label:`description: ${JSON.stringify(C(t.description,(e==null?void 0:e.maxWidth)||80))}`}),t.image&&i.push({label:`image: ${t.image}`}),t.twitter_card&&i.push({label:`twitter_card: ${t.twitter_card}`}),t.no_index!==void 0&&i.push({label:`no_index: ${t.no_index}`}),i}function _o(t,e){return t===null?"null":JSON.stringify(C(t,(e==null?void 0:e.maxWidth)||80))}function go(t,e){return t===null?"null":JSON.stringify(C(t,(e==null?void 0:e.maxWidth)||80))}function wo(t,e){return t===null?"null":JSON.stringify(C(t,(e==null?void 0:e.maxWidth)||80))}function bo(t,e){if(t===null)return"null";let i=[];return i.push({label:`provider: ${t.provider}`}),i.push({label:`provider_uid: ${t.provider_uid}`}),i.push({label:`url: ${t.url}`}),i.push({label:`size: ${t.width}\u2A2F${t.height}px`}),i.push({label:`thumbnail_url: ${t.thumbnail_url}`}),t.title&&i.push({label:`title: ${JSON.stringify(C(t.title,(e==null?void 0:e.maxWidth)||80))}`}),i}function C(t,e){return t.length<=e?t:`${t.slice(0,e-3)}...`}function vo(t){return e=>{if(typeof e!="object"||e===null)return!1;let i=e.relationships;if(typeof i!="object"||i===null)return!1;let r=i.item_type;if(typeof r!="object"||r===null)return!1;let n=r.data;return typeof n!="object"||n===null?!1:n.id===t}}var I=function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(d){try{a(r.next(d))}catch(p){o(p)}}function f(d){try{a(r.throw(d))}catch(p){o(p)}}function a(d){d.done?s(d.value):n(d.value).then(l,f)}a((r=r.apply(t,e||[])).next())})},ir=class{constructor(e){this.itemTypesPromise=null,this.itemTypesByApiKey=new Map,this.itemTypesById=new Map,this.fieldsByItemType=new Map,this.fieldsetsByItemType=new Map,this.pluginsPromise=null,this.pluginsById=new Map,this.pluginsByPackageName=new Map,this.prefetchPromise=null,this.client=e}loadItemTypes(){return I(this,void 0,void 0,function*(){return this.itemTypesPromise||(this.itemTypesPromise=(()=>I(this,void 0,void 0,function*(){let{data:e}=yield this.client.itemTypes.rawList();for(let i of e)this.itemTypesByApiKey.set(i.attributes.api_key,i),this.itemTypesById.set(i.id,i);return e}))()),this.itemTypesPromise})}getAllItemTypes(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawItemTypes();return c({data:e})})}getAllRawItemTypes(){return I(this,void 0,void 0,function*(){return yield this.loadItemTypes()})}getAllModels(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawModels();return c({data:e})})}getAllRawModels(){return I(this,void 0,void 0,function*(){return(yield this.loadItemTypes()).filter(i=>!i.attributes.modular_block)})}getAllBlockModels(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawBlockModels();return c({data:e})})}getAllRawBlockModels(){return I(this,void 0,void 0,function*(){return(yield this.loadItemTypes()).filter(i=>i.attributes.modular_block)})}getItemTypeByApiKey(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeByApiKey(e);return c({data:i})})}getRawItemTypeByApiKey(e){return I(this,void 0,void 0,function*(){yield this.loadItemTypes();let i=this.itemTypesByApiKey.get(e);if(!i)throw new Error(`Item type with API key '${e}' not found`);return i})}getItemTypeById(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeById(e);return c({data:i})})}getRawItemTypeById(e){return I(this,void 0,void 0,function*(){yield this.loadItemTypes();let i=this.itemTypesById.get(e);if(!i)throw new Error(`Item type with ID '${e}' not found`);return i})}getItemTypeFields(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeFields(e);return c({data:i})})}getRawItemTypeFields(e){return I(this,void 0,void 0,function*(){let i=this.fieldsByItemType.get(e.id);if(i)return i;let{data:r}=yield this.client.fields.rawList(e.id);return this.fieldsByItemType.set(e.id,r),r})}getItemTypeFieldsets(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawItemTypeFieldsets(e);return c({data:i})})}getRawItemTypeFieldsets(e){return I(this,void 0,void 0,function*(){let i=this.fieldsetsByItemType.get(e.id);if(i)return i;let{data:r}=yield this.client.fieldsets.rawList(e.id);return this.fieldsetsByItemType.set(e.id,r),r})}loadPlugins(){return I(this,void 0,void 0,function*(){return this.pluginsPromise||(this.pluginsPromise=(()=>I(this,void 0,void 0,function*(){let{data:e}=yield this.client.plugins.rawList();for(let i of e)this.pluginsById.set(i.id,i),i.attributes.package_name&&this.pluginsByPackageName.set(i.attributes.package_name,i);return e}))()),this.pluginsPromise})}getAllPlugins(){return I(this,void 0,void 0,function*(){let e=yield this.getAllRawPlugins();return c({data:e})})}getAllRawPlugins(){return I(this,void 0,void 0,function*(){return yield this.loadPlugins()})}getPluginById(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawPluginById(e);return c({data:i})})}getRawPluginById(e){return I(this,void 0,void 0,function*(){yield this.loadPlugins();let i=this.pluginsById.get(e);if(!i)throw new Error(`Plugin with ID '${e}' not found`);return i})}getPluginByPackageName(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawPluginByPackageName(e);return c({data:i})})}getRawPluginByPackageName(e){return I(this,void 0,void 0,function*(){yield this.loadPlugins();let i=this.pluginsByPackageName.get(e);if(!i)throw new Error(`Plugin with package name '${e}' not found`);return i})}prefetchAllModelsAndFields(){return I(this,void 0,void 0,function*(){if(this.prefetchPromise)return this.prefetchPromise;let e=()=>I(this,void 0,void 0,function*(){let{included:i}=yield this.client.site.rawFind({include:"item_types,item_types.fields"});if(!i)return;let r=i.filter(o=>o.type==="item_type"),n=i.filter(o=>o.type==="field");this.itemTypesPromise=Promise.resolve(r);for(let o of r)this.itemTypesByApiKey.set(o.attributes.api_key,o),this.itemTypesById.set(o.id,o);let s=new Map;for(let o of n){let l=o.relationships.item_type.data.id;s.has(l)||s.set(l,[]),s.get(l).push(o)}for(let[o,l]of s)this.fieldsByItemType.set(o,l)});return this.prefetchPromise=e(),this.prefetchPromise})}getRawModelsEmbeddingBlocks(e){return I(this,void 0,void 0,function*(){yield this.prefetchAllModelsAndFields();let i=yield this.getAllRawItemTypes(),r=new Set(e.map(o=>o.id)),n=[],s=(o,l=new Set)=>I(this,void 0,void 0,function*(){if(l.has(o.id))return!1;l.add(o.id);let f=yield this.getRawItemTypeFields(o);for(let a of f){let d=Vt(a);if(d.some(u=>r.has(u)))return!0;let p=d.map(u=>i.find(m=>m.id===u));for(let u of p)if(yield s(u,new Set(l)))return!0}return!1});for(let o of i)(yield s(o))&&n.push(o);return n})}getModelsEmbeddingBlocks(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawModelsEmbeddingBlocks(e);return c({data:i})})}getRawNestedBlocks(e){return I(this,void 0,void 0,function*(){yield this.prefetchAllModelsAndFields();let i=yield this.getAllRawItemTypes(),r=new Set,n=[],s=(o,l=new Set)=>I(this,void 0,void 0,function*(){if(l.has(o.id))return;l.add(o.id);let f=yield this.getRawItemTypeFields(o);for(let a of f){let d=Vt(a);for(let p of d)if(!r.has(p)){r.add(p);let u=i.find(m=>m.id===p);u&&(n.push(u),yield s(u,new Set(l)))}}});for(let o of e)yield s(o);return n})}getNestedBlocks(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawNestedBlocks(e);return c({data:i})})}getRawNestedModels(e){return I(this,void 0,void 0,function*(){yield this.prefetchAllModelsAndFields();let i=yield this.getAllRawItemTypes(),r=new Set,n=[],s=(o,l=new Set)=>I(this,void 0,void 0,function*(){if(l.has(o.id))return;l.add(o.id);let f=yield this.getRawItemTypeFields(o);for(let a of f){let d=Qi(a);for(let u of d)if(!r.has(u)){r.add(u);let m=i.find(g=>g.id===u);m&&n.push(m)}let p=Vt(a);for(let u of p){let m=i.find(g=>g.id===u);m&&(yield s(m,new Set(l)))}}});for(let o of e)yield s(o);return n})}getNestedModels(e){return I(this,void 0,void 0,function*(){let i=yield this.getRawNestedModels(e);return c({data:i})})}};var Ti={};nr(Ti,{AccessToken:()=>zo,AuditLogEvent:()=>Ro,BuildEvent:()=>Ao,BuildTrigger:()=>Ko,DailyUsage:()=>ll,EditingSession:()=>tl,EmojiSuggestions:()=>sl,Environment:()=>Wo,Field:()=>So,Fieldset:()=>Po,Item:()=>Co,ItemType:()=>Fo,ItemTypeFilter:()=>Qo,ItemVersion:()=>$o,JobResult:()=>Oo,MaintenanceMode:()=>Jo,MenuItem:()=>To,Plugin:()=>qo,PublicInfo:()=>ol,Role:()=>xo,ScheduledPublication:()=>jo,ScheduledUnpublishing:()=>Go,SchemaMenuItem:()=>Bo,SearchIndex:()=>Xo,SearchIndexEvent:()=>No,SearchResult:()=>Mo,Session:()=>ko,Site:()=>cl,SiteInvitation:()=>el,SsoGroup:()=>il,SsoSettings:()=>rl,SsoUser:()=>Uo,SubscriptionFeature:()=>Lo,SubscriptionLimit:()=>Vo,Upload:()=>Qe,UploadCollection:()=>Eo,UploadFilter:()=>Zo,UploadRequest:()=>Do,UploadSmartTag:()=>dl,UploadTag:()=>ul,UploadTrack:()=>At,UsageCounter:()=>al,User:()=>Io,Webhook:()=>Yo,WebhookCall:()=>Ho,WhiteLabelSettings:()=>nl,Workflow:()=>fl});function Zr(t,e,{onProgress:i,additionalHeaders:r}={}){let n=new XMLHttpRequest;return j(new Promise((s,o)=>{if(i&&n.upload&&(n.upload.onprogress=l=>{l.lengthComputable&&i({type:"UPLOADING_FILE",payload:{progress:Math.round(l.loaded/l.total*100)}})}),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200?s():o(new Error(`Status ${n.status}`)))},n.addEventListener("error",o,!1),n.open("PUT",e,!0),r)for(let[l,f]of Object.entries(r))n.setRequestHeader(l,f);n.send(t)}),()=>{n.onreadystatechange=null,n.abort()})}function Lt(t,e,i={}){let r=i.filename||("name"in e?e.name:void 0);if(!r)throw new Error("Missing filename, please provide it as an option!");let n=!1,s;return j(async()=>{i.onProgress&&(i==null||i.onProgress({type:"REQUESTING_UPLOAD_URL",payload:{filename:r}}));let{id:o,url:l,request_headers:f}=await t.uploadRequest.create({filename:r});if(n)throw new N;return i.onProgress&&i.onProgress({type:"UPLOADING_FILE",payload:{progress:0}}),s=Zr(e,l,{...i,additionalHeaders:f}),await s,o},()=>{s?s.cancel():n=!0})}var Qe=class extends w.Upload{createFromFileOrBlob(e){let i=!1,r;return j(async()=>{if(i)throw new N;let{fileOrBlob:n,filename:s,onProgress:o,...l}=e;r=Lt(this.client,n,{filename:s,onProgress:o});let f=await r;return o&&o({type:"CREATING_UPLOAD_OBJECT"}),this.create({...l,path:f})},()=>{r?r.cancel():i=!0})}updateFromFileOrBlob(e,i){let r=!1,n;return j(async()=>{if(r)throw new N;let{fileOrBlob:s,filename:o,onProgress:l,...f}=i;n=Lt(this.client,s,{filename:o,onProgress:l});let a=await n;return l&&l({type:"CREATING_UPLOAD_OBJECT"}),this.update(e,{...f,path:a})},()=>{n?n.cancel():r=!0})}};var At=class extends w.UploadTrack{createFromFileOrBlob(e,i){let r=!1,n;return j(async()=>{if(r)throw new N;let{fileOrBlob:s,onProgress:o,...l}=i;n=Lt(this.client,s,{onProgress:o});let f=await n;return o&&o({type:"CREATING_UPLOAD_TRACK_OBJECT"}),this.create(e,{...l,url_or_upload_request_id:f})},()=>{n?n.cancel():r=!0})}};var xo=w.Role,Io=w.User,Uo=w.SsoUser,Ro=w.AuditLogEvent,To=w.MenuItem,Bo=w.SchemaMenuItem,Eo=w.UploadCollection,Fo=w.ItemType,So=w.Field,Po=w.Fieldset,ko=w.Session,zo=w.AccessToken,qo=w.Plugin,Oo=w.JobResult,Vo=w.SubscriptionLimit,Lo=w.SubscriptionFeature,Ao=w.BuildEvent,No=w.SearchIndexEvent,Co=w.Item,$o=w.ItemVersion,Do=w.UploadRequest,jo=w.ScheduledPublication,Go=w.ScheduledUnpublishing,Mo=w.SearchResult,Wo=w.Environment,Jo=w.MaintenanceMode,Yo=w.Webhook,Ho=w.WebhookCall,Ko=w.BuildTrigger,Xo=w.SearchIndex,Qo=w.ItemTypeFilter,Zo=w.UploadFilter,el=w.SiteInvitation,tl=w.EditingSession,il=w.SsoGroup,rl=w.SsoSettings,sl=w.EmojiSuggestions,nl=w.WhiteLabelSettings,ol=w.PublicInfo,ll=w.DailyUsage,al=w.UsageCounter,ul=w.UploadTag,dl=w.UploadSmartTag,cl=w.Site,fl=w.Workflow;var Bi=class extends De{constructor(i){super(i);this.uploads=new Qe(this)}};function Nf(t){return new Bi(t)}export{A as ApiError,N as CanceledPromiseError,Bi as Client,V as LogLevel,Ti as Resources,ir as SchemaRepository,tt as TimeoutError,Vt as blockModelIdsReferencedInField,Hn as buildBlockRecord,Nf as buildClient,Zn as duplicateBlockRecord,Xn as everyBlockInNonLocalizedFieldValue,sn as everyNormalizedFieldValue,nn as everyNormalizedFieldValueAsync,Ki as filterBlocksInNonLocalizedFieldValue,tn as filterNormalizedFieldValues,rn as filterNormalizedFieldValuesAsync,Jr as findAllBlocksInNonLocalizedFieldValue,Et as fromNormalizedFieldValueEntries,Rn as generateId,so as inspectItem,gt as isBlockObjectInRequest,vo as isBlockOfType,jt as isBooleanFieldValue,Gt as isColorFieldValue,Mt as isDateFieldValue,Wt as isDateTimeFieldValue,ht as isFileFieldValue,mt as isFileFieldValueInRequest,Jt as isFloatFieldValue,Yt as isGalleryFieldValue,Ht as isGalleryFieldValueInRequest,Kt as isIntegerFieldValue,yt as isItemId,W as isItemWithOptionalIdAndMeta,_t as isItemWithOptionalMeta,Xt as isJsonFieldValue,Qt as isLatLonFieldValue,ei as isLinkFieldValue,ti as isLinksFieldValue,Bt as isLocalized,an as isLocalizedBooleanFieldValue,un as isLocalizedColorFieldValue,dn as isLocalizedDateFieldValue,cn as isLocalizedDateTimeFieldValue,b as isLocalizedFieldValue,fn as isLocalizedFileFieldValue,pn as isLocalizedFileFieldValueInRequest,hn as isLocalizedFloatFieldValue,mn as isLocalizedGalleryFieldValue,yn as isLocalizedGalleryFieldValueInRequest,_n as isLocalizedIntegerFieldValue,gn as isLocalizedJsonFieldValue,wn as isLocalizedLatLonFieldValue,Tn as isLocalizedLinkFieldValue,Bn as isLocalizedLinksFieldValue,Pn as isLocalizedRichTextFieldValue,zn as isLocalizedRichTextFieldValueInNestedResponse,kn as isLocalizedRichTextFieldValueInRequest,qn as isLocalizedSeoFieldValue,En as isLocalizedSingleBlockFieldValue,Sn as isLocalizedSingleBlockFieldValueInNestedResponse,Fn as isLocalizedSingleBlockFieldValueInRequest,On as isLocalizedSlugFieldValue,Vn as isLocalizedStringFieldValue,Gn as isLocalizedStructuredTextFieldValue,Wn as isLocalizedStructuredTextFieldValueInNestedResponse,Mn as isLocalizedStructuredTextFieldValueInRequest,Jn as isLocalizedTextFieldValue,Yn as isLocalizedVideoFieldValue,ni as isRichTextFieldValue,li as isRichTextFieldValueInNestedResponse,oi as isRichTextFieldValueInRequest,ai as isSeoFieldValue,ii as isSingleBlockFieldValue,si as isSingleBlockFieldValueInNestedResponse,ri as isSingleBlockFieldValueInRequest,ui as isSlugFieldValue,di as isStringFieldValue,bi as isStructuredTextFieldValue,xi as isStructuredTextFieldValueInNestedResponse,vi as isStructuredTextFieldValueInRequest,Ii as isTextFieldValue,G as isValidId,Ui as isVideoFieldValue,Ot as mapBlocksInNonLocalizedFieldValue,Zs as mapNormalizedFieldValues,en as mapNormalizedFieldValuesAsync,Qi as modelIdsReferencedInField,Yr as reduceBlocksInNonLocalizedFieldValue,Xi as someBlocksInNonLocalizedFieldValue,Ir as someNormalizedFieldValues,Ur as someNormalizedFieldValuesAsync,Y as toNormalizedFieldValueEntries,Lt as uploadFileOrBlobAndReturnPath,Zr as uploadFileOrBlobToS3,Wr as visitBlocksInNonLocalizedFieldValue,on as visitNormalizedFieldValues,ln as visitNormalizedFieldValuesAsync};
|
|
11
11
|
//# sourceMappingURL=index.js.map
|