@chili-publish/studio-sdk 1.44.1 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/_bundles/main.js +2 -2
  2. package/_bundles/main.js.map +1 -1
  3. package/lib/src/controllers/BrandKitController.cjs.js +13 -64
  4. package/lib/src/controllers/BrandKitController.cjs.js.map +1 -1
  5. package/lib/src/controllers/BrandKitController.d.ts +22 -30
  6. package/lib/src/controllers/BrandKitController.es.js +13 -64
  7. package/lib/src/controllers/BrandKitController.es.js.map +1 -1
  8. package/lib/src/controllers/ComponentController.cjs.js.map +1 -1
  9. package/lib/src/controllers/ComponentController.d.ts +1 -1
  10. package/lib/src/controllers/ComponentController.es.js.map +1 -1
  11. package/lib/src/controllers/ConnectorController.cjs.js.map +1 -1
  12. package/lib/src/controllers/ConnectorController.d.ts +5 -5
  13. package/lib/src/controllers/ConnectorController.es.js.map +1 -1
  14. package/lib/src/exceptions/AsyncExceptions.cjs.js.map +1 -1
  15. package/lib/src/exceptions/AsyncExceptions.d.ts +1 -0
  16. package/lib/src/exceptions/AsyncExceptions.es.js.map +1 -1
  17. package/lib/src/exceptions/Helpers.cjs.js.map +1 -1
  18. package/lib/src/exceptions/Helpers.es.js.map +1 -1
  19. package/lib/src/index.cjs.js +3 -2
  20. package/lib/src/index.cjs.js.map +1 -1
  21. package/lib/src/index.d.ts +2 -1
  22. package/lib/src/index.es.js +2 -1
  23. package/lib/src/next/NextInitiator.cjs.js +0 -2
  24. package/lib/src/next/NextInitiator.cjs.js.map +1 -1
  25. package/lib/src/next/NextInitiator.d.ts +0 -2
  26. package/lib/src/next/NextInitiator.es.js +0 -2
  27. package/lib/src/next/NextInitiator.es.js.map +1 -1
  28. package/lib/src/next/index.d.ts +0 -1
  29. package/lib/src/sdk/editor-engine.json.cjs.js +1 -1
  30. package/lib/src/sdk/editor-engine.json.es.js +1 -1
  31. package/lib/src/sdk/package.json.cjs.js +1 -1
  32. package/lib/src/sdk/package.json.es.js +1 -1
  33. package/lib/src/sdk.cjs.js +116 -78
  34. package/lib/src/sdk.cjs.js.map +1 -1
  35. package/lib/src/sdk.d.ts +52 -34
  36. package/lib/src/sdk.es.js +116 -78
  37. package/lib/src/sdk.es.js.map +1 -1
  38. package/lib/src/types/BrandKitTypes.d.ts +70 -108
  39. package/lib/src/types/ColorStyleTypes.cjs.js +10 -0
  40. package/lib/src/types/ColorStyleTypes.cjs.js.map +1 -1
  41. package/lib/src/types/ColorStyleTypes.es.js +10 -0
  42. package/lib/src/types/ColorStyleTypes.es.js.map +1 -1
  43. package/lib/src/types/CommonTypes.cjs.js +1 -0
  44. package/lib/src/types/CommonTypes.cjs.js.map +1 -1
  45. package/lib/src/types/CommonTypes.d.ts +2 -1
  46. package/lib/src/types/CommonTypes.es.js +1 -0
  47. package/lib/src/types/CommonTypes.es.js.map +1 -1
  48. package/lib/src/types/ConnectorTypes.cjs.js +6 -2
  49. package/lib/src/types/ConnectorTypes.cjs.js.map +1 -1
  50. package/lib/src/types/ConnectorTypes.d.ts +10 -1
  51. package/lib/src/types/ConnectorTypes.es.js +6 -2
  52. package/lib/src/types/ConnectorTypes.es.js.map +1 -1
  53. package/lib/src/types/FrameTypes.cjs.js.map +1 -1
  54. package/lib/src/types/FrameTypes.d.ts +1 -4
  55. package/lib/src/types/FrameTypes.es.js.map +1 -1
  56. package/lib/src/types/MethodInvocationTypes.d.ts +27 -0
  57. package/lib/src/utils/EngineEventTrigger.cjs.js +4 -1
  58. package/lib/src/utils/EngineEventTrigger.cjs.js.map +1 -1
  59. package/lib/src/utils/EngineEventTrigger.d.ts +2 -1
  60. package/lib/src/utils/EngineEventTrigger.es.js +5 -2
  61. package/lib/src/utils/EngineEventTrigger.es.js.map +1 -1
  62. package/lib/src/utils/MethodInstrumentation.cjs.js +176 -0
  63. package/lib/src/utils/MethodInstrumentation.cjs.js.map +1 -0
  64. package/lib/src/utils/MethodInstrumentation.d.ts +10 -0
  65. package/lib/src/utils/MethodInstrumentation.es.js +176 -0
  66. package/lib/src/utils/MethodInstrumentation.es.js.map +1 -0
  67. package/lib/src/utils/SdkEvent.cjs.js +29 -0
  68. package/lib/src/utils/SdkEvent.cjs.js.map +1 -0
  69. package/lib/src/utils/SdkEvent.d.ts +13 -0
  70. package/lib/src/utils/SdkEvent.es.js +29 -0
  71. package/lib/src/utils/SdkEvent.es.js.map +1 -0
  72. package/lib/src/utils/SdkEvents.cjs.js +11 -0
  73. package/lib/src/utils/SdkEvents.cjs.js.map +1 -0
  74. package/lib/src/utils/SdkEvents.d.ts +19 -0
  75. package/lib/src/utils/SdkEvents.es.js +11 -0
  76. package/lib/src/utils/SdkEvents.es.js.map +1 -0
  77. package/package.json +1 -1
  78. package/lib/src/next/controllers/BrandKitController.cjs.js +0 -34
  79. package/lib/src/next/controllers/BrandKitController.cjs.js.map +0 -1
  80. package/lib/src/next/controllers/BrandKitController.d.ts +0 -24
  81. package/lib/src/next/controllers/BrandKitController.es.js +0 -34
  82. package/lib/src/next/controllers/BrandKitController.es.js.map +0 -1
  83. package/lib/src/next/types/BrandKitTypes.d.ts +0 -52
  84. package/lib/src/utils/BrandKitAdapter.cjs.js +0 -42
  85. package/lib/src/utils/BrandKitAdapter.cjs.js.map +0 -1
  86. package/lib/src/utils/BrandKitAdapter.d.ts +0 -9
  87. package/lib/src/utils/BrandKitAdapter.es.js +0 -42
  88. package/lib/src/utils/BrandKitAdapter.es.js.map +0 -1
package/_bundles/main.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(h,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(h=typeof globalThis<"u"?globalThis:h||self,D(h.StudioSDK=h.StudioSDK||{}))})(this,(function(h){"use strict";var rr=h=>{throw TypeError(h)};var ar=(h,D,V)=>D.has(h)||rr("Cannot "+V);var a=(h,D,V)=>(ar(h,D,"read from private field"),V?V.call(h):D.get(h)),g=(h,D,V)=>D.has(h)?rr("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(h):D.set(h,V),y=(h,D,V,pe)=>(ar(h,D,"write to private field"),pe?pe.call(h,V):D.set(h,V),V);var R,M,z,P,kn,ot,U,ct,qt,k,B,Nt,mt,Gn,ft,St,tt,Rt,ht,Yt,dt,bt,G,lt,Mt,E,Vt,l,F,f,Zt,et,Qt,L,Xt,_n,_,vt,Bt,Z,K,te,ut,ee,Tt,se,ne,H,Jt,C,Ut,kt,Hn,Gt,gt,st,re,It,_t,ye,yt,Ht,x,At,ae,Pt,Q;const V={current:"2.27.latest"},De={version:"1.44.1"};var W;(function(s){s.Call="call",s.Reply="reply",s.Syn="syn",s.SynAck="synAck",s.Ack="ack"})(W||(W={}));var pt;(function(s){s.Fulfilled="fulfilled",s.Rejected="rejected"})(pt||(pt={}));var jt;(function(s){s.ConnectionDestroyed="ConnectionDestroyed",s.ConnectionTimeout="ConnectionTimeout",s.NoIframeSrc="NoIframeSrc"})(jt||(jt={}));var we;(function(s){s.DataCloneError="DataCloneError"})(we||(we={}));var at;(function(s){s.Message="message"})(at||(at={}));const ir=(s,o)=>{const e=[];let t=!1;return{destroy(n){t||(t=!0,o(`${s}: Destroying connection`),e.forEach(r=>{r(n)}))},onDestroy(n){t?n():e.push(n)}}},or=s=>(...o)=>{s&&console.log("[Penpal]",...o)},cr={"http:":"80","https:":"443"},hr=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,dr=["file:","data:"],lr=s=>{if(s&&dr.find(d=>s.startsWith(d)))return"null";const o=document.location,e=hr.exec(s);let t,n,r;e?(t=e[1]?e[1]:o.protocol,n=e[2],r=e[4]):(t=o.protocol,n=o.hostname,r=o.port);const c=r&&r!==cr[t]?`:${r}`:"";return`${t}//${n}${c}`},Oe=({name:s,message:o,stack:e})=>({name:s,message:o,stack:e}),ur=s=>{const o=new Error;return Object.keys(s).forEach(e=>o[e]=s[e]),o},gr=(s,o,e)=>{const{localName:t,local:n,remote:r,originForSending:c,originForReceiving:d}=s;let u=!1;const w=p=>{if(p.source!==r||p.data.penpal!==W.Call)return;if(p.origin!==d){e(`${t} received message from origin ${p.origin} which did not match expected origin ${d}`);return}const v=p.data,{methodName:S,args:I,id:N}=v;e(`${t}: Received ${S}() call`);const O=b=>X=>{if(e(`${t}: Sending ${S}() reply`),u){e(`${t}: Unable to send ${S}() reply due to destroyed connection`);return}const $={penpal:W.Reply,id:N,resolution:b,returnValue:X};b===pt.Rejected&&X instanceof Error&&($.returnValue=Oe(X),$.returnValueIsError=!0);try{r.postMessage($,c)}catch(A){if(A.name===we.DataCloneError){const nt={penpal:W.Reply,id:N,resolution:pt.Rejected,returnValue:Oe(A),returnValueIsError:!0};r.postMessage(nt,c)}throw A}};new Promise(b=>b(o[S].apply(o,I))).then(O(pt.Fulfilled),O(pt.Rejected))};return n.addEventListener(at.Message,w),()=>{u=!0,n.removeEventListener(at.Message,w)}};let yr=0;const pr=()=>++yr,Fe=".",Le=s=>s?s.split(Fe):[],wr=s=>s.join(Fe),Cr=(s,o)=>{const e=Le(o||"");return e.push(s),wr(e)},mr=(s,o,e)=>{const t=Le(o);return t.reduce((n,r,c)=>(typeof n[r]>"u"&&(n[r]={}),c===t.length-1&&(n[r]=e),n[r]),s),s},Ne=(s,o)=>{const e={};return Object.keys(s).forEach(t=>{const n=s[t],r=Cr(t,o);typeof n=="object"&&Object.assign(e,Ne(n,r)),typeof n=="function"&&(e[r]=n)}),e},fr=s=>{const o={};for(const e in s)mr(o,e,s[e]);return o},Sr=(s,o,e,t,n)=>{const{localName:r,local:c,remote:d,originForSending:u,originForReceiving:w}=o;let p=!1;n(`${r}: Connecting call sender`);const v=I=>(...N)=>{n(`${r}: Sending ${I}() call`);let O;try{d.closed&&(O=!0)}catch{O=!0}if(O&&t(),p){const b=new Error(`Unable to send ${I}() call due to destroyed connection`);throw b.code=jt.ConnectionDestroyed,b}return new Promise((b,X)=>{const $=pr(),A=rt=>{if(rt.source!==d||rt.data.penpal!==W.Reply||rt.data.id!==$)return;if(rt.origin!==w){n(`${r} received message from origin ${rt.origin} which did not match expected origin ${w}`);return}const xt=rt.data;n(`${r}: Received ${I}() reply`),c.removeEventListener(at.Message,A);let $t=xt.returnValue;xt.returnValueIsError&&($t=ur($t)),(xt.resolution===pt.Fulfilled?b:X)($t)};c.addEventListener(at.Message,A);const nt={penpal:W.Call,id:$,methodName:I,args:N};d.postMessage(nt,u)})},S=e.reduce((I,N)=>(I[N]=v(N),I),{});return Object.assign(s,fr(S)),()=>{p=!0}},br=(s,o,e,t,n)=>{const{destroy:r,onDestroy:c}=t;let d,u;const w={};return p=>{if(p.origin!==o){n(`Parent: Handshake - Received ACK message from origin ${p.origin} which did not match expected origin ${o}`);return}n("Parent: Handshake - Received ACK");const v={localName:"Parent",local:window,remote:p.source,originForSending:e,originForReceiving:o};d&&d(),d=gr(v,s,n),c(d),u&&u.forEach(I=>{delete w[I]}),u=p.data.methodNames;const S=Sr(w,v,u,r,n);return c(S),w}},vr=(s,o,e,t)=>n=>{if(n.origin!==e){s(`Parent: Handshake - Received SYN message from origin ${n.origin} which did not match expected origin ${e}`);return}s("Parent: Handshake - Received SYN, responding with SYN-ACK");const r={penpal:W.SynAck,methodNames:Object.keys(o)};n.source.postMessage(r,t)},Ir=6e4,Ar=(s,o)=>{const{destroy:e,onDestroy:t}=o,n=setInterval(()=>{s.isConnected||(clearInterval(n),e())},Ir);t(()=>{clearInterval(n)})},Pr=(s,o)=>{let e;return s!==void 0&&(e=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${s}ms`);t.code=jt.ConnectionTimeout,o(t)},s)),()=>{clearTimeout(e)}},Er=s=>{if(!s.src&&!s.srcdoc){const o=new Error("Iframe must have src or srcdoc property defined.");throw o.code=jt.NoIframeSrc,o}},Dr=s=>{let{iframe:o,methods:e={},childOrigin:t,timeout:n,debug:r=!1}=s;const c=or(r),d=ir("Parent",c),{onDestroy:u,destroy:w}=d;t||(Er(o),t=lr(o.src));const p=t==="null"?"*":t,v=Ne(e),S=vr(c,v,t,p),I=br(v,t,p,d,c);return{promise:new Promise((O,b)=>{const X=Pr(n,w),$=A=>{if(!(A.source!==o.contentWindow||!A.data)){if(A.data.penpal===W.Syn){S(A);return}if(A.data.penpal===W.Ack){const nt=I(A);nt&&(X(),O(nt));return}}};window.addEventListener(at.Message,$),c("Parent: Awaiting handshake"),Ar(o,d),u(A=>{window.removeEventListener(at.Message,$),A&&b(A)})}),destroy(){w()}}},Or=s=>{const o=new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w]+\/$/);let e="";return o.test(s)?e=s:s.indexOf("/index.html")>-1?e=s.replace("/index.html","/"):s.charAt(-1)!=="/"&&(e=`${s}/`),e},Fr=(s,o,e)=>{const t=Or(o),r=`<html>
1
+ (function(c,F){typeof exports=="object"&&typeof module<"u"?F(exports):typeof define=="function"&&define.amd?define(["exports"],F):(c=typeof globalThis<"u"?globalThis:c||self,F(c.StudioSDK=c.StudioSDK||{}))})(this,(function(c){"use strict";var hr=c=>{throw TypeError(c)};var cr=(c,F,k)=>F.has(c)||hr("Cannot "+k);var a=(c,F,k)=>(cr(c,F,"read from private field"),k?k.call(c):F.get(c)),g=(c,F,k)=>F.has(c)?hr("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(c):F.set(c,k),y=(c,F,k,me)=>(cr(c,F,"write to private field"),me?me.call(c,k):F.set(c,k),k);var V,T,K,P,ot,_,ht,qt,H,J,Mt,Ct,$n,ft,St,et,Rt,ct,Yt,dt,bt,x,lt,Vt,E,Tt,l,N,f,Zt,st,Qt,R,Xt,jn,$,It,kt,X,q,te,ut,ee,Bt,se,ne,j,Jt,w,Ut,Gt,zn,gt,nt,re,vt,_t,pe,yt,Ht,z,At,ae,Pt,tt;const k={current:"2.28.latest"},Fe={version:"1.45.0"};var Y;(function(s){s.Call="call",s.Reply="reply",s.Syn="syn",s.SynAck="synAck",s.Ack="ack"})(Y||(Y={}));var pt;(function(s){s.Fulfilled="fulfilled",s.Rejected="rejected"})(pt||(pt={}));var jt;(function(s){s.ConnectionDestroyed="ConnectionDestroyed",s.ConnectionTimeout="ConnectionTimeout",s.NoIframeSrc="NoIframeSrc"})(jt||(jt={}));var we;(function(s){s.DataCloneError="DataCloneError"})(we||(we={}));var at;(function(s){s.Message="message"})(at||(at={}));const dr=(s,o)=>{const e=[];let t=!1;return{destroy(n){t||(t=!0,o(`${s}: Destroying connection`),e.forEach(r=>{r(n)}))},onDestroy(n){t?n():e.push(n)}}},lr=s=>(...o)=>{s&&console.log("[Penpal]",...o)},ur={"http:":"80","https:":"443"},gr=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,yr=["file:","data:"],pr=s=>{if(s&&yr.find(d=>s.startsWith(d)))return"null";const o=document.location,e=gr.exec(s);let t,n,r;e?(t=e[1]?e[1]:o.protocol,n=e[2],r=e[4]):(t=o.protocol,n=o.hostname,r=o.port);const h=r&&r!==ur[t]?`:${r}`:"";return`${t}//${n}${h}`},Le=({name:s,message:o,stack:e})=>({name:s,message:o,stack:e}),mr=s=>{const o=new Error;return Object.keys(s).forEach(e=>o[e]=s[e]),o},wr=(s,o,e)=>{const{localName:t,local:n,remote:r,originForSending:h,originForReceiving:d}=s;let u=!1;const m=p=>{if(p.source!==r||p.data.penpal!==Y.Call)return;if(p.origin!==d){e(`${t} received message from origin ${p.origin} which did not match expected origin ${d}`);return}const S=p.data,{methodName:b,args:v,id:O}=S;e(`${t}: Received ${b}() call`);const A=L=>D=>{if(e(`${t}: Sending ${b}() reply`),u){e(`${t}: Unable to send ${b}() reply due to destroyed connection`);return}const M={penpal:Y.Reply,id:O,resolution:L,returnValue:D};L===pt.Rejected&&D instanceof Error&&(M.returnValue=Le(D),M.returnValueIsError=!0);try{r.postMessage(M,h)}catch(I){if(I.name===we.DataCloneError){const U={penpal:Y.Reply,id:O,resolution:pt.Rejected,returnValue:Le(I),returnValueIsError:!0};r.postMessage(U,h)}throw I}};new Promise(L=>L(o[b].apply(o,v))).then(A(pt.Fulfilled),A(pt.Rejected))};return n.addEventListener(at.Message,m),()=>{u=!0,n.removeEventListener(at.Message,m)}};let Cr=0;const fr=()=>++Cr,Ne=".",Me=s=>s?s.split(Ne):[],Sr=s=>s.join(Ne),br=(s,o)=>{const e=Me(o||"");return e.push(s),Sr(e)},Ir=(s,o,e)=>{const t=Me(o);return t.reduce((n,r,h)=>(typeof n[r]>"u"&&(n[r]={}),h===t.length-1&&(n[r]=e),n[r]),s),s},Re=(s,o)=>{const e={};return Object.keys(s).forEach(t=>{const n=s[t],r=br(t,o);typeof n=="object"&&Object.assign(e,Re(n,r)),typeof n=="function"&&(e[r]=n)}),e},vr=s=>{const o={};for(const e in s)Ir(o,e,s[e]);return o},Ar=(s,o,e,t,n)=>{const{localName:r,local:h,remote:d,originForSending:u,originForReceiving:m}=o;let p=!1;n(`${r}: Connecting call sender`);const S=v=>(...O)=>{n(`${r}: Sending ${v}() call`);let A;try{d.closed&&(A=!0)}catch{A=!0}if(A&&t(),p){const L=new Error(`Unable to send ${v}() call due to destroyed connection`);throw L.code=jt.ConnectionDestroyed,L}return new Promise((L,D)=>{const M=fr(),I=rt=>{if(rt.source!==d||rt.data.penpal!==Y.Reply||rt.data.id!==M)return;if(rt.origin!==m){n(`${r} received message from origin ${rt.origin} which did not match expected origin ${m}`);return}const xt=rt.data;n(`${r}: Received ${v}() reply`),h.removeEventListener(at.Message,I);let $t=xt.returnValue;xt.returnValueIsError&&($t=mr($t)),(xt.resolution===pt.Fulfilled?L:D)($t)};h.addEventListener(at.Message,I);const U={penpal:Y.Call,id:M,methodName:v,args:O};d.postMessage(U,u)})},b=e.reduce((v,O)=>(v[O]=S(O),v),{});return Object.assign(s,vr(b)),()=>{p=!0}},Pr=(s,o,e,t,n)=>{const{destroy:r,onDestroy:h}=t;let d,u;const m={};return p=>{if(p.origin!==o){n(`Parent: Handshake - Received ACK message from origin ${p.origin} which did not match expected origin ${o}`);return}n("Parent: Handshake - Received ACK");const S={localName:"Parent",local:window,remote:p.source,originForSending:e,originForReceiving:o};d&&d(),d=wr(S,s,n),h(d),u&&u.forEach(v=>{delete m[v]}),u=p.data.methodNames;const b=Ar(m,S,u,r,n);return h(b),m}},Er=(s,o,e,t)=>n=>{if(n.origin!==e){s(`Parent: Handshake - Received SYN message from origin ${n.origin} which did not match expected origin ${e}`);return}s("Parent: Handshake - Received SYN, responding with SYN-ACK");const r={penpal:Y.SynAck,methodNames:Object.keys(o)};n.source.postMessage(r,t)},Or=6e4,Dr=(s,o)=>{const{destroy:e,onDestroy:t}=o,n=setInterval(()=>{s.isConnected||(clearInterval(n),e())},Or);t(()=>{clearInterval(n)})},Fr=(s,o)=>{let e;return s!==void 0&&(e=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${s}ms`);t.code=jt.ConnectionTimeout,o(t)},s)),()=>{clearTimeout(e)}},Lr=s=>{if(!s.src&&!s.srcdoc){const o=new Error("Iframe must have src or srcdoc property defined.");throw o.code=jt.NoIframeSrc,o}},Nr=s=>{let{iframe:o,methods:e={},childOrigin:t,timeout:n,debug:r=!1}=s;const h=lr(r),d=dr("Parent",h),{onDestroy:u,destroy:m}=d;t||(Lr(o),t=pr(o.src));const p=t==="null"?"*":t,S=Re(e),b=Er(h,S,t,p),v=Pr(S,t,p,d,h);return{promise:new Promise((A,L)=>{const D=Fr(n,m),M=I=>{if(!(I.source!==o.contentWindow||!I.data)){if(I.data.penpal===Y.Syn){b(I);return}if(I.data.penpal===Y.Ack){const U=v(I);U&&(D(),A(U));return}}};window.addEventListener(at.Message,M),h("Parent: Awaiting handshake"),Dr(o,d),u(I=>{window.removeEventListener(at.Message,M),I&&L(I)})}),destroy(){m()}}},Mr=s=>{const o=new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w]+\/$/);let e="";return o.test(s)?e=s:s.indexOf("/index.html")>-1?e=s.replace("/index.html","/"):s.charAt(-1)!=="/"&&(e=`${s}/`),e},Rr=(s,o,e)=>{const t=Mr(o),r=`<html>
2
2
  <head>
3
3
  <base href="/" />
4
4
  <meta charset="UTF-8"/>
@@ -65,5 +65,5 @@
65
65
  }
66
66
  <\/script>
67
67
  </body>
68
- </html>`;s.srcdoc=r};let oe=null;const Lr=(s,o,e,t="chili-editor",n,r)=>{oe&&window.removeEventListener("message",oe);const c=`#${t}`,d=document.createElement("iframe");d.setAttribute("srcdoc"," "),d.setAttribute("title","Chili-Editor"),d.setAttribute("style","width: 100%; height: 100%;"),d.setAttribute("frameBorder","0"),d.setAttribute("referrerpolicy","origin");const u=()=>{const w=document.querySelector(c);if(w){w==null||w.appendChild(d),d.addEventListener("error",()=>{const p=new Error("Failed to setup frame: iframe failed to load");r==null||r(p)},{capture:!0,once:!0});try{Fr(d,s,n)}catch(p){p instanceof Error?r==null||r(p):r==null||r(new Error(`Failed to setup frame: ${p}`))}}};document.readyState==="complete"||document.readyState==="interactive"?u():document.addEventListener("DOMContentLoaded",()=>{u()}),oe=w=>{var p;if(w.source===d.contentWindow&&((p=w.data)==null?void 0:p.type)==="iframe-error"){const v=w.data.error,S=new Error(v.message||"Failed to setup frame: error in iframe");r==null||r(S)}},window.addEventListener("message",oe),e(Dr({iframe:d,methods:{actionsChanged:o.onActionsChanged,stateChanged:o.onStateChanged,documentLoaded:o.onDocumentLoaded,authExpired:o.onAuthExpired,viewportRequested:o.onViewportRequested,selectedFramesContent:o.onSelectedFramesContentChanged,selectedFramesLayout:o.onSelectedFramesLayoutChanged,allFramesLayout:o.onFramesLayoutChanged,selectedLayoutProperties:o.onSelectedLayoutPropertiesChanged,openLayoutPropertiesPanel:o.onPageSelectionChanged,selectedLayoutUnit:o.onSelectedLayoutUnitChanged,scrubberPositionChanged:o.onScrubberPositionChanged,frameAnimationsChanged:o.onFrameAnimationsChanged,selectedToolChanged:o.onSelectedToolChanged,variableListChanged:o.onVariableListChanged,undoStackStateChanged:o.onUndoStateChanged,selectedLayoutFramesChanged:o.onSelectedLayoutFramesChanged,selectedTextStyleChanged:o.onSelectedTextStyleChanged,colorsChanged:o.onColorsChanged,paragraphStylesChanged:o.onParagraphStylesChanged,characterStylesChanged:o.onCharacterStylesChanged,fontFamiliesChanged:o.onFontFamiliesChanged,selectedLayoutId:o.onSelectedLayoutIdChanged,layoutListChanged:o.onLayoutsChanged,connectorEvent:o.onConnectorEvent,connectorsChanged:o.onConnectorsChanged,zoomChanged:o.onZoomChanged,pageSnapshotInvalidated:o.onPageSnapshotInvalidated,pagesChanged:o.onPagesChanged,pageSizeChanged:o.onPageSizeChanged,shapeCornerRadiusChanged:o.onShapeCornerRadiusChanged,cropActiveFrameIdChanged:o.onCropActiveFrameIdChanged,asyncError:o.onAsyncError,viewModeChanged:o.onViewModeChanged,barcodeValidationChanged:o.onBarcodeValidationChanged,selectedPageIdChanged:o.onSelectedPageIdChanged,dataSourceIdChanged:o.onDataSourceIdChanged,injectedDataChanged:o.onInjectedDataChanged,documentIssueListChanged:o.onDocumentIssueListChanged,customUndoDataChanged:o.onCustomUndoDataChanged,engineEditingModeChanged:o.onEngineEditModeChanged,brandKitMediaChanged:o.onBrandKitMediaChanged}}))};var q=(s=>(s.GraFxStudioEnvironmentApiUrl="ENVIRONMENT_API",s.GraFxStudioSdkVersion="SDK_VERSION",s.GraFxStudioDocumentType="DOCUMENT_TYPE",s.GraFxStudioTemplateId="TEMPLATE_ID",s.GraFxStudioAuthToken="GRAFX_AUTH_TOKEN",s.QueryCallCacheEnabled="ENABLE_QUERY_CALL_CACHE",s))(q||{}),Re=(s=>(s.full="full",s.followConstraints="followConstraints",s))(Re||{});const Nr={shortcutOptions:{debugPanel:{enabled:!1},ellipse:{enabled:!1},hand:{enabled:!1},temporaryHand:{enabled:!1},image:{enabled:!1},polygon:{enabled:!1},rectangle:{enabled:!1},select:{enabled:!1},text:{enabled:!1},zoom:{enabled:!1},copyPaste:{enabled:!1},viewMode:{enabled:!1},componentGrid:{enabled:!1}},frameEditingMode:"full"};var Me=(s=>(s.overflow="overflow",s.fontLoading="fontLoading",s.actionRegister="actionRegister",s.actionExecution="actionExecution",s.actionCircular="actionCircular",s))(Me||{}),Ce=(s=>(s.project="project",s.template="template",s.component="component",s))(Ce||{});class Ve{constructor(o,e,t,n){this.type="action",this.message=o,this.id=e,this.event=t,this.eventChain=n}}class Be{constructor(o,e,t){this.type="dataRow",this.count=o,this.message=e,this.exceptions=t}}class Te extends Error{constructor(o,e,t){super(e,t),this.statusCode=o}}class Je extends Error{constructor(o,e,t){super(e,t),this.context=o}}const Rr=404075,Mr=403032;function wt(s){const o=s.error??"Yikes, something went wrong",e={cause:{name:String(s.status),message:s.error??"Yikes, something went wrong"}};if(s.status===Rr){const n=JSON.parse(s.data).statusCode;throw new Te(n,o,e)}else throw new Error(o,e)}function Vr(s){const o=[/DateVariable '([^']+)' should not be part of excludedDays, ".*" was given/,/DateVariable '([^']+)' expects \$date to be > startDate:.*$/,/DateVariable '([^']+)' expects \$date to be < endDate:.*$/,/NumberVariable '([^']+)' expects \$extractedValue to be >= .+$/,/NumberVariable '([^']+)' expects \$extractedValue to be <= .+$/];for(const e of o)if(s.match(e))return{valid:!0};return{valid:!1}}function Br(s,o){if(s.status===Mr&&s.error){const e=s.error;if(Vr(e).valid)throw new Je(o,e,{cause:{name:String(s.status),message:e}})}}function Tr(s){wt(s)}function i(s,o){let e=!0,t=!1,n=Tr;typeof o=="function"?(t=!0,n=o):typeof o=="boolean"&&(e=o);try{s.success||(n(s),t&&wt(s));const r=s.data&&e;return{...s,parsedData:r?JSON.parse(s.data):s.data}}catch(r){throw console.error(r),r}}class Ue{constructor(o){g(this,R);this.getAll=async()=>(await a(this,R)).getActions().then(t=>i(t)),this.getById=async e=>(await a(this,R)).getActionById(e).then(n=>i(n)),this.create=async()=>(await a(this,R)).createAction().then(t=>i(t)),this.duplicate=async e=>(await a(this,R)).duplicateAction(e).then(n=>i(n)),this.remove=async e=>(await a(this,R)).removeAction(e).then(n=>i(n)),this.update=async(e,t)=>(await a(this,R)).updateAction(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>this.update(e,{name:t}),this.updateScript=async(e,t)=>this.update(e,{script:t}),this.updateTriggers=async(e,t)=>this.update(e,{triggers:t}),this.move=async(e,t)=>(await a(this,R)).moveActions(e,t).then(r=>i(r)),this.setTypeError=async(e,t)=>this.update(e,{hasTypeError:t}),this.disable=async()=>(await a(this,R)).disableActions().then(t=>i(t)),this.enable=async()=>(await a(this,R)).enableActions().then(t=>i(t)),this.enableForComponents=async e=>(await a(this,R)).enableComponentActions(e).then(n=>i(n)),y(this,R,o)}}R=new WeakMap;class ke{constructor(o){g(this,M);this.getAllOnSelectedLayout=async()=>(await a(this,M)).getAnimationsOnSelectedLayout().then(t=>i(t)),this.getByFrameId=async(e,t)=>(await a(this,M)).getAnimationByFrameId(e,t).then(r=>i(r)),this.getByLayoutId=async e=>(await a(this,M)).getAnimationsByLayoutId(e).then(n=>i(n)),this.setFrameAnimation=async e=>(await a(this,M)).setFrameAnimation(JSON.stringify(e)).then(n=>i({...n,data:JSON.stringify(e)})),this.play=async()=>(await a(this,M)).playAnimation().then(t=>i(t)),this.pause=async()=>(await a(this,M)).pauseAnimation().then(t=>i(t)),this.setScrubberPosition=async e=>(await a(this,M)).setScrubberPosition(e).then(n=>i(n)),this.setDuration=async e=>(await a(this,M)).setAnimationDuration(e).then(n=>i(n)),this.resetFrameAnimation=async e=>(await a(this,M)).resetFrameAnimation(e).then(n=>i(n)),this.reset=async()=>(await a(this,M)).resetAnimation().then(t=>i(t)),y(this,M,o)}}M=new WeakMap;var j=(s=>(s.code39="code39",s.code93="code93",s.code128="code128",s.dataMatrix="dataMatrix",s.ean13="ean13",s.ean8="ean8",s.qr="qr",s.upca="upca",s.upce="upce",s.gs1128="gs1128",s))(j||{}),Et=(s=>(s.low="low",s.medium="medium",s.quartile="quartile",s.high="high",s))(Et||{}),Ct=(s=>(s.utf8="utf8",s.iso8859_1="iso8859_1",s.code128a="code128a",s.code128b="code128b",s.code128c="code128c",s))(Ct||{}),Ge=(s=>(s.success="success",s.empty="empty",s.invalidLength="invalidLength",s.invalidCharacters="invalidCharacters",s.invalidChecksum="invalidChecksum",s.invalidUPCE="invalidUPCE",s.otherError="otherError",s))(Ge||{}),_e=(s=>(s.px="px",s.mm="mm",s.cm="cm",s.inch="inch",s.pt="pt",s))(_e||{}),Y=(s=>(s.top="top",s.right="right",s.bottom="bottom",s.left="left",s))(Y||{}),He=(s=>(s.top="top",s.child="child",s))(He||{}),xe=(s=>(s.print="print",s.digitalStatic="digitalStatic",s.digitalAnimated="digitalAnimated",s))(xe||{}),$e=(s=>(s.locked="locked",s.range="range",s.none="none",s))($e||{});class je{constructor(o){g(this,z);this.setBarcodeProperties=async(e,t)=>(await a(this,z)).setBarcodeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableBackground=async(e,t)=>{const n={enableBackground:t};return this.setBarcodeProperties(e,n)},this.setBackgroundColor=async(e,t)=>{const n={backgroundColor:t};return this.setBarcodeProperties(e,n)},this.setEnableBars=async(e,t)=>{const n={enableBars:t};return this.setBarcodeProperties(e,n)},this.setBarColor=async(e,t)=>{const n={barColor:t};return this.setBarcodeProperties(e,n)},this.setBarcodeSource=async(e,t)=>(await a(this,z)).setBarcodeSource(e,JSON.stringify(t)).then(r=>i(r)),this.removeBarcodeSource=async e=>(await a(this,z)).setBarcodeSource(e,null).then(n=>i(n)),this.setEnableText=async(e,t)=>{const n={enableText:t};return this.setBarcodeProperties(e,n)},this.setBarHeight=async(e,t)=>{const n={barHeight:t};return this.setBarcodeProperties(e,n)},this.setMagnification=async(e,t)=>{const n={magnification:t};return this.setBarcodeProperties(e,n)},this.setQuietZoneValue=async(e,t,n)=>{const r=n?{left:n===Y.left?t:void 0,top:n===Y.top?t:void 0,right:n===Y.right?t:void 0,bottom:n===Y.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,z)).setBarcodeProperties(e,JSON.stringify({quietZone:r})).then(d=>i(d))},this.setAreQuietZoneValuesCombined=async(e,t)=>{const n={areQuietZoneValuesCombined:t};return(await a(this,z)).setBarcodeProperties(e,JSON.stringify({quietZone:n})).then(c=>i(c))},this.setErrorCorrectionLevel=async(e,t)=>(await a(this,z)).setBarcodeProperties(e,JSON.stringify({errorCorrectionLevel:t})).then(r=>i(r)),this.setCharacterSet=async(e,t)=>(await a(this,z)).setBarcodeProperties(e,JSON.stringify({characterSet:t})).then(r=>i(r)),this.setDrawLightMarginIndicator=async(e,t)=>{const n={drawStartStopChars:t};return this.setBarcodeProperties(e,n)},this.setDrawStartStopChars=async(e,t)=>{const n={drawStartStopChars:t};return this.setBarcodeProperties(e,n)},this.getBarcodeConfigationOptions=e=>{let t=!0,n=!0,r=!0,c,d,u=!1,w=!1,p=!1;switch(e){case j.qr:c=[Ct.iso8859_1,Ct.utf8],d=[Et.low,Et.medium,Et.quartile,Et.high];case j.dataMatrix:t=!1,n=!1,r=!1,u=!0;break;case j.ean13:t=!1,w=!0;break;case j.ean8:w=!0;case j.upca:case j.upce:t=!1;break;case j.code128:case j.gs1128:c=[Ct.code128a,Ct.code128b,Ct.code128c];break;case j.code39:p=!0;break}return{allowEnableMagnification:r,allowBarHeight:n,allowQuietZone:!0,allowedCharacterSets:c,allowedErrorCorrectionLevels:d,allowToggleText:t,quietZoneAlwaysCombined:u,allowToggleLightMarginIndicator:w,allowToggleDrawStartAndEndChar:p}},y(this,z,o)}}z=new WeakMap;function Jr(s){const o=s.fontFamilies.length>0?String(s.fontFamilies[0].connectorId):"",e={id:s.id??"",name:s.name??"",dateCreated:"",lastModifiedDate:s.version??"",fonts:s.fontFamilies,colors:s.colors,characterStyles:s.characterStyles,paragraphStyles:s.paragraphStyles,media:s.media,themes:s.themes};return{id:s.id??"",name:s.name??"",fontConnectorId:o,brandKit:e}}function Ur(s){return{id:s.id??"",version:s.version??"",name:s.name??"",colors:s.colors,gradients:s.gradients,fonts:s.fontFamilies,characterStyles:s.characterStyles,paragraphStyles:s.paragraphStyles,media:s.media,themes:s.themes}}let ze=(kn=class{constructor(o,e){g(this,P);this.getId=async()=>(await a(this,P)).getBrandKitId().then(n=>i(n)),this.getVersion=async()=>(await a(this,P)).getBrandKitVersion().then(n=>i(n)),this.getName=async()=>(await a(this,P)).getBrandKitName().then(n=>i(n)),this.rename=async t=>(await a(this,P)).renameBrandKit(t).then(r=>i(r)),this.updateIdAndVersion=async(t,n)=>(await a(this,P)).updateBrandKitIdAndVersion(t,n).then(c=>i(c)),this.get=async()=>{const n=await(await a(this,P)).getBrandKit(),r=i(n),c=r.parsedData;if(c==null)throw new Error("Brand kit response has no data");return{...r,parsedData:Jr(c)}},this.getAllMedia=async()=>(await a(this,P)).getAllBrandKitMedia().then(n=>i(n)),this.addMedia=async(t,n,r)=>(await a(this,P)).addBrandKitMedia(t,n,r).then(d=>i(d)),this.updateMedia=async(t,n,r)=>(await a(this,P)).updateBrandKitMedia(t,n,r).then(d=>i(d)),this.renameMedia=async(t,n)=>(await a(this,P)).renameBrandKitMedia(t,n).then(c=>i(c)),this.removeMedia=async t=>(await a(this,P)).removeBrandKitMedia(t).then(r=>i(r)),this.remove=async()=>{const n=(await this.colorStyleController.getAll()).parsedData||[],c=(await this.gradientStyleController.getAll()).parsedData||[],u=(await this.paragraphStyleController.getAll()).parsedData||[],p=(await this.characterStyleController.getAll()).parsedData||[],S=(await this.fontController.getFontFamilies()).parsedData||[],N=(await this.getAllMedia()).parsedData||[];await this.undoManagerController.record("brandKit.remove",async O=>{for(const b of n)await O.colorStyle.remove(b.id);for(const b of c)await O.gradientStyle.remove(b.id);for(const b of u)await O.paragraphStyle.remove(b.id);for(const b of p)await O.characterStyle.remove(b.id);for(const b of S)await O.font.removeFontFamily(b.id);for(const b of N)await this.removeMedia(b.name)})},this.set=async t=>{const r=await(await a(this,P)).setBrandKit(JSON.stringify(t.brandKit)),c=i(r),d=c.parsedData;if(d==null)throw new Error("Brand kit set response has no data");return{...c,parsedData:Ur(d)}},this.isAutoSync=async()=>(await a(this,P)).isBrandKitAutoSync().then(n=>i(n)),this.enableAutoSync=async t=>(await a(this,P)).enableBrandKitAutoSync(t).then(r=>i(r)),y(this,P,o),this.colorStyleController=e.colorStyle,this.gradientStyleController=e.gradientStyle,this.fontController=e.font,this.mediaController=e.mediaConnector,this.paragraphStyleController=e.paragraphStyle,this.characterStyleController=e.characterStyle,this.undoManagerController=e.undoManager}},P=new WeakMap,kn);class me{constructor(o){g(this,ot);this.zoomToPage=async(e,t,n,r,c)=>(e!==void 0&&console.warn("id has no effect and will be deprecated in the future"),(await a(this,ot)).zoomToPage(t,n,r,c).then(u=>i(u))),this.getZoomPercentage=async()=>(await a(this,ot)).getZoomPercentage().then(t=>i(t)),this.setZoomPercentage=async e=>(await a(this,ot)).setZoomPercentage(e).then(n=>i(n)),this.setViewMode=async e=>(await a(this,ot)).setViewMode(e).then(n=>i(n)),y(this,ot,o)}}ot=new WeakMap;class Ke{constructor(o){g(this,U);this.getAll=async()=>(await a(this,U)).getCharacterStyles().then(t=>i(t)),this.getById=async e=>(await a(this,U)).getCharacterStyleById(e).then(n=>i(n)),this.create=async()=>(await a(this,U)).createCharacterStyle().then(t=>i(t)),this.update=async(e,t)=>(await a(this,U)).updateCharacterStyle(e,JSON.stringify(t)).then(r=>i(r)),this.remove=async e=>(await a(this,U)).removeCharacterStyle(e).then(n=>i(n)),this.duplicate=async e=>(await a(this,U)).duplicateCharacterStyle(e).then(n=>i(n)),this.rename=async(e,t)=>(await a(this,U)).renameCharacterStyle(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,U)).moveCharacterStyles(e,t).then(r=>i(r)),y(this,U,o)}}U=new WeakMap;class We{constructor(o){g(this,ct);this.copyFrames=async e=>{const n=await(await a(this,ct)).copyFrames(e);return n.data&&await navigator.clipboard.writeText(n.data),i(n)},this.cutFrames=async e=>{const n=await(await a(this,ct)).cutFrames(e);return n.data&&await navigator.clipboard.writeText(n.data),i(n)},this.pasteFrames=async()=>{const e=await a(this,ct),t=await navigator.clipboard.readText(),n=await e.pasteFrames(t);return i(n)},this.getContentType=async()=>{const e=await a(this,ct),t=await navigator.clipboard.readText(),n=await e.getClipboardContentType(t);return i(n)},y(this,ct,o)}}ct=new WeakMap;class qe{constructor(o){g(this,qt);this.convertToRgb=async e=>(await a(this,qt)).colorToRgb(JSON.stringify(e)).then(n=>i(n)),y(this,qt,o)}}qt=new WeakMap;var ce=(s=>(s.rgb="rgb",s.hex="hex",s.cmyk="cmyk",s.gray="gray",s.hsl="hsl",s.spot="spot",s.spotCMYK="spotCMYK",s.spotRGB="spotRGB",s.spotHEX="spotHEX",s))(ce||{}),Ye=(s=>(s.local="local",s.brandKit="brandKit",s.stylekit="brandKit",s))(Ye||{});class Ze{constructor(o){g(this,k);this.getAll=async()=>(await a(this,k)).getColors().then(t=>i(t)),this.getById=async e=>(await a(this,k)).getColorById(e).then(n=>i(n)),this.create=async()=>(await a(this,k)).createColor().then(t=>i(t)),this.duplicate=async e=>(await a(this,k)).duplicateColor(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,k)).moveColors(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,k)).renameColor(e,t).then(r=>i(r)),this.update=async(e,t)=>{const n=await a(this,k),r=t;return r.type===ce.spot&&(r.type=ce.spotCMYK),n.updateColor(e,JSON.stringify(r)).then(c=>i(c))},this.remove=async e=>(await a(this,k)).removeColor(e).then(n=>i(n)),y(this,k,o)}}k=new WeakMap;var Dt=(s=>(s[s.file=0]="file",s[s.collection=1]="collection",s))(Dt||{}),he=(s=>(s.LowResolutionWeb="lowresWeb",s.HighResolutionWeb="highresWeb",s))(he||{}),Ot=(s=>(s.file="file",s.collection="collection",s))(Ot||{}),Qe=(s=>(s.media="media",s.fonts="fonts",s.data="data",s.components="components",s))(Qe||{}),Xe=(s=>(s.name="name",s.path="relativePath",s.id="id",s))(Xe||{}),ts=(s=>(s.ascending="asc",s.descending="desc",s))(ts||{}),es=(s=>(s.text="text",s.boolean="boolean",s.number="number",s))(es||{}),ss=(s=>(s.query="query",s.upload="upload",s))(ss||{}),Ft=(s=>(s.url="url",s.grafx="grafx",s.local="local",s))(Ft||{});class kr{constructor(o,e,t,n="engineToConnector"){this.direction="engineToConnector",this.name=o,this.direction=n,e==="var"?this.value=`${e}.${t}`:this.value=t}}var ns=(s=>(s.variable="var",s.value="value",s))(ns||{}),rs=(s=>(s.engineToConnector="engineToConnector",s.connectorToEngine="connectorToEngine",s))(rs||{}),de=(s=>(s.loading="loading",s.loaded="loaded",s.running="running",s.ready="ready",s.error="error",s))(de||{}),as=(s=>(s.stateChanged="stateChanged",s.authChanged="authChanged",s.reloadRequired="reloadRequired",s.unloaded="unloaded",s))(as||{});const Gr={url:"grafx-media.json",source:"local"};class _r{constructor(o,e){this.type="grafxToken",this.token=o,this.headers=e}}class Hr{constructor(o){this.type="refreshed",this.headers=o}}var is=(s=>(s.grafxToken="grafxToken",s.refreshed="refreshed",s))(is||{}),os=(s=>(s.grafxToken="grafxToken",s.any="any",s))(os||{}),fe=(s=>(s.minDimension="minDimension",s))(fe||{});class cs extends Error{constructor(o,e){super(o),this.type=e}}var hs=(s=>(s.StaticKey="staticKey",s.OAuth2ClientCredentials="oAuth2ClientCredentials",s.OAuth2AuthorizationCode="oAuth2AuthorizationCode",s.OAuth2ResourceOwnerPassword="oAuth2ResourceOwnerPassword",s.OAuth2JwtBearer="oAuth2JwtBearer",s.None="none",s))(hs||{});class le{constructor(){this.makeConnectorSourceForwardsCompatible=o=>{if(o.source!=Ft.grafx||this.isSourceMigrated(o))return o;let e=o.url;for(;e.endsWith("/");)e=e.substring(0,e.length-1);const t=e.split("/");return{id:t[t.length-1],source:Ft.grafx}},this.makeMultipleConnectorsBackwardsCompatible=(o,e)=>o.map(t=>this.makeSingleConnectorBackwardsCompatible(t,e)),this.makeSingleConnectorBackwardsCompatible=(o,e)=>o.source.source!=Ft.grafx?o:{id:o.id,name:o.name,iconUrl:o.iconUrl,source:this.makeConnectorSourceBackwardsCompatible(o.source,e)},this.makeConnectorSourceBackwardsCompatible=(o,e)=>{let t=e;for(;t!=null&&t.endsWith("/");)t=t.substring(0,t.length-1);return{url:`${t}/connectors/${o.id}`,source:Ft.grafx}},this.isSourceMigrated=o=>"id"in o}}let ds=(Gn=class{constructor(o,e){g(this,B);g(this,Nt);g(this,mt);this.getById=async t=>(await a(this,B)).getConnectorById(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData=a(this,mt).makeSingleConnectorBackwardsCompatible(r.parsedData,a(this,Nt).get(q.GraFxStudioEnvironmentApiUrl))),c}),this.getAllByType=async t=>(await a(this,B)).getConnectors(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData=a(this,mt).makeMultipleConnectorsBackwardsCompatible(r.parsedData,a(this,Nt).get(q.GraFxStudioEnvironmentApiUrl))),c}),this.register=async t=>{const n=await a(this,B),r=a(this,mt).makeConnectorSourceForwardsCompatible(t);return n.registerConnector(JSON.stringify(r)).then(c=>i(c))},this.unregister=async t=>(await a(this,B)).unregisterConnector(t).then(r=>i(r)),this.configure=async(t,n)=>{const r=await a(this,B);return await this.waitToBeReady(t),await n(new xr(t,r)),r.updateConnectorConfiguration(t).then(c=>i(c))},this.getState=async t=>(await a(this,B)).getConnectorState(t).then(r=>i(r)),this.getOptions=async t=>(await a(this,B)).getConnectorOptions(t).then(r=>i(r)),this.waitToBeReady=async(t,n=2e3)=>{let r=Math.max(n,500);r=Math.min(r,5e3);const c=100;let d=0;try{for(;d*c<r;){const u=await this.getState(t);if(u.success&&u.parsedData&&(u.parsedData.type===de.running||u.parsedData.type===de.ready))return i({data:null,success:!0,error:void 0,status:0,parsedData:void 0},!1);await new Promise(w=>setTimeout(w,c)),d++}}catch(u){return i({data:null,success:!1,error:`Error while getting connector state ${u}`,status:5e4,parsedData:void 0},!1)}return i({data:null,success:!1,error:"Timed out waiting for connector",status:5e4,parsedData:void 0},!1)},this.updateMappings=async(t,n)=>await this.configure(t,async r=>{const{parsedData:c}=await this.getMappings(t),d=(c==null?void 0:c.filter(p=>!n.some(v=>v.name===p.name&&v.direction===p.direction)))??[],u=n.filter(p=>p.name!==""&&p.value!==""),w=[...d,...u];await r.setMappings(w)}),this.applyMappings=async(t,n)=>await this.configure(t,async r=>{const c=n.filter(d=>d.name!==""&&d.value!=="");await r.setMappings(c)}),this.setHttpHeaders=async(t,n)=>(await a(this,B)).remoteConnectorAuthenticationSetHttpHeaders(t,JSON.stringify(n)).then(c=>i(c)),y(this,B,o),y(this,Nt,e),y(this,mt,new le)}async getMappings(o,e){return(await a(this,B)).getConnectorMappings(o).then(n=>i(n)).then(n=>{var r;return e?{...n,parsedData:(r=n.parsedData)==null?void 0:r.filter(c=>c.direction===e)}:n})}},B=new WeakMap,Nt=new WeakMap,mt=new WeakMap,Gn);class xr{constructor(o,e){g(this,ft);g(this,St);this.setOptions=async t=>a(this,St).setConnectorOptions(a(this,ft),JSON.stringify(t)).then(n=>i(n)),this.setMappings=async t=>{const n=await a(this,St).setConnectorMappings(a(this,ft),t.map(function(r){return JSON.stringify(r)}));return i(n)},this.setHttpHeader=async(t,n)=>a(this,St).connectorAuthenticationSetHttpHeader(a(this,ft),t,n).then(r=>i(r)),y(this,ft,o),y(this,St,e)}}ft=new WeakMap,St=new WeakMap;class ls{constructor(o,e){g(this,tt);g(this,Rt);this.getPageItemById=async(t,n,r,c={})=>{const u=await(await a(this,tt)).dataConnectorGetPageItemById(t,n,JSON.stringify(r),JSON.stringify(c)),w=i(u),p={...w,parsedData:null};return w.parsedData&&(p.parsedData={...w.parsedData,data:a(this,Rt).mapEngineToDataItem(w.parsedData.data)}),p},this.getConfigurationOptions=async t=>(await a(this,tt)).dataConnectorGetConfigurationOptions(t).then(r=>i(r)),this.getCapabilities=async t=>(await a(this,tt)).dataConnectorGetCapabilities(t).then(r=>i(r)),y(this,tt,o),y(this,Rt,e)}async getPage(o,e,t={}){const{previousPageToken:n,continuationToken:r}=e;if(n!=null&&r!=null)throw new Error('Invalid page config: "previousPageToken" and "continuationToken" are mutually exclusive. Provide only one to indicate navigation direction.');const d=await(await a(this,tt)).dataConnectorGetPage(o,JSON.stringify(e),JSON.stringify(t)),u=i(d),w={...u,parsedData:null};return u.parsedData&&(w.parsedData={...u.parsedData,data:u.parsedData.data.map(p=>a(this,Rt).mapEngineToDataItem(p))}),w}async getModel(o,e={}){return(await a(this,tt)).dataConnectorGetModel(o,JSON.stringify(e)).then(n=>i(n))}}tt=new WeakMap,Rt=new WeakMap;class us{constructor(o,e){g(this,ht);g(this,Yt);this.setDataSource=async t=>(await a(this,ht)).setDataSource(t).then(r=>i(r)),this.getDataSource=async()=>(await a(this,ht)).getDataSource().then(n=>i(n)),this.removeDataSource=async()=>(await a(this,ht)).removeDataSource().then(n=>i(n)),this.setDataRow=async t=>{const n=await a(this,ht),r=a(this,Yt).mapDataItemToEngine(t);return n.setDataRow(JSON.stringify(r)).then(c=>i(c))},y(this,ht,o),y(this,Yt,e)}}ht=new WeakMap,Yt=new WeakMap;class gs{constructor(o){g(this,dt);this.getAllLogs=async()=>(await a(this,dt)).getLogs().then(t=>i(t)),this.toggleDebugPanel=async()=>(await a(this,dt)).toggleDebugPanel().then(t=>i(t)),this.enableDebug=async()=>(await a(this,dt)).enableDebug().then(t=>i(t)),this.disableDebug=async()=>(await a(this,dt)).disableDebug().then(t=>i(t)),y(this,dt,o)}}dt=new WeakMap;class ys{constructor(o){g(this,bt);this.getCurrentState=async()=>(await a(this,bt)).getCurrentDocumentState().then(t=>i(t)),this.load=async(e,t={keepConnectors:!1})=>{const n=await a(this,bt),r=typeof e!="string"?JSON.stringify(e):e;return n.loadDocument(r,JSON.stringify(t)).then(c=>i(c))},this.createAndLoad=async e=>{const t=await a(this,bt),n=JSON.stringify(e);return t.createAndLoadDocument(n).then(r=>i(r))},y(this,bt,o)}}bt=new WeakMap;var ps=(s=>(s.resize="resize",s.scale="scale",s.scaleAndResize="scaleAndResize",s))(ps||{}),ws=(s=>(s.top="top",s.bottom="bottom",s.left="left",s.right="right",s))(ws||{}),zt=(s=>(s.url="url",s.variable="variable",s.connector="connector",s.brandKitMedia="brandKitMedia",s))(zt||{}),Cs=(s=>(s.connector="connector",s))(Cs||{}),ms=(s=>(s.text="text",s.image="image",s.shape="shape",s.barcode="barcode",s.component="component",s.componentGrid="componentGrid",s))(ms||{}),fs=(s=>(s.variable="variable",s.text="text",s))(fs||{}),Ss=(s=>(s.leftToRight="leftToRight",s.rightToLeft="rightToLeft",s.weak="weak",s))(Ss||{}),bs=(s=>(s.horizontal="horizontal",s.vertical="vertical",s.onPath="onPath",s))(bs||{}),vs=(s=>(s.top="top",s.bottom="bottom",s.middle="middle",s.justify="justify",s))(vs||{}),Is=(s=>(s.normal="normal",s.screen="screen",s.overlay="overlay",s.darken="darken",s.lighten="lighten",s.colorDodge="colorDodge",s.colorBurn="colorBurn",s.hardLight="hardLight",s.softLight="softLight",s.difference="difference",s.exclusion="exclusion",s.multiply="multiply",s.hue="hue",s.saturation="saturation",s.color="color",s.luminosity="luminosity",s))(Is||{}),As=(s=>(s.fill="fill",s.fit="fit",s.smartCrop="smartCrop",s.manualCrop="manualCrop",s))(As||{}),Ps=(s=>(s.topLeft="topLeft",s.topCenter="topCenter",s.topRight="topRight",s.centerLeft="centerLeft",s.center="center",s.centerRight="centerRight",s.bottomLeft="bottomLeft",s.bottomCenter="bottomCenter",s.bottomRight="bottomRight",s))(Ps||{}),Es=(s=>(s.bringToFront="bringToFront",s.sendToBack="sendToBack",s.bringForward="bringForward",s.sendBackward="sendBackward",s))(Es||{}),Ds=(s=>(s.relative="relative",s.start="start",s.end="end",s.startAndEnd="startAndEnd",s.center="center",s))(Ds||{}),Os=(s=>(s.page="page",s.frame="frame",s))(Os||{}),Fs=(s=>(s.start="start",s.end="end",s.center="center",s))(Fs||{});class $r{constructor(){this.type="page"}}class jr{constructor(o,e){this.type="frame",this.frameId=o,this.edge=e}}var Se=(s=>(s.frameCrop="frameCrop",s.assetCrop="assetCrop",s))(Se||{}),Ls=(s=>(s.v1="v1",s.v2="v2",s))(Ls||{});const zr="v2";var Ns=(s=>(s.start="start",s.center="center",s.end="end",s))(Ns||{});class Rs{constructor(o){g(this,G);this.insertImageVariableToFrame=async(e,t)=>{const n=await a(this,G),r={id:t,type:zt.variable};return n.setImageSource(e,JSON.stringify(r)).then(c=>i(c))},this.insertTextVariable=async e=>(await a(this,G)).insertTextVariable(e).then(n=>i(n)),this.enterTextEditMode=async e=>(await a(this,G)).enterTextEditMode(e).then(n=>i(n)),this.exitTextEditMode=async()=>(await a(this,G)).exitTextEditMode().then(t=>i(t)),this.getText=async(e,t)=>(await a(this,G)).getTextByFrameId(e,t).then(r=>i(r)),this.setText=async(e,t)=>(await a(this,G)).setTextByFrameId(e,t).then(r=>i(r)),this.selectText=async(e,t,n)=>(await a(this,G)).selectTextById(e,t,n).then(c=>i(c)),this.addCustomUndoData=async(e,t,n)=>(await a(this,G)).setCustomUndoData(e,t,n??!1).then(c=>i(c)),y(this,G,o)}}G=new WeakMap;class Ms{constructor(o){g(this,lt);g(this,Mt);this.query=async(e,t,n={})=>(await a(this,lt)).fontConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),this.detail=async(e,t,n={})=>(await a(this,lt)).fontConnectorDetail(e,t,JSON.stringify(n)).then(c=>i(c)),this.download=async(e,t,n={})=>(await a(this,Mt)).fontConnectorDownload(e,t,JSON.stringify(n)).then(c=>c??c),this.preview=async(e,t,n,r={})=>(await a(this,Mt)).fontConnectorPreview(e,t,n,JSON.stringify(r)).then(d=>d??d),this.getConfigurationOptions=async e=>(await a(this,lt)).fontConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,lt)).fontConnectorGetCapabilities(e).then(n=>i(n)),this.parseDeprecatedFontType=e=>{if(e===Dt.file)return Ot.file;if(e===Dt.collection)return Ot.collection},y(this,lt,o),y(this,Mt,o)}}lt=new WeakMap,Mt=new WeakMap;class Vs{constructor(o){g(this,E);this.addFontFamily=async(e,t)=>(await a(this,E)).addFontFamily(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontFamily=async e=>(await a(this,E)).removeFontFamily(e).then(n=>i(n)),this.addFontStyle=async(e,t)=>(await a(this,E)).addFontStyle(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontStyle=async e=>(await a(this,E)).removeFontStyle(e).then(n=>i(n)),this.getFontFamilies=async()=>(await a(this,E)).getFontFamilies().then(t=>i(t)),this.getFontStyles=async e=>(await a(this,E)).getFontStyles(e).then(n=>i(n)),this.getFontFamilyById=async e=>(await a(this,E)).getFontFamilyById(e).then(n=>i(n)),this.getFontStyleById=async e=>(await a(this,E)).getFontStyleById(e).then(n=>i(n)),this.getDefaultFontStyle=async()=>(await a(this,E)).getDefaultFontStyle().then(t=>i(t)),this.getDefaultFontFamily=async()=>(await a(this,E)).getDefaultFontFamily().then(t=>i(t)),this.isFontFamilyUsed=async e=>(await a(this,E)).isFontFamilyUsed(e).then(n=>i(n)),this.isFontStyleUsed=async e=>(await a(this,E)).isFontStyleUsed(e).then(n=>i(n)),this.moveFontFamilies=async(e,t)=>(await a(this,E)).moveFontFamilies(e,t).then(r=>i(r)),this.getPreviewsOfCharacterStrings=async(e,t)=>(await a(this,E)).getPreviewsOfCharacterStrings(e,JSON.stringify(t)).then(r=>i(r)),y(this,E,o)}}E=new WeakMap;class be{constructor(o){g(this,Vt);this.setShapeProperties=async(e,t)=>(await a(this,Vt)).setShapeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableFill=async(e,t)=>{const n={enableFill:t};return this.setShapeProperties(e,n)},this.setFillColor=async(e,t)=>{const n={fillColor:t};return this.setShapeProperties(e,n)},this.setEnableStroke=async(e,t)=>{const n={enableStroke:t};return this.setShapeProperties(e,n)},this.setStrokeColor=async(e,t)=>{const n={strokeColor:t};return this.setShapeProperties(e,n)},this.setStrokeWeight=async(e,t)=>{const n={strokeWeight:t};return this.setShapeProperties(e,n)},this.setFlagAllCornersSame=async(e,t)=>{const n={allCornersSame:t};return this.setShapeProperties(e,n)},this.setShapeCorners=async(e,t)=>(await a(this,Vt)).setShapeCorners(e,JSON.stringify(t)).then(r=>i(r)),this.setRadiusAll=async(e,t)=>{const n={radiusAll:t};return this.setShapeCorners(e,n)},this.setRadiusTopLeft=async(e,t)=>{const n={topLeft:t};return this.setShapeCorners(e,n)},this.setRadiusBottomLeft=async(e,t)=>{const n={bottomLeft:t};return this.setShapeCorners(e,n)},this.setRadiusTopRight=async(e,t)=>{const n={topRight:t};return this.setShapeCorners(e,n)},this.setRadiusBottomRight=async(e,t)=>{const n={bottomRight:t};return this.setShapeCorners(e,n)},y(this,Vt,o)}}Vt=new WeakMap;class Bs{constructor(o){g(this,l);this.getAll=async()=>(await a(this,l)).getFrames().then(t=>i(t)),this.getSelected=async()=>(await a(this,l)).getSelectedFrames().then(t=>i(t)),this.getAllByPageId=async e=>(await a(this,l)).getFramesByPageId(e).then(n=>i(n)),this.getByName=async e=>(await a(this,l)).getFrameByName(e).then(n=>i(n)),this.getById=async e=>(await a(this,l)).getFrameById(e).then(n=>i(n)),this.getPropertiesOnSelectedLayout=async()=>(await a(this,l)).getFramePropertiesOnSelectedLayout().then(t=>i(t)),this.getLayoutProperties=async(e,t)=>(await a(this,l)).getFramePropertiesByFrameId(e,t).then(r=>i(r)),this.getAllLayoutProperties=async e=>(await a(this,l)).getFramesProperties(e).then(n=>i(n)),this.resetTransformation=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetSize=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.select=async e=>(await a(this,l)).selectFrames([e]).then(n=>i(n)),this.selectMultiple=async e=>(await a(this,l)).selectFrames(e).then(n=>i(n)),this.deselectAll=async()=>(await a(this,l)).deselectFrames().then(t=>i(t)),this.reorderFrames=async(e,t)=>(await a(this,l)).reorderFrames(e,t).then(r=>i(r)),this.setZIndex=async(e,t)=>(await a(this,l)).setFrameZIndex(e,t).then(r=>i(r)),this.setHeight=async(e,t)=>(await a(this,l)).setFrameHeight(e,t).then(r=>i(r)),this.setRotation=async(e,t)=>(await a(this,l)).setFrameRotation(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,l)).setFrameWidth(e,t).then(r=>i(r)),this.setX=async(e,t)=>(await a(this,l)).setFrameX(e,t).then(r=>i(r)),this.setY=async(e,t)=>(await a(this,l)).setFrameY(e,t).then(r=>i(r)),this.setOpacity=async(e,t)=>(await a(this,l)).setFrameOpacity(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,l)).renameFrame(e,t).then(r=>i(r)),this.reset=async e=>(await a(this,l)).resetFrame(e).then(n=>i(n)),this.resetX=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetY=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetRotation=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetWidth=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetHeight=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetImageFrameFitMode=async e=>(await a(this,l)).resetImageFrameFitMode(e).then(n=>i(n)),this.setVisibility=async(e,t)=>(await a(this,l)).setFrameIsVisible(e,t).then(r=>i(r)),this.setIsVisible=async(e,t)=>(await a(this,l)).setFrameIsVisible(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,l)).removeFrames([e]).then(n=>i(n)),this.removeFrames=async e=>(await a(this,l)).removeFrames(e).then(n=>i(n)),this.create=async(e,t,n,r,c)=>(await a(this,l)).addFrame(e,t,n,r,c).then(u=>i(u)),this.createShapeFrame=async(e,t,n,r,c)=>(await a(this,l)).addFrame(e,t,n,r,c).then(u=>i(u)),this.createBarcodeFrame=async(e,t)=>(await a(this,l)).addBarcodeFrame(e,t==null?void 0:t.x,t==null?void 0:t.y).then(r=>i(r)),this.createComponentFrame=async(e,t,n,r,c)=>(await a(this,l)).addComponentFrame(t,n,r,c,JSON.stringify(e)).then(u=>i(u)),this.duplicateFrames=async e=>(await a(this,l)).duplicateFrames(e).then(n=>i(n)),this.updateImageSource=async(e,t)=>{const n=await a(this,l),r=t!==null?JSON.stringify(t):null;return n.setImageSource(e,r).then(c=>i(c))},this.removeImageSource=async e=>this.updateImageSource(e,null),this.setImageFromConnector=async(e,t,n)=>{const r={id:t,assetId:n,type:zt.connector};return this.updateImageSource(e,r)},this.setImageFromUrl=async(e,t)=>{const n={url:t,type:zt.url};return this.updateImageSource(e,n)},this.setImageFrameFitMode=async(e,t)=>(await a(this,l)).setImageFrameFitMode(e,t).then(r=>i(r)),this.setImageFrameFitModePosition=async(e,t)=>(await a(this,l)).setImageFrameFitModePosition(e,t).then(r=>i(r)),this.setImageFrameSmartCropSettings=async(e,t)=>(await a(this,l)).setImageFrameSmartCropSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setFrameConstrainProportions=async(e,t)=>(console.error("setFrameConstrainProportions is not supported anymore"),i({success:!1,status:0,error:"setFrameConstrainProportions is not supported anymore",parsedData:null})),this.setVerticalAlign=async(e,t)=>(await a(this,l)).setVerticalAlignment(e,t).then(r=>i(r)),this.setNumberOfColumns=async(e,t)=>(await a(this,l)).setNumberOfColumns(e,t).then(r=>i(r)),this.setColumnGap=async(e,t)=>(await a(this,l)).setColumnGap(e,t).then(r=>i(r)),this.setMinCopyfitting=async(e,t)=>(await a(this,l)).setMinCopyfitting(e,t).then(r=>i(r)),this.setMaxCopyfitting=async(e,t)=>(await a(this,l)).setMaxCopyfitting(e,t).then(r=>i(r)),this.setEnableCopyfitting=async(e,t)=>(await a(this,l)).setEnableCopyfitting(e,t).then(r=>i(r)),this.resetMinCopyfitting=async e=>(await a(this,l)).resetMinCopyfitting(e).then(n=>i(n)),this.resetMaxCopyfitting=async e=>(await a(this,l)).resetMaxCopyfitting(e).then(n=>i(n)),this.resetEnableCopyfitting=async e=>(await a(this,l)).resetEnableCopyfitting(e).then(n=>i(n)),this.setShapeFrameEnableFill=async(e,t)=>this.shapeController.setEnableFill(e,t),this.setShapeFrameFillColor=async(e,t)=>this.shapeController.setFillColor(e,t),this.setShapeFrameEnableStroke=async(e,t)=>this.shapeController.setEnableStroke(e,t),this.setShapeFrameStrokeColor=async(e,t)=>this.shapeController.setStrokeColor(e,t),this.setShapeFrameStrokeWeight=async(e,t)=>this.shapeController.setStrokeWeight(e,t),this.setBlendMode=async(e,t)=>(await a(this,l)).setFrameBlendMode(e,t).then(r=>i(r)),this.setFrameContainerShape=async(e,t)=>(await a(this,l)).setFrameContainerShape(e,JSON.stringify(t)).then(r=>i(r)),this.enterCropMode=async(e,t=Se.frameCrop)=>(await a(this,l)).enterCropMode(e,t).then(r=>i(r)),this.applyCropMode=async()=>(await a(this,l)).applyCropMode().then(t=>i(t)),this.exitCropMode=async()=>(await a(this,l)).cancelCropMode().then(t=>i(t)),this.enterSubjectMode=async e=>(await a(this,l)).enterSubjectMode(e).then(n=>i(n)),this.applySubjectMode=async()=>(await a(this,l)).applySubjectMode().then(t=>i(t)),this.exitSubjectMode=async()=>(await a(this,l)).cancelSubjectMode().then(t=>i(t)),this.enterGradientMode=async e=>(await a(this,l)).enterGradientMode(e).then(n=>i(n)),this.applyGradientMode=async()=>(await a(this,l)).applyGradientMode().then(t=>i(t)),this.cancelGradientMode=async()=>(await a(this,l)).cancelGradientMode().then(t=>i(t)),this.resetCropMode=async e=>(console.error("resetCropMode is not supported anymore"),i({success:!1,status:0,error:"resetCropMode is not supported anymore",parsedData:null})),this.setEnableAutoGrow=async(e,t)=>{const n={enabled:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMinWidth=async(e,t)=>{const n={minWidth:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMaxWidth=async(e,t)=>{const n={maxWidth:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMinHeight=async(e,t)=>{const n={minHeight:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMaxHeight=async(e,t)=>{const n={maxHeight:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowDirections=async(e,t)=>{const n={directions:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.resetAutoGrowSettingsEnabled=async e=>(console.error("resetAutoGrowSettingsEnabled is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowSettingsEnabled is not supported anymore",parsedData:null})),this.resetAutoGrowMinWidth=async e=>(console.error("resetAutoGrowMinWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMaxWidth=async e=>(console.error("resetAutoGrowMaxWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMinHeight=async e=>(console.error("resetAutoGrowMinHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinHeight is not supported anymore",parsedData:null})),this.resetAutoGrowMaxHeight=async e=>(console.error("resetAutoGrowMaxHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxHeight is not supported anymore",parsedData:null})),this.resetAutoGrowDirections=async e=>(console.error("resetAutoGrowDirections is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowDirections is not supported anymore",parsedData:null})),this.resetAutoGrow=async e=>(console.error("resetAutoGrow is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrow is not supported anymore",parsedData:null})),this.setShadowEnabled=async(e,t)=>{const n={enabled:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowDistance=async(e,t)=>{const n={distance:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowAngleDegrees=async(e,t)=>{const n={angleDegrees:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowBlurRadius=async(e,t)=>{const n={blurRadius:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowColor=async(e,t)=>{const n={color:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAnchor=async(e,t,n,r,c)=>{const d={horizontal:t,type:n,target:r,endTarget:c};return(await a(this,l)).setAnchorProperties(e,JSON.stringify(d)).then(w=>i(w))},this.setVerticalAnchor=async(e,t,n,r)=>this.setAnchor(e,!1,t,n,r),this.setHorizontalAnchor=async(e,t,n,r)=>this.setAnchor(e,!0,t,n,r),this.resetAnchoring=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetVisibility=async e=>(await a(this,l)).setFrameIsVisible(e,null).then(n=>i(n)),this.getConfiguration=async e=>(await a(this,l)).getFrameConfiguration(e).then(n=>i(n)),this.resetAssetCropOverride=async e=>(await a(this,l)).resetAssetCropOverride(e).then(n=>i(n)),this.resetAllAssetCropOverrides=async e=>(await a(this,l)).resetAllAssetCropOverrides(e).then(n=>i(n)),this.setGradientApplied=async(e,t)=>{const n={isApplied:t};return(await a(this,l)).updateFrameGradientSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setLocalGradient=async(e,t)=>{const n={gradient:t};return(await a(this,l)).updateFrameGradientSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setBrandKitGradient=async(e,t)=>{const n={id:t};return(await a(this,l)).updateFrameGradientSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setSmartCropSubjectId=async(e,t)=>(await a(this,l)).setSmartCropSubjectId(e,t).then(r=>i(r)),y(this,l,o),this.shapeController=new be(a(this,l)),this.constraints=new Kr(a(this,l))}}l=new WeakMap;class Kr{constructor(o){g(this,F);this.get=async e=>(await a(this,F)).getFrameConstraints(e).then(n=>i(n)),this.setSelectable=async(e,t)=>{const n={selectionAllowed:{value:t}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setHorizontalMovement=async(e,t)=>{const n={horizontalMovementAllowed:{value:t}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setVerticalMovement=async(e,t)=>{const n={verticalMovementAllowed:{value:t}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setRotation=async(e,t)=>{const n={rotationAllowed:{value:t}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setResize=async(e,t,n)=>{const r={resizeAllowed:{value:t},...n!==void 0&&{proportionLocked:{value:n}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(r)).then(d=>i(d))},this.setCrop=async(e,t)=>{const n={image:{cropAllowed:{value:t}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setTextEditingAllowed=async(e,t)=>{const n={text:{editingAllowed:{value:t}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedParagraphStyles=async(e,t)=>{const n={text:{paragraphStyles:{value:t}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedCharacterStyles=async(e,t)=>{const n={text:{characterStyles:{value:t}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedColors=async(e,t)=>{const n={text:{colors:{value:t}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedFontSizes=async(e,t)=>{const n={text:{fontSizes:{value:t}}};return(await a(this,F)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},y(this,F,o)}}F=new WeakMap;class Ts{constructor(){this.currentEngineVersion=V.current,this.currentSDKVersion=De.version}}class Js{constructor(o){g(this,f);g(this,Zt);this.getAll=async()=>(await a(this,f)).getLayouts().then(t=>i(t)),this.getById=async e=>(await a(this,f)).getLayoutById(e).then(n=>i(n)),this.getByName=async e=>(await a(this,f)).getLayoutByName(e).then(n=>i(n)),this.getSelected=async()=>(await a(this,f)).getSelectedLayout().then(t=>i(t)),this.remove=async e=>(await a(this,f)).removeLayout(e).then(n=>i(n)),this.create=async(e,t)=>{const n=await a(this,f);return t!=null&&t.length?n.addLayouts(e,JSON.stringify(t)).then(r=>i(r)):n.addLayout(e).then(r=>i(r))},this.rename=async(e,t)=>(await a(this,f)).renameLayout(e,t).then(r=>i(r)),this.select=async e=>(await a(this,f)).selectLayoutWithOptions(e,null).then(n=>i(n)),this.selectWithPageSize=async(e,t)=>{const n=await a(this,f),r={pageSize:t};return n.selectLayoutWithOptions(e,JSON.stringify(r)).then(c=>i(c))},this.duplicate=async e=>(await a(this,f)).duplicateLayout(e).then(n=>i(n)),this.reset=async e=>(await a(this,f)).resetLayout(e).then(n=>i(n)),this.setHeight=async(e,t)=>(await a(this,f)).setLayoutHeight(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,f)).setLayoutWidth(e,t).then(r=>i(r)),this.setUnit=async(e,t)=>(await a(this,f)).setLayoutUnit(e,t).then(r=>i(r)),this.resetHeight=async e=>(await a(this,f)).resetLayoutHeight(e).then(n=>i(n)),this.resetWidth=async e=>(await a(this,f)).resetLayoutWidth(e).then(n=>i(n)),this.resetUnit=async e=>(await a(this,f)).resetLayoutUnit(e).then(n=>i(n)),this.getSelectedSnapshot=async()=>(await a(this,Zt)).getPageSnapshot().then(t=>t??t),this.setIntent=async(e,t)=>(await a(this,f)).setLayoutIntent(e,t).then(r=>i(r)),this.resetIntent=async e=>(await a(this,f)).resetLayoutIntent(e).then(n=>i(n)),this.setFillColor=async(e,t)=>(await a(this,f)).setLayoutFillColor(e,JSON.stringify(t)).then(r=>i(r)),this.setFillColorEnabled=async(e,t)=>(await a(this,f)).setLayoutFillColorEnabled(e,t).then(r=>i(r)),this.resetFillColor=async e=>(await a(this,f)).resetLayoutFillColor(e).then(n=>i(n)),this.setBleedValue=async(e,t,n)=>{const r=n?{left:n===Y.left?t:void 0,top:n===Y.top?t:void 0,right:n===Y.right?t:void 0,bottom:n===Y.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,f)).updateLayoutBleed(e,JSON.stringify(r)).then(d=>i(d))},this.setAreBleedValuesCombined=async(e,t)=>{const n={areBleedValuesCombined:t};return(await a(this,f)).updateLayoutBleed(e,JSON.stringify(n)).then(c=>i(c))},this.resetBleedValues=async e=>(await a(this,f)).updateLayoutBleed(e,null).then(n=>i(n)),this.setPrivateData=async(e,t)=>(await a(this,f)).setLayoutPrivateData(e,JSON.stringify(t)).then(r=>i(r)),this.getPrivateData=async e=>(await a(this,f)).getLayoutPrivateData(e).then(n=>i(n)),this.setDisplayName=async(e,t)=>(await a(this,f)).setLayoutDisplayName(e,t).then(r=>i(r)),this.getDisplayName=async e=>(await a(this,f)).getLayoutDisplayName(e).then(n=>i(n)),this.resetDisplayName=async e=>(await a(this,f)).setLayoutDisplayName(e,null).then(n=>i(n)),this.setAvailableForUser=async(e,t)=>(await a(this,f)).setLayoutAvailableForUser(e,t).then(r=>i(r)),this.setSelectedByUser=async(e,t)=>(await a(this,f)).setLayoutSelectedByUser(e,t).then(r=>i(r)),this.setResizableByUser=async(e,t)=>(await a(this,f)).setLayoutResizableByUser(e,JSON.stringify(t)).then(r=>i(r)),y(this,f,o),y(this,Zt,o)}}f=new WeakMap,Zt=new WeakMap;var ue=(s=>(s.thumbnail="thumbnail",s.mediumres="mediumres",s.highres="highres",s.original="original",s))(ue||{}),ve=(s=>(s.web="web",s.print="print",s.animation="animation",s))(ve||{});class Us{constructor(o){g(this,et);g(this,Qt);this.query=async(e,t,n={})=>(await a(this,et)).mediaConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),this.detail=async(e,t,n={})=>(await a(this,et)).mediaConnectorDetail(e,t,JSON.stringify(n)).then(c=>i(c)),this.download=async(e,t,n,r={})=>{const c=this.parseDeprecatedMediaDownloadType(n);return(await a(this,Qt)).mediaConnectorDownload(e,t,c,ve.web,JSON.stringify(r)).then(u=>{if(u instanceof Uint8Array)return u;throw typeof u=="object"&&u!==null&&"success"in u&&!u.success&&wt(u),new Error(`Unexpected response type: ${typeof u}.`)})},this.getConfigurationOptions=async e=>(await a(this,et)).mediaConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,et)).mediaConnectorGetCapabilities(e).then(n=>i(n)),this.parseDeprecatedMediaType=e=>{if(e===Dt.file)return Ot.file;if(e===Dt.collection)return Ot.collection},this.upload=async(e,t,n={})=>(await a(this,et)).mediaConnectorUpload(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),y(this,et,o),y(this,Qt,o)}parseDeprecatedMediaDownloadType(o){switch(o){case he.HighResolutionWeb:return ue.highres;case he.LowResolutionWeb:return ue.thumbnail;default:return o}}}et=new WeakMap,Qt=new WeakMap;let ks=(_n=class{constructor(o){g(this,L);g(this,Xt);this.add=async()=>(await a(this,L)).addPage().then(t=>i(t)),this.remove=async e=>(await a(this,L)).removePage(e).then(n=>i(n)),this.select=async e=>(await a(this,L)).selectPage(e).then(n=>i(n)),this.setVisibility=async(e,t)=>(await a(this,L)).setPageIsVisible(e,t).then(r=>i(r)),this.duplicate=async e=>(await a(this,L)).duplicatePage(e).then(n=>i(n)),this.getAll=async()=>(await a(this,L)).getPages().then(t=>i(t)),this.getById=async e=>(await a(this,L)).getPageById(e).then(n=>i(n)),this.getSnapshot=async(e,t)=>(await a(this,Xt)).getPageSnapshotWithSettings(e,t==null?null:JSON.stringify(t)).then(r=>{if(r instanceof Uint8Array)return r;throw typeof r=="object"&&r!==null&&"success"in r&&!r.success&&wt(r),new Error(`Unexpected response type: ${typeof r}.`)}),this.setWidth=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,L)).setPageWidth(t).then(r=>i(r))),this.setHeight=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,L)).setPageHeight(t).then(r=>i(r))),this.setSize=async(e,t)=>(await a(this,L)).setPageSize(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,L)).reorderPages(e,t).then(r=>i(r)),y(this,L,o),y(this,Xt,o)}},L=new WeakMap,Xt=new WeakMap,_n);class Gs{constructor(o){g(this,_);this.getAll=async()=>(await a(this,_)).getParagraphStyles().then(t=>i(t)),this.getById=async e=>(await a(this,_)).getParagraphStyleById(e).then(n=>i(n)),this.create=async()=>(await a(this,_)).createParagraphStyle().then(t=>i(t)),this.duplicate=async e=>(await a(this,_)).duplicateParagraphStyle(e).then(n=>i(n)),this.update=async(e,t)=>(await a(this,_)).updateParagraphStyle(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,_)).renameParagraphStyle(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,_)).removeParagraphStyle(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,_)).moveParagraphStyles(e,t).then(r=>i(r)),y(this,_,o)}}_=new WeakMap;var Kt=(s=>(s.shortText="shortText",s.longText="longText",s.richText="richText",s.image="image",s.list="list",s.boolean="boolean",s.group="group",s.number="number",s.date="date",s.dataSource="dataSource",s))(Kt||{}),_s=(s=>(s.Monday="monday",s.Tuesday="tuesday",s.Wednesday="wednesday",s.Thursday="thursday",s.Friday="friday",s.Saturday="saturday",s.Sunday="sunday",s))(_s||{}),Hs=(s=>(s.en_US="en_US",s.cs="cs",s.da="da",s.nl="nl",s.fi="fi",s.fr="fr",s.de="de",s.it="it",s.no="no",s.pl="pl",s.pt_PT="pt_PT",s.es_ES="es_ES",s.sv="sv",s))(Hs||{}),Lt=(s=>(s.visible="visible",s.invisible="invisible",s.conditional="conditional",s))(Lt||{}),xs=(s=>(s.boolean="boolean",s.text="text",s.number="number",s))(xs||{}),$s=(s=>(s.equals="=",s.notEquals="!=",s.greaterThan=">",s.greaterThanOrEquals=">=",s.lessThan="<",s.lessThanOrEquals="<=",s))($s||{}),Ie=(s=>(s.injected="injected",s.connector="connector",s))(Ie||{}),js=(s=>(s.table="table",s.list="list",s))(js||{});let Wr=class{constructor(o,e){this.onActionsChanged=t=>{this.config.events.onActionsChanged.trigger(JSON.parse(t))},this.onAnimationChanged=t=>{this.config.events.onFrameAnimationsChanged.trigger(JSON.parse(t))},this.onAnimationPlaybackChanged=t=>{this.config.events.onScrubberPositionChanged.trigger(JSON.parse(t))},this.onSelectedLayoutPropertiesChanged=t=>{this.config.events.onSelectedLayoutPropertiesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutUnitChanged=t=>{this.config.events.onSelectedLayoutUnitChanged.trigger(t)},this.onFramesLayoutChanged=t=>{const n=JSON.parse(t);this.config.events.onFramesLayoutChanged.trigger(n)},this.onSelectedFramesLayoutChanged=t=>{const n=JSON.parse(t);this.config.events.onSelectedFramesLayoutChanged.trigger(n);const r=this.config.onSelectedFrameLayoutChanged;r&&r(n.length>1?void 0:n[0])},this.onSelectedFramesContentChanged=t=>{const n=JSON.parse(t);this.config.events.onSelectedFramesContentChanged.trigger(n);const r=this.config.onSelectedFrameContentChanged;r&&r(n.length>1?null:n[0])},this.onStateChanged=()=>{this.config.events.onStateChanged.trigger()},this.onAuthExpired=async t=>{const n=await this.config.handlers.onAuthExpired.trigger(JSON.parse(t));return n!=null?JSON.stringify(n):null},this.onViewportRequested=()=>{const t=this.config.handlers.onViewportRequested.trigger();return t!=null?JSON.stringify(t):null},this.onDocumentLoaded=()=>{this.config.events.onDocumentLoaded.trigger()},this.onPageSelectionChanged=t=>{this.config.events.onPageSelectionChanged.trigger(t)},this.onVariableListChanged=t=>{const r=JSON.parse(t).map(c=>{var d;return c.type===Kt.list?{...c,items:c.items.map(u=>u.value),selected:(d=c.selected)==null?void 0:d.value}:c});this.config.events.onVariableListChanged.trigger(r)},this.onSelectedToolChanged=t=>{this.config.events.onSelectedToolChanged.trigger(t)},this.onUndoStateChanged=t=>{this.config.events.onUndoStackStateChanged.trigger(JSON.parse(t))},this.onCustomUndoDataChanged=t=>{this.config.events.onCustomUndoDataChanged.trigger(JSON.parse(t))},this.onSelectedLayoutFramesChanged=t=>{this.config.events.onSelectedLayoutFramesChanged.trigger(JSON.parse(t))},this.onSelectedTextStyleChanged=t=>{this.config.events.onSelectedTextStyleChanged.trigger(JSON.parse(t))},this.onColorsChanged=t=>{this.config.events.onColorsChanged.trigger(JSON.parse(t))},this.onParagraphStylesChanged=t=>{this.config.events.onParagraphStylesChanged.trigger(JSON.parse(t))},this.onCharacterStylesChanged=t=>{this.config.events.onCharacterStylesChanged.trigger(JSON.parse(t))},this.onFontFamiliesChanged=t=>{this.config.events.onFontFamiliesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutIdChanged=t=>{this.config.events.onSelectedLayoutIdChanged.trigger(t)},this.onLayoutsChanged=t=>{this.config.events.onLayoutsChanged.trigger(JSON.parse(t))},this.onZoomChanged=t=>{this.config.events.onZoomChanged.trigger(JSON.parse(t))},this.onConnectorEvent=t=>{this.config.events.onConnectorEvent.trigger(JSON.parse(t))},this.onConnectorsChanged=t=>{const r=new le().makeMultipleConnectorsBackwardsCompatible(JSON.parse(t),this.localConfig.get(q.GraFxStudioEnvironmentApiUrl));this.config.events.onConnectorsChanged.trigger(r)},this.onSelectedPageIdChanged=t=>{this.config.events.onSelectedPageIdChanged.trigger(t)},this.onPagesChanged=t=>{this.config.events.onPagesChanged.trigger(JSON.parse(t))},this.onPageSnapshotInvalidated=t=>{this.config.events.onPageSnapshotInvalidated.trigger(t)},this.onPageSizeChanged=t=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(t))},this.onShapeCornerRadiusChanged=t=>{this.config.events.onShapeCornerRadiusChanged.trigger(JSON.parse(t))},this.onCropActiveFrameIdChanged=t=>{this.config.events.onCropActiveFrameIdChanged.trigger(t)},this.onAsyncError=t=>{const n=JSON.parse(t);if((n==null?void 0:n.type)==="dataRow"){const r=new Be(n.count,n.message,n.exceptions);this.config.events.onAsyncError.trigger(r)}else if((n==null?void 0:n.type)==="action"){const r=new Ve(n.message,n.id,n.event,n.eventChain);this.config.events.onAsyncError.trigger(r)}else this.config.events.onAsyncError.trigger(n)},this.onViewModeChanged=t=>{this.config.events.onViewModeChanged.trigger(t)},this.onBarcodeValidationChanged=t=>{this.config.events.onBarcodeValidationChanged.trigger(JSON.parse(t))},this.onDataSourceIdChanged=t=>{this.config.events.onDataSourceIdChanged.trigger(t)},this.onInjectedDataChanged=t=>{this.config.events.onInjectedDataChanged.trigger(t)},this.onDocumentIssueListChanged=t=>{this.config.events.onDocumentIssueListChanged.trigger(JSON.parse(t))},this.onEngineEditModeChanged=t=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(t))},this.onBrandKitMediaChanged=t=>{this.config.events.onBrandKitMediaChanged.trigger(JSON.parse(t))},this.config=o,this.localConfig=e}};class zs{constructor(o){g(this,vt);this.set=async e=>(await a(this,vt)).selectedTextStyleDeltaUpdate(JSON.stringify(e)).then(n=>i(n)),this.removeSelected=async()=>(await a(this,vt)).selectedTextStyleClean().then(t=>i(t)),this.getSelected=async()=>(await a(this,vt)).getSelectedTextStyle().then(t=>i(t)),y(this,vt,o)}}vt=new WeakMap;var Ks=(s=>(s.FRAME_X="frameX",s.FRAME_Y="frameY",s.WIDTH="width",s.HEIGHT="height",s.FRAME_ROTATION="frameRotation",s))(Ks||{}),Ws=(s=>(s.LAYOUT_HEIGHT="layoutHeight",s.LAYOUT_WIDTH="layoutWidth",s.BLEED_TOP="bleedTop",s.BLEED_BOTTOM="bleedBottom",s.BLEED_LEFT="bleedLeft",s.BLEED_RIGHT="bleedRight",s.BLEED_VALUES_COMBINED="areBleedValuesCombined",s))(Ws||{}),T=(s=>(s.SELECT="select",s.ZOOM="zoom",s.HAND="hand",s.IMAGE_FRAME="imageFrame",s.TEXT_FRAME="textFrame",s.SHAPE_RECT="rect",s.SHAPE_ELLIPSE="ellipse",s.SHAPE_POLYGON="polygon",s.COMPONENT_GRID_FRAME="componentGridFrame",s))(T||{}),qs=(s=>(s.MP4="mp4",s.GIF="gif",s.PNG="png",s.JPG="jpg",s.PDF="pdf",s.HTML="html",s))(qs||{}),ge=(s=>(s.SANDBOX="sandbox",s.PRODUCTION="online",s))(ge||{});class Ys{constructor(o){g(this,Bt);this.setTool=async e=>(await a(this,Bt)).setTool(e).then(n=>i(n)),this.getSelected=async()=>(await a(this,Bt)).getSelectedTool().then(t=>i(t)),this.setPointer=async()=>this.setTool(T.SELECT),this.setSelect=async()=>this.setTool(T.SELECT),this.setHand=async()=>this.setTool(T.HAND),this.setZoom=async()=>this.setTool(T.ZOOM),this.setTextFrame=async()=>this.setTool(T.TEXT_FRAME),this.setImageFrame=async()=>this.setTool(T.IMAGE_FRAME),this.setShapeRect=async()=>this.setTool(T.SHAPE_RECT),this.setShapeEllipse=async()=>this.setTool(T.SHAPE_ELLIPSE),this.setShapePolygon=async()=>this.setTool(T.SHAPE_POLYGON),this.setComponentGrid=async()=>this.setTool(T.COMPONENT_GRID_FRAME),y(this,Bt,o)}}Bt=new WeakMap;class Zs{constructor(o,e){g(this,Z);g(this,K);g(this,te);this.undo=async()=>(await a(this,Z)).undo().then(n=>i(n)),this.redo=async()=>(await a(this,Z)).redo().then(n=>i(n)),this.addCustomData=async(t,n)=>(await a(this,Z)).setCustomUndoData(t,n,!1).then(c=>i(c)),this.record=async(t,n)=>{try{await a(this,K).beginIfNoneActive(t),await n(a(this,te)),await a(this,K).end()}catch(r){throw await a(this,K).abort(),r}},this.pause=async()=>(await a(this,Z)).pause().then(n=>i(n)),this.resume=async()=>(await a(this,Z)).resume().then(n=>i(n)),this.clear=async()=>(await a(this,Z)).clear().then(n=>i(n)),this.advanced={begin:async t=>a(this,K).begin(t),beginIfNoneActive:async t=>a(this,K).beginIfNoneActive(t),end:async()=>a(this,K).end(),abort:async()=>a(this,K).abort()},y(this,Z,o),y(this,te,e),y(this,K,new qr(o))}}Z=new WeakMap,K=new WeakMap,te=new WeakMap;class qr{constructor(o){g(this,ut);this.begin=async e=>(await a(this,ut)).begin(e).then(n=>i(n)),this.beginIfNoneActive=async e=>(await a(this,ut)).beginIfNoneActive(e).then(n=>i(n)),this.end=async()=>(await a(this,ut)).end().then(t=>i(t)),this.abort=async()=>(await a(this,ut)).abort().then(t=>i(t)),y(this,ut,o)}}ut=new WeakMap;var J=(s=>(s.info="info",s.warn="warn",s.error="error",s))(J||{}),Qs=(s=>(s.general="general",s.connector="connector",s.event="event",s.engine="engine",s))(Qs||{}),Wt=(s=>(s.throw="throw",s.log="log",s))(Wt||{});class Xs extends Error{constructor(o){super(o)}}const Yr=(s,o=2)=>{const e=Math.pow(10,o);return Math.round(s*e)/e};class tn{constructor(o,e){g(this,ee);g(this,Tt);this.round=(t,n)=>i({data:String(Yr(t,n)),success:!0,status:200,parsedData:null}),this.createEnvironmentBaseURL=t=>{const{type:n=ge.SANDBOX,environment:r="ft-nostress",version:c="1"}=t,d=n==ge.SANDBOX?"chili-publish-sandbox":"chili-publish";return`https://${r}.${d}.online/grafx/api/v${c}/environment/${r}`},this.stageFiles=async(t,n,r)=>{const c=a(this,Tt).get(q.GraFxStudioEnvironmentApiUrl);if(!c)throw new Error("GraFx Studio Environment API URL is not set");const d=`${c}connectors/${n}/stage`,u=a(this,Tt).get(q.GraFxStudioAuthToken);if(!u)throw new Error("GraFx Studio Auth Token is not set");const w=new FormData;t.forEach((S,I)=>{const N=S instanceof File?S.name:`blob-${I}`;w.append("files",S,N)}),r&&w.append("validationJson",JSON.stringify({allowedMimeTypes:r.mimeTypes,minDimensions:{width:r.minWidthPixels,height:r.minHeightPixels}}));const p=await fetch(d,{method:"POST",body:w,headers:{Authorization:`Bearer ${u}`}});if(p.status===422){const S=await p.json();throw new cs(S.message,fe.minDimension)}if(p.status===401){const S=await p.json();throw new Xs(S.message)}if(!p.ok)throw new Error("Failed to stage files");return await p.json()},this.unitEvaluate=async(t,n)=>(await a(this,ee)).unitEvaluate(t,n).then(c=>i(c)),y(this,ee,o),y(this,Tt,e)}}ee=new WeakMap,Tt=new WeakMap;const Zr=s=>s.type===Kt.dataSource,Qr=s=>{var o;return s?Zr(s)&&((o=s==null?void 0:s.value)==null?void 0:o.type)===Ie.injected:!1};class Xr{constructor(o){g(this,se);this.setMinimum=async(e,t)=>{const n={minValue:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setMaximum=async(e,t)=>{const n={maxValue:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setShowStepper=async(e,t)=>{const n={showStepper:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setStepSize=async(e,t)=>{const n={stepSize:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setThousandsSeparator=async(e,t)=>{const n={thousandsSeparator:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setDecimalSeparator=async(e,t)=>{const n={decimalSeparator:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setDecimalCharacterStyle=async(e,t)=>{const n={decimalCharacterStyleId:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setNumberOfDecimals=async(e,t)=>{const n={numberOfDecimals:{value:t}};return this.applyPropertiesUpdate(e,n)},y(this,se,o)}async applyPropertiesUpdate(o,e){const n=await(await a(this,se)).updateNumberVariableProperties(o,JSON.stringify(e));return i(n)}}se=new WeakMap;class ta{constructor(o){g(this,ne);this.setDisplayFormat=async(e,t)=>{const n={displayFormat:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setLocale=async(e,t)=>{const n={locale:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setStartDate=async(e,t)=>{const n={startDate:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setEndDate=async(e,t)=>{const n={endDate:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setExcludedDays=async(e,t)=>{const n={excludedDays:{value:t}};return this.applyPropertiesUpdate(e,n)},y(this,ne,o)}async applyPropertiesUpdate(o,e){const n=await(await a(this,ne)).updateDateVariableProperties(o,JSON.stringify(e));return i(n)}}ne=new WeakMap;class ea{constructor(o,e){g(this,H);g(this,Jt);this.setValue=async(t,n)=>{const r=await a(this,H);let c;return Array.isArray(n)?c=n.map(d=>a(this,Jt).mapDataItemToEngine(d)):c=n,r.setVariableValue(t,c).then(d=>i(d))},this.getInjectedData=async t=>(await a(this,H)).getInjectedDataSourceVariableData(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData={...r.parsedData,data:r.parsedData.data.map(d=>a(this,Jt).mapEngineToDataItem(d))}),c}),this.getInjectedItemById=async(t,n)=>{var p;const c=await(await a(this,H)).getVariableById(t).then(v=>i(v));Qr(c.parsedData)||wt({status:400,error:"Variable is not an injected data source variable"});const d=c.parsedData.value.itemIdPropertyName,w=(p=(await this.getInjectedData(t)).parsedData)==null?void 0:p.data.find(v=>{var S;return((S=v[d])==null?void 0:S.toString())===n.toString()});return w||wt({status:404,error:`Item not found in injected data for variable ${t}`}),{success:!0,status:200,parsedData:{data:w,continuationToken:null,previousPageToken:null}}},this.setInjectedModel=async(t,n)=>{const r=n.properties,c=n.itemIdPropertyName;return(await a(this,H)).setInjectedDataSourceVariableModel(t,JSON.stringify(r),c).then(u=>i(u))},this.setSourceType=async(t,n)=>(await a(this,H)).setDataSourceVariableSourceType(t,n).then(c=>i(c)),this.setConnector=async(t,n)=>{const r=await a(this,H),d=new le().makeConnectorSourceForwardsCompatible(n);return r.setDataSourceVariableConnector(t,JSON.stringify(d)).then(u=>i(u))},this.removeConnector=async t=>(await a(this,H)).setDataSourceVariableConnector(t,null).then(r=>i(r)),y(this,H,o),y(this,Jt,e)}async setDisplayOptions(o,e,t){return(await a(this,H)).setDataSourceVariableDisplayOptions(o,e,t??void 0).then(r=>i(r))}}H=new WeakMap,Jt=new WeakMap;let en=(Hn=class{constructor(o,e){g(this,C);g(this,Ut);g(this,kt);this.getAll=async()=>(await a(this,C)).getVariables().then(n=>i(n)).then(n=>{const r=n;return r.parsedData&&(r.parsedData=this.makeVariablesBackwardsCompatible(r.parsedData)),r}),this.getById=async t=>(await a(this,C)).getVariableById(t).then(r=>i(r)).then(r=>{const c=r;return c.parsedData&&(c.parsedData=this.makeVariableBackwardsCompatible(c.parsedData)),c}),this.getByName=async t=>(await a(this,C)).getVariableByName(t).then(r=>i(r)).then(r=>{const c=r;return c.parsedData&&(c.parsedData=this.makeVariableBackwardsCompatible(c.parsedData)),c}),this.create=async(t,n)=>(await a(this,C)).addVariable(t,n).then(c=>i(c)),this.remove=async t=>(await a(this,C)).removeVariables(t).then(r=>i(r)),this.rename=async(t,n)=>(await a(this,C)).setVariableName(t,n).then(c=>i(c)),this.setLabel=async(t,n)=>(await a(this,C)).setVariableLabel(t,n).then(c=>i(c)),y(this,Ut,async(t,n)=>(await a(this,C)).setVariablePlaceholder(t,n).then(c=>i(c))),this.setPlaceholder=async(t,n)=>a(this,Ut).call(this,t,n),this.resetPlaceholder=async t=>a(this,Ut).call(this,t,null),y(this,kt,async(t,n)=>(await a(this,C)).setVariableHelpText(t,n).then(c=>i(c))),this.setHelpText=async(t,n)=>a(this,kt).call(this,t,n),this.resetHelpText=async t=>a(this,kt).call(this,t,null),this.setType=async(t,n)=>(await a(this,C)).setVariableType(t,n).then(c=>i(c)),this.setRuleSetId=async(t,n)=>(await a(this,C)).setVariableRuleSetId(t,n).then(c=>i(c)),this.setListVariable=async(t,n)=>(await a(this,C)).setListVariableItems(t,n.map(c=>JSON.stringify({value:c}))).then(c=>i(c)),this.setValue=async(t,n)=>(await a(this,C)).setVariableValue(t,n).then(c=>i(c,d=>Br(d,{id:t}))),this.duplicate=async t=>(await a(this,C)).duplicateVariable(t).then(r=>i(r)),this.groupVariables=async(t,n)=>(await a(this,C)).groupVariables(t,n).then(c=>i(c)),this.ungroupVariables=async t=>(await a(this,C)).ungroupVariable(t).then(r=>i(r)),this.move=async(t,n,r)=>(await a(this,C)).moveVariable(n,r,t).then(d=>i(d)),this.moveVariables=async(t,n,r)=>(await a(this,C)).moveVariables(n,r,t).then(d=>i(d)),this.setIsVisible=async(t,n)=>{const r=n?{type:Lt.visible}:{type:Lt.invisible};return this.setVariableVisibility(t,r)},this.setIsHidden=async(t,n)=>{const r=n?{type:Lt.invisible}:{type:Lt.visible};return this.setVariableVisibility(t,r)},this.setVariableVisibility=async(t,n)=>(await a(this,C)).setVariableVisibility(t,JSON.stringify(n)).then(c=>i(c)),this.setLayoutsForVariableVisibility=async t=>(await a(this,C)).setLayoutsForVariableVisibility(t?JSON.stringify(t):null).then(r=>i(r)),this.setIsRequired=async(t,n)=>(await a(this,C)).setVariableIsRequired(t,n).then(c=>i(c)),this.setRemoveParagraphIfEmpty=async(t,n)=>(await a(this,C)).setVariableRemoveParagraphIfEmpty(t,n).then(c=>i(c)),this.setVariableCharacterLimit=async(t,n)=>(await a(this,C)).setVariableCharacterLimit(t,n).then(c=>i(c)),this.setIsReadonly=async(t,n)=>(await a(this,C)).setVariableIsReadonly(t,n).then(c=>i(c)),this.getImageVariableConnectorId=async t=>(await a(this,C)).getImageVariableConnectorId(t).then(r=>i(r)),this.setImageVariableConnector=async(t,n)=>{const r=await a(this,C),d=new le().makeConnectorSourceForwardsCompatible(n);return r.setImageVariableConnector(t,JSON.stringify(d)).then(u=>i(u))},this.setImageVariableValueWithContext=async(t,n,r)=>(await a(this,C)).setImageVariableValueWithContext(t,n,JSON.stringify(r)).then(d=>i(d)),this.removeSource=async t=>this.setValue(t,null),this.setPrefix=async(t,n)=>{const r={prefix:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffix=async(t,n)=>{const r={suffix:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrefixCharacterStyle=async(t,n)=>{const r={prefixCharacterStyleId:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffixCharacterStyle=async(t,n)=>{const r={suffixCharacterStyleId:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrivateData=async(t,n)=>(await a(this,C)).setVariablePrivateData(t,JSON.stringify(n)).then(c=>i(c)),this.getPrivateData=async t=>(await a(this,C)).getVariablePrivateData(t).then(r=>i(r)),this.setAllowImageQuery=async(t,n)=>(await a(this,C)).setImageVariableAllowQuery(t,n).then(c=>i(c)),this.setAllowImageUpload=async(t,n)=>(await a(this,C)).setImageVariableAllowUpload(t,n).then(c=>i(c)),this.setMinImageUploadSize=async(t,n,r)=>(await a(this,C)).setImageVariableUploadMinSize(t,n,r).then(d=>i(d)),this.setIsDontBreak=async(t,n)=>(await a(this,C)).setVariableIsDontBreak(t,n).then(c=>i(c)),this.highlightUsages=async t=>(await a(this,C)).highlightVariableUsages(t).then(r=>i(r)),this.setRichTextRules=async t=>(await a(this,C)).setRichTextRulesets(JSON.stringify(t)).then(r=>i(r)),y(this,C,o),this.number=new Xr(a(this,C)),this.date=new ta(a(this,C)),this.dataSource=new ea(a(this,C),e)}makeVariablesBackwardsCompatible(o){return o.map(e=>this.makeVariableBackwardsCompatible(e))}makeVariableBackwardsCompatible(o){return o.type!==Kt.list?o:this.makeListVariableBackwardsCompatible(o)}makeListVariableBackwardsCompatible(o){const e=o,t=o.items,n=o.selected,r=t.map(c=>c.value);return e.items=r,e.selected=n==null?void 0:n.value,e}async applyPrefixSuffixDeltaUpdate(o,e){const n=await(await a(this,C)).updateVariablePrefixSuffixProperties(o,JSON.stringify(e));return i(n)}},C=new WeakMap,Ut=new WeakMap,kt=new WeakMap,Hn);class sa{constructor(o){g(this,Gt);this.get=async()=>(await a(this,Gt)).getBrandKit().then(t=>i(t)),this.set=async e=>(await a(this,Gt)).setBrandKit(JSON.stringify(e)).then(n=>i(n)),y(this,Gt,o)}}Gt=new WeakMap;class na{constructor(o){this.onVariableListChanged=e=>{this.config.events.onVariableListChanged.trigger(JSON.parse(e))},this.onConnectorsChanged=e=>{this.config.events.onConnectorsChanged.trigger(JSON.parse(e))},this.onPageSizeChanged=e=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(e))},this.onEngineEditModeChanged=e=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(e))},this.config=o}}class ra{constructor(o){g(this,gt);this.getAll=async()=>(await a(this,gt)).getVariables().then(t=>i(t)),this.getById=async e=>(await a(this,gt)).getVariableById(e).then(n=>i(n)),this.getByName=async e=>(await a(this,gt)).getVariableByName(e).then(n=>i(n)),this.setListVariable=async(e,t)=>(await a(this,gt)).setListVariableItems(e,t.map(r=>JSON.stringify(r))).then(r=>i(r)),y(this,gt,o),this.image=new aa(o),this.dataSource=new ia(o)}}gt=new WeakMap;class aa{constructor(o){g(this,st);this.setAllowQuery=async(e,t)=>(await a(this,st)).setImageVariableAllowQuery(e,t).then(r=>i(r)),this.setAllowUpload=async(e,t)=>(await a(this,st)).setImageVariableAllowUpload(e,t).then(r=>i(r)),this.setMinUploadSize=async(e,t,n)=>(await a(this,st)).setImageVariableUploadMinSize(e,t,n).then(c=>i(c)),this.setConnector=async(e,t)=>(await a(this,st)).setImageVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),this.setConnectorContext=async(e,t)=>(await a(this,st)).setImageVariableConnectorContext(e,JSON.stringify(t)).then(r=>i(r)),y(this,st,o)}}st=new WeakMap;class ia{constructor(o){g(this,re);this.setConnector=async(e,t)=>(await a(this,re)).setDataSourceVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),y(this,re,o)}}re=new WeakMap;class oa{constructor(o){g(this,It);this.register=async e=>(await a(this,It)).registerConnector(JSON.stringify(e)).then(n=>i(n)),this.getById=async e=>(await a(this,It)).getConnectorById(e).then(n=>i(n)),this.getAllByType=async e=>(await a(this,It)).getConnectors(e).then(n=>i(n)),y(this,It,o)}}It=new WeakMap;class ca{constructor(o){g(this,_t);g(this,ye);this.setWidth=async e=>(await a(this,_t)).setPageWidth(e).then(n=>i(n)),this.setHeight=async e=>(await a(this,_t)).setPageHeight(e).then(n=>i(n)),y(this,_t,o),y(this,ye,o)}}_t=new WeakMap,ye=new WeakMap;class sn{constructor(o,e,t){this.config=o,this.connection=e,this.editorAPI=t,this.subscriber=new na(o),this.variable=new ra(this.editorAPI),this.connector=new oa(this.editorAPI),this.page=new ca(this.editorAPI),this.canvas=new me(this.editorAPI),this.brandKit=new sa(this.editorAPI)}}class nn{constructor(o){this.logger=o}createEventHandlerFn(o,e){return(...n)=>{try{const r=o(...n);return r instanceof Promise?r.catch(c=>this.handleError(c,e,o.name)):r}catch(r){this.handleError(r,e,o.name)}}}handleError(o,e,t){var n;if(e===Wt.log)(n=this.logger)==null||n.call(this,J.error,Qs.event,`Error in callback ${t}: ${o}`);else throw o}}class rn extends nn{constructor(o,e){super(e),this.handler=o}trigger(...o){const e=this.handler();if(e)return this.createEventHandlerFn(e,Wt.throw)(...o)}}class m extends nn{constructor(o,e){super(e),this.legacyHandler=o,this.subscriptions=new Set}trigger(...o){const e=this.legacyHandler();e&&this.createEventHandlerFn(e,Wt.log)(...o);for(const t of this.subscriptions)t(...o)}registerCallback(o,e=Wt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class Ae{static createRuntimeConfig(o){var t,n,r,c,d,u,w,p,v,S,I,N,O,b,X,$,A,nt,rt,xt,$t,xn,$n,jn,zn,Kn,Wn,qn,Yn,Zn,Qn,Xn,tr,er,sr;const e={...o};return e.logging={logLevel:((t=o.logging)==null?void 0:t.logLevel)||J.error,logger:((n=o.logging)==null?void 0:n.logger)||((ie,Pe,Ee)=>{var nr;if(Ae.isLoggingEnabled(ie,((nr=e.logging)==null?void 0:nr.logLevel)??J.error))switch(ie){case J.error:console.error(`[${Pe}] [${ie}] ${Ee}`);break;case J.warn:console.warn(`[${Pe}] [${ie}] ${Ee}`);break;default:console.log(`[${Pe}] [${ie}] ${Ee}`)}})},e.handlers={onAuthExpired:new rn(()=>e.onAuthExpired,(r=e.logging)==null?void 0:r.logger),onViewportRequested:new rn(()=>e.onViewportRequested,(c=e.logging)==null?void 0:c.logger)},e.events={onActionsChanged:new m(()=>e.onActionsChanged,(d=e.logging)==null?void 0:d.logger),onStateChanged:new m(()=>e.onStateChanged,(u=e.logging)==null?void 0:u.logger),onDocumentLoaded:new m(()=>e.onDocumentLoaded,(w=e.logging)==null?void 0:w.logger),onSelectedFramesLayoutChanged:new m(()=>e.onSelectedFramesLayoutChanged,(p=e.logging)==null?void 0:p.logger),onFramesLayoutChanged:new m(()=>e.onFramesLayoutChanged,(v=e.logging)==null?void 0:v.logger),onSelectedFramesContentChanged:new m(()=>e.onSelectedFramesContentChanged,(S=e.logging)==null?void 0:S.logger),onPageSelectionChanged:new m(()=>e.onPageSelectionChanged,(I=e.logging)==null?void 0:I.logger),onSelectedLayoutPropertiesChanged:new m(()=>e.onSelectedLayoutPropertiesChanged,(N=e.logging)==null?void 0:N.logger),onSelectedLayoutUnitChanged:new m(()=>e.onSelectedLayoutUnitChanged,(O=e.logging)==null?void 0:O.logger),onScrubberPositionChanged:new m(()=>e.onScrubberPositionChanged,(b=e.logging)==null?void 0:b.logger),onFrameAnimationsChanged:new m(()=>e.onFrameAnimationsChanged,(X=e.logging)==null?void 0:X.logger),onVariableListChanged:new m(()=>e.onVariableListChanged,($=e.logging)==null?void 0:$.logger),onSelectedToolChanged:new m(()=>e.onSelectedToolChanged,(A=e.logging)==null?void 0:A.logger),onUndoStackStateChanged:new m(()=>e.onUndoStackStateChanged,(nt=e.logging)==null?void 0:nt.logger),onSelectedLayoutFramesChanged:new m(()=>e.onSelectedLayoutFramesChanged,(rt=e.logging)==null?void 0:rt.logger),onSelectedTextStyleChanged:new m(()=>e.onSelectedTextStyleChanged,(xt=e.logging)==null?void 0:xt.logger),onColorsChanged:new m(()=>e.onColorsChanged,($t=e.logging)==null?void 0:$t.logger),onParagraphStylesChanged:new m(()=>e.onParagraphStylesChanged,(xn=e.logging)==null?void 0:xn.logger),onCharacterStylesChanged:new m(()=>e.onCharacterStylesChanged,($n=e.logging)==null?void 0:$n.logger),onFontFamiliesChanged:new m(()=>e.onFontFamiliesChanged,(jn=e.logging)==null?void 0:jn.logger),onSelectedLayoutIdChanged:new m(()=>e.onSelectedLayoutIdChanged,(zn=e.logging)==null?void 0:zn.logger),onLayoutsChanged:new m(()=>e.onLayoutsChanged,(Kn=e.logging)==null?void 0:Kn.logger),onConnectorEvent:new m(()=>e.onConnectorEvent,(Wn=e.logging)==null?void 0:Wn.logger),onConnectorsChanged:new m(()=>e.onConnectorsChanged,(qn=e.logging)==null?void 0:qn.logger),onZoomChanged:new m(()=>e.onZoomChanged,(Yn=e.logging)==null?void 0:Yn.logger),onSelectedPageIdChanged:new m(()=>e.onSelectedPageIdChanged,e.logging.logger),onPagesChanged:new m(()=>e.onPagesChanged,e.logging.logger),onPageSnapshotInvalidated:new m(()=>e.onPageSnapshotInvalidated,e.logging.logger),onPageSizeChanged:new m(()=>e.onPageSizeChanged,(Zn=e.logging)==null?void 0:Zn.logger),onShapeCornerRadiusChanged:new m(()=>e.onShapeCornerRadiusChanged,(Qn=e.logging)==null?void 0:Qn.logger),onCropActiveFrameIdChanged:new m(()=>e.onCropActiveFrameIdChanged,(Xn=e.logging)==null?void 0:Xn.logger),onAsyncError:new m(()=>e.onAsyncError,(tr=e.logging)==null?void 0:tr.logger),onViewModeChanged:new m(()=>e.onViewModeChanged,(er=e.logging)==null?void 0:er.logger),onBarcodeValidationChanged:new m(()=>e.onBarcodeValidationChanged,(sr=e.logging)==null?void 0:sr.logger),onDataSourceIdChanged:new m(()=>e.onDataSourceIdChanged,e.logging.logger),onInjectedDataChanged:new m(()=>e.onInjectedDataChanged,e.logging.logger),onDocumentIssueListChanged:new m(()=>e.onDocumentIssueListChanged,e.logging.logger),onCustomUndoDataChanged:new m(()=>e.onCustomUndoDataChanged,e.logging.logger),onEngineEditModeChanged:new m(()=>e.onEngineEditModeChanged,e.logging.logger),onBrandKitMediaChanged:new m(()=>e.onBrandKitMediaChanged,e.logging.logger)},e}static isLoggingEnabled(o,e){return e==J.info||e==J.warn&&(o==J.warn||o==J.error)?!0:e==J.error&&o==J.error}}class ha{isDatePropertyWrapper(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&"type"in o&&o.type==="date"&&"chiliReservedTag"in o&&o.chiliReservedTag==="date"}isDateObject(o){return o instanceof Date}mapEngineToDataItem(o){const e={};return Object.entries(o).forEach(([t,n])=>{e[t]=this.isDatePropertyWrapper(n)?new Date(n.value):n}),e}mapDataItemToEngine(o){const e={};return Object.entries(o).forEach(([t,n])=>{e[t]=this.isDateObject(n)?{value:n.getTime(),type:"date",chiliReservedTag:"date"}:n}),e}}class da{constructor(o){g(this,yt);y(this,yt,o)}async getValue(o){return(await a(this,yt)).getConfigValue(o).then(t=>i(t))}async setValue(o,e){return(await a(this,yt)).setConfigValue(o,e).then(n=>i(n))}async updateStudioOptions(o){return(await a(this,yt)).updateStudioOptions(JSON.stringify(o)).then(t=>i(t))}async getEngineSessionId(){return(await a(this,yt)).getEngineSessionId().then(e=>i(e))}getLatestSmartCropVersion(){return zr}}yt=new WeakMap;class an extends da{constructor(e,t){super(e);g(this,Ht);y(this,Ht,t)}async getValue(e){const t=a(this,Ht).get(e);return t!=null?i({status:200,success:!0,parsedData:t,data:t},!1):super.getValue(e)}async setValue(e,t){const n=super.setValue(e,t);return a(this,Ht).set(e,t),n}}Ht=new WeakMap;class on{constructor(o){g(this,x);this.getAll=async()=>(await a(this,x)).getGradients().then(t=>i(t)),this.getById=async e=>(await a(this,x)).getGradientById(e).then(n=>i(n)),this.create=async()=>(await a(this,x)).createGradient().then(t=>i(t)),this.duplicate=async e=>(await a(this,x)).duplicateGradient(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,x)).moveGradients(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,x)).renameGradient(e,t).then(r=>i(r)),this.update=async(e,t)=>{const n=await a(this,x),r=t;return n.updateGradient(e,JSON.stringify(r)).then(c=>i(c))},this.remove=async e=>(await a(this,x)).removeGradient(e).then(n=>i(n)),y(this,x,o)}}x=new WeakMap;class cn{constructor(o){g(this,At);g(this,ae);this.query=async(e,t,n={})=>(await a(this,At)).componentConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),this.preview=async(e,t,n,r={})=>(await a(this,ae)).componentConnectorPreview(e,t,n,JSON.stringify(r)).then(d=>{if(d instanceof Uint8Array)return d;throw typeof d=="object"&&d!==null&&"success"in d&&!d.success&&wt(d),new Error(`Unexpected response type: ${typeof d}.`)}),this.getConfigurationOptions=async e=>(await a(this,At)).componentConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,At)).componentConnectorGetCapabilities(e).then(n=>i(n)),y(this,At,o),y(this,ae,o)}}At=new WeakMap,ae=new WeakMap;class hn{constructor(o){g(this,Pt);this.linkVariable=async(e,t,n,r)=>(await a(this,Pt)).linkComponentVariable(e,t,n,r??null).then(d=>i(d)),this.getComponentVariables=async e=>(await a(this,Pt)).getComponentVariables(e).then(n=>i(n)),this.setFitMode=async(e,t)=>(await a(this,Pt)).setComponentLayoutFit(e,t).then(r=>i(r)),y(this,Pt,o)}}Pt=new WeakMap;class dn{constructor(o){g(this,Q);this.updateSettings=async(e,t)=>(await a(this,Q)).updateComponentGridSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setMapping=async(e,t,n,r,c)=>(await a(this,Q)).setComponentGridMapping(e,t,n,r,c).then(u=>i(u)),this.resetSettings=async e=>(await a(this,Q)).resetComponentGridSettings(e).then(n=>i(n)),this.setComponentSource=async(e,t)=>(await a(this,Q)).setComponentGridComponentSource(e,t?JSON.stringify(t):null).then(r=>i(r)),this.setDataSourceVariable=async(e,t)=>(await a(this,Q)).setComponentGridDataSourceVariable(e,t).then(r=>i(r)),this.setResizeMode=async(e,t)=>(await a(this,Q)).setComponentGridResizeMode(e,t).then(r=>i(r)),y(this,Q,o)}}Q=new WeakMap;const la=`https://studio-cdn.chiligrafx.com/editor/${V.current}/web`;let it;class ua{constructor(o){this.localConfig=new Map,this.dataItemMappingTools=new ha,this.loadEditor=()=>{var e;Lr(this.config.editorLink||la,{onActionsChanged:this.subscriber.onActionsChanged,onStateChanged:this.subscriber.onStateChanged,onAuthExpired:this.subscriber.onAuthExpired,onViewportRequested:this.subscriber.onViewportRequested,onDocumentLoaded:this.subscriber.onDocumentLoaded,onSelectedFramesContentChanged:this.subscriber.onSelectedFramesContentChanged,onSelectedFramesLayoutChanged:this.subscriber.onSelectedFramesLayoutChanged,onFramesLayoutChanged:this.subscriber.onFramesLayoutChanged,onSelectedLayoutPropertiesChanged:this.subscriber.onSelectedLayoutPropertiesChanged,onSelectedLayoutUnitChanged:this.subscriber.onSelectedLayoutUnitChanged,onPageSelectionChanged:this.subscriber.onPageSelectionChanged,onScrubberPositionChanged:this.subscriber.onAnimationPlaybackChanged,onFrameAnimationsChanged:this.subscriber.onAnimationChanged,onVariableListChanged:t=>{var n;(n=this.enabledNextSubscribers)!=null&&n.onVariableListChanged?this.next.subscriber.onVariableListChanged(t):this.subscriber.onVariableListChanged(t)},onSelectedToolChanged:this.subscriber.onSelectedToolChanged,onUndoStateChanged:this.subscriber.onUndoStateChanged,onSelectedLayoutFramesChanged:this.subscriber.onSelectedLayoutFramesChanged,onSelectedTextStyleChanged:this.subscriber.onSelectedTextStyleChanged,onColorsChanged:this.subscriber.onColorsChanged,onParagraphStylesChanged:this.subscriber.onParagraphStylesChanged,onCharacterStylesChanged:this.subscriber.onCharacterStylesChanged,onFontFamiliesChanged:this.subscriber.onFontFamiliesChanged,onSelectedLayoutIdChanged:this.subscriber.onSelectedLayoutIdChanged,onLayoutsChanged:this.subscriber.onLayoutsChanged,onConnectorEvent:this.subscriber.onConnectorEvent,onConnectorsChanged:t=>{var n;(n=this.enabledNextSubscribers)!=null&&n.onConnectorsChanged?this.next.subscriber.onConnectorsChanged(t):this.subscriber.onConnectorsChanged(t)},onZoomChanged:this.subscriber.onZoomChanged,onSelectedPageIdChanged:this.subscriber.onSelectedPageIdChanged,onPagesChanged:this.subscriber.onPagesChanged,onPageSnapshotInvalidated:this.subscriber.onPageSnapshotInvalidated,onPageSizeChanged:t=>{var n;(n=this.enabledNextSubscribers)!=null&&n.onPageSizeChanged?this.next.subscriber.onPageSizeChanged(t):this.subscriber.onPageSizeChanged(t)},onShapeCornerRadiusChanged:this.subscriber.onShapeCornerRadiusChanged,onCropActiveFrameIdChanged:this.subscriber.onCropActiveFrameIdChanged,onAsyncError:this.subscriber.onAsyncError,onViewModeChanged:this.subscriber.onViewModeChanged,onBarcodeValidationChanged:this.subscriber.onBarcodeValidationChanged,onDataSourceIdChanged:this.subscriber.onDataSourceIdChanged,onInjectedDataChanged:this.subscriber.onInjectedDataChanged,onDocumentIssueListChanged:this.subscriber.onDocumentIssueListChanged,onCustomUndoDataChanged:this.subscriber.onCustomUndoDataChanged,onEngineEditModeChanged:this.subscriber.onEngineEditModeChanged,onBrandKitMediaChanged:this.subscriber.onBrandKitMediaChanged},this.setConnection,this.config.editorId,this.config.studioStyling,t=>{var n,r;(r=(n=this.config).onConnectionError)==null||r.call(n,t)}),this.editorAPI=it==null?void 0:it.promise.then(t=>t),this.action=new Ue(this.editorAPI),this.layout=new Js(this.editorAPI),this.frame=new Bs(this.editorAPI),this.barcode=new je(this.editorAPI),this.component=new hn(this.editorAPI),this.animation=new ke(this.editorAPI),this.document=new ys(this.editorAPI),this.configuration=new an(this.editorAPI,this.localConfig),this.utils=new tn(this.editorAPI,this.localConfig),this.tool=new Ys(this.editorAPI),this.page=new ks(this.editorAPI),this.debug=new gs(this.editorAPI),this.undoManager=new Zs(this.editorAPI,this),this.textSelection=new zs(this.editorAPI),this.colorStyle=new Ze(this.editorAPI),this.gradientStyle=new on(this.editorAPI),this.paragraphStyle=new Gs(this.editorAPI),this.characterStyle=new Ke(this.editorAPI),this.mediaConnector=new Us(this.editorAPI),this.fontConnector=new Ms(this.editorAPI),this.componentConnector=new cn(this.editorAPI),this.dataConnector=new ls(this.editorAPI,this.dataItemMappingTools),this.dataSource=new us(this.editorAPI,this.dataItemMappingTools),this.connector=new ds(this.editorAPI,this.localConfig),this.variable=new en(this.editorAPI,this.dataItemMappingTools),this.font=new Vs(this.editorAPI),this.experiment=new Rs(this.editorAPI),this.canvas=new me(this.editorAPI),this.shape=new be(this.editorAPI),this.colorConversion=new qe(this.editorAPI),this.info=new Ts,this.clipboard=new We(this.editorAPI),this.brandKit=new ze(this.editorAPI,this),this.componentGrid=new dn(this.editorAPI),this.next=new sn(this.config,this.connection,this.editorAPI),this.configuration.setValue(q.GraFxStudioSdkVersion,De.version),this.configuration.setValue(q.GraFxStudioDocumentType,this.config.documentType||Ce.template),this.configuration.updateStudioOptions(this.config.studioOptions||Nr),this.configuration.setValue(q.QueryCallCacheEnabled,((e=this.config.enableQueryCallCache)==null?void 0:e.toString())||"false")},this.setConnection=e=>{it=e},this.config=Ae.createRuntimeConfig(o),this.connection=it,this.editorAPI=it==null?void 0:it.promise.then(e=>e),this.action=new Ue(this.editorAPI),this.layout=new Js(this.editorAPI),this.frame=new Bs(this.editorAPI),this.shape=new be(this.editorAPI),this.barcode=new je(this.editorAPI),this.component=new hn(this.editorAPI),this.undoManager=new Zs(this.editorAPI,this),this.connector=new ds(this.editorAPI,this.localConfig),this.mediaConnector=new Us(this.editorAPI),this.fontConnector=new Ms(this.editorAPI),this.componentConnector=new cn(this.editorAPI),this.dataConnector=new ls(this.editorAPI,this.dataItemMappingTools),this.dataSource=new us(this.editorAPI,this.dataItemMappingTools),this.animation=new ke(this.editorAPI),this.document=new ys(this.editorAPI),this.configuration=new an(this.editorAPI,this.localConfig),this.variable=new en(this.editorAPI,this.dataItemMappingTools),this.utils=new tn(this.editorAPI,this.localConfig),this.subscriber=new Wr(this.config,this.localConfig),this.tool=new Ys(this.editorAPI),this.page=new ks(this.editorAPI),this.debug=new gs(this.editorAPI),this.textSelection=new zs(this.editorAPI),this.colorStyle=new Ze(this.editorAPI),this.gradientStyle=new on(this.editorAPI),this.paragraphStyle=new Gs(this.editorAPI),this.characterStyle=new Ke(this.editorAPI),this.font=new Vs(this.editorAPI),this.experiment=new Rs(this.editorAPI),this.canvas=new me(this.editorAPI),this.colorConversion=new qe(this.editorAPI),this.info=new Ts,this.clipboard=new We(this.editorAPI),this.next=new sn(this.config,this.connection,this.editorAPI),this.enabledNextSubscribers=this.config.enableNextSubscribers,this.brandKit=new ze(this.editorAPI,this),this.componentGrid=new dn(this.editorAPI)}}var ln=(s=>(s.top="top",s.left="left",s.right="right",s.bottom="bottom",s.topLeft="topLeft",s.topRight="topRight",s.bottomLeft="bottomLeft",s.bottomRight="bottomRight",s))(ln||{}),un=(s=>(s.horizontal="horizontal",s.vertical="vertical",s))(un||{}),gn=(s=>(s.easeIn="easeIn",s.easeOut="easeOut",s.easeInOut="easeInOut",s))(gn||{}),yn=(s=>(s.quadratic="Quadratic",s.cubic="Cubic",s.quartic="Quartic",s.quintic="Quintic",s.sine="Sine",s.exponential="Exponential",s.circular="Circular",s.elastic="Elastic",s.bounce="Bounce",s.back="Back",s))(yn||{}),pn=(s=>(s.bounce="bounce",s.flash="flash",s.headshake="headShake",s.heartbeat="heartbeat",s.pulse="pulse",s.rubberBand="rubberBand",s.vertical="vertical",s.horizontal="horizontal",s.swing="swing",s.tada="tada",s))(pn||{}),wn=(s=>(s.preview="preview",s.normal="normal",s))(wn||{}),Cn=(s=>(s.linear="linear",s))(Cn||{}),mn=(s=>(s.local="linearLocal",s.linearBrandKit="linearBrandKit",s))(mn||{}),fn=(s=>(s.Square="square",s.Line="line",s))(fn||{}),Sn=(s=>(s.thumbnail="thumbnail",s.highest="highest",s.medium="medium",s))(Sn||{}),bn=(s=>(s.BOLD="Bold",s.ITALIC="Italic",s.REGULAR="Regular",s))(bn||{}),vn=(s=>(s.LEFT="left",s.CENTER="center",s.RIGHT="right",s.JUSTIFY="justify",s))(vn||{}),In=(s=>(s.TOP="top",s.CENTER="center",s.BOTTOM="bottom",s))(In||{}),An=(s=>(s.TO_LOWER_CASE="lowercase",s.TO_UPPER_CASE="uppercase",s.NORMAL="normal",s))(An||{}),Pn=(s=>(s.SUPERSCRIPT="superscript",s.SUBSCRIPT="subscript",s.NORMAL="normal",s))(Pn||{}),En=(s=>(s.none="none",s.bullet="bullet",s.number="number",s))(En||{}),Dn=(s=>(s.STYLE="textStyle",s.PROPERTIES="textProperties",s.APPEARANCE="appearance",s))(Dn||{}),On=(s=>(s.PARAGRAPH="paragraphStyleId",s.CHARACTER="characterStyleId",s.FONT_FAMILY="fontKey",s.FONT_STYLE="fontStyle",s.FONT_SIZE="fontSize",s.LETTER_SPACING="letterSpacing",s.LINE_HEIGHT="lineHeight",s.TEXT_ALIGN="textAlign",s.VERTICAL_ALIGN="verticalAlign",s.TYPOGRAPHIC_CASE="typographicCase",s.SUB_SUPER_SCRIPT="subSuperScript",s.UNDERLINE="underline",s.LINE_THROUGH="lineThrough",s.FILL_COLOR="fillColor",s.COLOR="color",s.FILL_COLOR_APPLIED="fillColorApplied",s.STROKE_COLOR="strokeColor",s.STROKE_COLOR_APPLIED="strokeColorApplied",s.BACKGROUND_COLOR="backgroundColor",s.BACKGROUND_COLOR_APPLIED="backgroundColorApplied",s.DROP_SHADOW_COLOR="dropShadowColor",s.BLEND_MODE="blendMode",s.OPACITY="opacity",s.TRACKING_RIGHT="trackingRight",s.BASELINE_SHIFT="baselineShiftValue",s.STROKE_WIDTH="strokeWidth",s.MARKED_LIST_TYPE="markedListType",s.MARKED_LIST_GROUP="markedListGroup",s.MARKED_LIST_LEVEL="markedListLevel",s))(On||{}),Fn=(s=>(s.arabic="arabic",s.romanUpperCase="romanUpperCase",s.romanLowerCase="romanLowerCase",s.latinUpperCase="latinUpperCase",s.latinLowerCase="latinLowerCase",s))(Fn||{}),Ln=(s=>(s.none="none",s.dash="dash",s.dot="dot",s.colon="colon",s.roundBracket="roundBracket",s))(Ln||{}),Nn=(s=>(s.fixed="fixed",s))(Nn||{}),Rn=(s=>(s.selectedLayoutChanged="selectedLayoutChanged",s.frameMoved="frameMoved",s.pageSizeChanged="pageSizeChanged",s.documentLoaded="documentLoaded",s.variableValueChanged="variableValueChanged",s))(Rn||{}),Mn=(s=>(s.ellipse="ellipse",s.rectangle="rectangle",s.polygon="polygon",s))(Mn||{}),Vn=(s=>(s.all="all",s.only="only",s.none="none",s))(Vn||{}),Bn=(s=>(s.paragraph="paragraph",s.character="character",s.lineBreak="lineBreak",s.inlineStyle="inlineStyle",s))(Bn||{}),Tn=(s=>(s.exists="exists",s.missing="missing",s.equals="equals",s.notEquals="notEquals",s.contains="contains",s.startsWith="startsWith",s.endsWith="endsWith",s))(Tn||{}),Jn=(s=>(s.normal="normal",s.textEdit="textEdit",s.customCrop="customCrop",s.frameSubjectArea="frameSubjectArea",s.perAssetCrop="perAssetCrop",s.gradient="gradient",s))(Jn||{}),Un=(s=>(s.url="url",s.grafx="grafx",s.local="local",s))(Un||{});const ga=Object.freeze(Object.defineProperty({__proto__:null,ConnectorRegistrationSource:Un},Symbol.toStringTag,{value:"Module"}));h.ActionAsyncError=Ve,h.ActionEditorEvent=Rn,h.Alignment=vn,h.AnchorTargetEdgeType=Fs,h.AnchorTargetType=Os,h.AuthCredentialsTypeEnum=is,h.AuthRefreshTypeEnum=os,h.AutoGrowDirection=ws,h.BarcodeCharacterSet=Ct,h.BarcodeErrorCorrectionLevel=Et,h.BarcodeSourceTypeEnum=fs,h.BarcodeType=j,h.BarcodeValidationResult=Ge,h.BasicAnimationsEmphasisStyles=pn,h.BlendMode=Is,h.Case=An,h.ColorType=ce,h.ColorUsageType=Ye,h.ComponentFitEnum=ps,h.ComponentGridLayoutAlgorithm=Nn,h.ComponentPreviewType=Sn,h.ComponentSourceTypeEnum=Cs,h.ConnectorConfigContextType=ss,h.ConnectorConfigValueType=es,h.ConnectorEventType=as,h.ConnectorHttpError=Te,h.ConnectorMapping=kr,h.ConnectorMappingDirection=rs,h.ConnectorMappingSource=ns,h.ConnectorRegistrationSource=Ft,h.ConnectorStateType=de,h.ConnectorSupportedAuth=hs,h.ConnectorType=Qe,h.ConstraintMode=$e,h.CornerRadiusType=Vn,h.CropType=Se,h.DataRowAsyncError=Be,h.DataSourceVariableDisplayOptionsType=js,h.DataSourceVariableSourceType=Ie,h.Day=_s,h.DeprecatedMediaConnectorDownloadType=he,h.DeprecatedMediaType=Dt,h.DocumentIssueTypeEnum=Me,h.DocumentType=Ce,h.DownloadFormats=qs,h.EaseTypes=gn,h.EngineEditModeType=Jn,h.EnvironmentType=ge,h.FitMode=As,h.FitModePosition=Ps,h.FlowDirection=bs,h.FontPreviewFormat=fn,h.FontWeights=bn,h.FrameAnchorTarget=jr,h.FrameAnchorType=Ds,h.FrameEditingMode=Re,h.FramePropertyNames=Ks,h.FrameTypeEnum=ms,h.GradientType=Cn,h.GradientUsageType=mn,h.GrafxTokenAuthCredentials=_r,h.ImageSourceTypeEnum=zt,h.LayoutIntent=xe,h.LayoutPropertyNames=Ws,h.LayoutType=He,h.Locale=Hs,h.MarkedListType=En,h.MeasurementUnit=_e,h.MediaDownloadIntent=ve,h.MediaDownloadType=ue,h.MediaType=Ot,h.Next=ga,h.NumberListFormat=Fn,h.NumberListSeparatorSymbol=Ln,h.PageAnchorTarget=$r,h.PositionEnum=Y,h.RefreshedAuthCredendentials=Hr,h.SDKUnauthorizedError=Xs,h.Scripting=Pn,h.SelectedTextStyleSections=Dn,h.SelectedTextStyles=On,h.ShakeDirections=un,h.ShapeType=Mn,h.SlideDirections=ln,h.SmartCropAxisBias=Ns,h.SmartCropVersion=Ls,h.SortBy=Xe,h.SortOrder=ts,h.StructuredTextAttributeMatchOperator=Tn,h.StructuredTextStyleKind=Bn,h.TextDirection=Ss,h.TextPosition=In,h.ToolType=T,h.TweenTypes=yn,h.UpdateZIndexMethod=Es,h.UploadAssetValidationError=cs,h.UploadAssetValidationErrorType=fe,h.VariableType=Kt,h.VariableValueConstrainsViolationError=Je,h.VariableVisibilityOperator=$s,h.VariableVisibilityTargetType=xs,h.VariableVisibilityType=Lt,h.VerticalAlign=vs,h.ViewMode=wn,h.WellKnownConfigurationKeys=q,h.default=ua,h.grafxMediaConnectorRegistration=Gr,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
68
+ </html>`;s.srcdoc=r};let oe=null;const Vr=(s,o,e,t="chili-editor",n,r)=>{oe&&window.removeEventListener("message",oe);const h=`#${t}`,d=document.createElement("iframe");d.setAttribute("srcdoc"," "),d.setAttribute("title","Chili-Editor"),d.setAttribute("style","width: 100%; height: 100%;"),d.setAttribute("frameBorder","0"),d.setAttribute("referrerpolicy","origin");const u=()=>{const m=document.querySelector(h);if(m){m==null||m.appendChild(d),d.addEventListener("error",()=>{const p=new Error("Failed to setup frame: iframe failed to load");r==null||r(p)},{capture:!0,once:!0});try{Rr(d,s,n)}catch(p){p instanceof Error?r==null||r(p):r==null||r(new Error(`Failed to setup frame: ${p}`))}}};document.readyState==="complete"||document.readyState==="interactive"?u():document.addEventListener("DOMContentLoaded",()=>{u()}),oe=m=>{var p;if(m.source===d.contentWindow&&((p=m.data)==null?void 0:p.type)==="iframe-error"){const S=m.data.error,b=new Error(S.message||"Failed to setup frame: error in iframe");r==null||r(b)}},window.addEventListener("message",oe),e(Nr({iframe:d,methods:{actionsChanged:o.onActionsChanged,stateChanged:o.onStateChanged,documentLoaded:o.onDocumentLoaded,authExpired:o.onAuthExpired,viewportRequested:o.onViewportRequested,selectedFramesContent:o.onSelectedFramesContentChanged,selectedFramesLayout:o.onSelectedFramesLayoutChanged,allFramesLayout:o.onFramesLayoutChanged,selectedLayoutProperties:o.onSelectedLayoutPropertiesChanged,openLayoutPropertiesPanel:o.onPageSelectionChanged,selectedLayoutUnit:o.onSelectedLayoutUnitChanged,scrubberPositionChanged:o.onScrubberPositionChanged,frameAnimationsChanged:o.onFrameAnimationsChanged,selectedToolChanged:o.onSelectedToolChanged,variableListChanged:o.onVariableListChanged,undoStackStateChanged:o.onUndoStateChanged,selectedLayoutFramesChanged:o.onSelectedLayoutFramesChanged,selectedTextStyleChanged:o.onSelectedTextStyleChanged,colorsChanged:o.onColorsChanged,paragraphStylesChanged:o.onParagraphStylesChanged,characterStylesChanged:o.onCharacterStylesChanged,fontFamiliesChanged:o.onFontFamiliesChanged,selectedLayoutId:o.onSelectedLayoutIdChanged,layoutListChanged:o.onLayoutsChanged,connectorEvent:o.onConnectorEvent,connectorsChanged:o.onConnectorsChanged,zoomChanged:o.onZoomChanged,pageSnapshotInvalidated:o.onPageSnapshotInvalidated,pagesChanged:o.onPagesChanged,pageSizeChanged:o.onPageSizeChanged,shapeCornerRadiusChanged:o.onShapeCornerRadiusChanged,cropActiveFrameIdChanged:o.onCropActiveFrameIdChanged,asyncError:o.onAsyncError,viewModeChanged:o.onViewModeChanged,barcodeValidationChanged:o.onBarcodeValidationChanged,selectedPageIdChanged:o.onSelectedPageIdChanged,dataSourceIdChanged:o.onDataSourceIdChanged,injectedDataChanged:o.onInjectedDataChanged,documentIssueListChanged:o.onDocumentIssueListChanged,customUndoDataChanged:o.onCustomUndoDataChanged,engineEditingModeChanged:o.onEngineEditModeChanged,brandKitMediaChanged:o.onBrandKitMediaChanged}}))};var Z=(s=>(s.GraFxStudioEnvironmentApiUrl="ENVIRONMENT_API",s.GraFxStudioSdkVersion="SDK_VERSION",s.GraFxStudioDocumentType="DOCUMENT_TYPE",s.GraFxStudioTemplateId="TEMPLATE_ID",s.GraFxStudioAuthToken="GRAFX_AUTH_TOKEN",s.QueryCallCacheEnabled="ENABLE_QUERY_CALL_CACHE",s))(Z||{}),Ve=(s=>(s.full="full",s.followConstraints="followConstraints",s))(Ve||{});const Tr={shortcutOptions:{debugPanel:{enabled:!1},ellipse:{enabled:!1},hand:{enabled:!1},temporaryHand:{enabled:!1},image:{enabled:!1},polygon:{enabled:!1},rectangle:{enabled:!1},select:{enabled:!1},text:{enabled:!1},zoom:{enabled:!1},copyPaste:{enabled:!1},viewMode:{enabled:!1},componentGrid:{enabled:!1}},frameEditingMode:"full"};var Te=(s=>(s.overflow="overflow",s.fontLoading="fontLoading",s.actionRegister="actionRegister",s.actionExecution="actionExecution",s.actionCircular="actionCircular",s))(Te||{}),Ce=(s=>(s.project="project",s.template="template",s.component="component",s))(Ce||{});class ke{constructor(o,e,t,n){this.type="action",this.message=o,this.id=e,this.event=t,this.eventChain=n}}class Be{constructor(o,e,t){this.type="dataRow",this.count=o,this.message=e,this.exceptions=t}}class Je extends Error{constructor(o,e,t){super(e,t),this.statusCode=o}}class Ue extends Error{constructor(o,e,t){super(e,t),this.context=o}}const kr=404075,Br=403032;function mt(s){const o=s.error??"Yikes, something went wrong",e={cause:{name:String(s.status),message:s.error??"Yikes, something went wrong"}};if(s.status===kr){const n=JSON.parse(s.data).statusCode;throw new Je(n,o,e)}else throw new Error(o,e)}function Jr(s){const o=[/DateVariable '([^']+)' should not be part of excludedDays, ".*" was given/,/DateVariable '([^']+)' expects \$date to be > startDate:.*$/,/DateVariable '([^']+)' expects \$date to be < endDate:.*$/,/NumberVariable '([^']+)' expects \$extractedValue to be >= .+$/,/NumberVariable '([^']+)' expects \$extractedValue to be <= .+$/];for(const e of o)if(s.match(e))return{valid:!0};return{valid:!1}}function Ur(s,o){if(s.status===Br&&s.error){const e=s.error;if(Jr(e).valid)throw new Ue(o,e,{cause:{name:String(s.status),message:e}})}}function Gr(s){mt(s)}function i(s,o){let e=!0,t=!1,n=Gr;typeof o=="function"?(t=!0,n=o):typeof o=="boolean"&&(e=o);try{s.success||(n(s),t&&mt(s));const r=s.data&&e;return{...s,parsedData:r?JSON.parse(s.data):s.data}}catch(r){throw console.error(r),r}}class Ge{constructor(o){g(this,V);this.getAll=async()=>(await a(this,V)).getActions().then(t=>i(t)),this.getById=async e=>(await a(this,V)).getActionById(e).then(n=>i(n)),this.create=async()=>(await a(this,V)).createAction().then(t=>i(t)),this.duplicate=async e=>(await a(this,V)).duplicateAction(e).then(n=>i(n)),this.remove=async e=>(await a(this,V)).removeAction(e).then(n=>i(n)),this.update=async(e,t)=>(await a(this,V)).updateAction(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>this.update(e,{name:t}),this.updateScript=async(e,t)=>this.update(e,{script:t}),this.updateTriggers=async(e,t)=>this.update(e,{triggers:t}),this.move=async(e,t)=>(await a(this,V)).moveActions(e,t).then(r=>i(r)),this.setTypeError=async(e,t)=>this.update(e,{hasTypeError:t}),this.disable=async()=>(await a(this,V)).disableActions().then(t=>i(t)),this.enable=async()=>(await a(this,V)).enableActions().then(t=>i(t)),this.enableForComponents=async e=>(await a(this,V)).enableComponentActions(e).then(n=>i(n)),y(this,V,o)}}V=new WeakMap;class _e{constructor(o){g(this,T);this.getAllOnSelectedLayout=async()=>(await a(this,T)).getAnimationsOnSelectedLayout().then(t=>i(t)),this.getByFrameId=async(e,t)=>(await a(this,T)).getAnimationByFrameId(e,t).then(r=>i(r)),this.getByLayoutId=async e=>(await a(this,T)).getAnimationsByLayoutId(e).then(n=>i(n)),this.setFrameAnimation=async e=>(await a(this,T)).setFrameAnimation(JSON.stringify(e)).then(n=>i({...n,data:JSON.stringify(e)})),this.play=async()=>(await a(this,T)).playAnimation().then(t=>i(t)),this.pause=async()=>(await a(this,T)).pauseAnimation().then(t=>i(t)),this.setScrubberPosition=async e=>(await a(this,T)).setScrubberPosition(e).then(n=>i(n)),this.setDuration=async e=>(await a(this,T)).setAnimationDuration(e).then(n=>i(n)),this.resetFrameAnimation=async e=>(await a(this,T)).resetFrameAnimation(e).then(n=>i(n)),this.reset=async()=>(await a(this,T)).resetAnimation().then(t=>i(t)),y(this,T,o)}}T=new WeakMap;var W=(s=>(s.code39="code39",s.code93="code93",s.code128="code128",s.dataMatrix="dataMatrix",s.ean13="ean13",s.ean8="ean8",s.qr="qr",s.upca="upca",s.upce="upce",s.gs1128="gs1128",s))(W||{}),Et=(s=>(s.low="low",s.medium="medium",s.quartile="quartile",s.high="high",s))(Et||{}),wt=(s=>(s.utf8="utf8",s.iso8859_1="iso8859_1",s.code128a="code128a",s.code128b="code128b",s.code128c="code128c",s))(wt||{}),He=(s=>(s.success="success",s.empty="empty",s.invalidLength="invalidLength",s.invalidCharacters="invalidCharacters",s.invalidChecksum="invalidChecksum",s.invalidUPCE="invalidUPCE",s.otherError="otherError",s))(He||{}),xe=(s=>(s.px="px",s.mm="mm",s.cm="cm",s.inch="inch",s.pt="pt",s))(xe||{}),Q=(s=>(s.top="top",s.right="right",s.bottom="bottom",s.left="left",s))(Q||{}),$e=(s=>(s.top="top",s.child="child",s))($e||{}),je=(s=>(s.print="print",s.digitalStatic="digitalStatic",s.digitalAnimated="digitalAnimated",s))(je||{}),ze=(s=>(s.locked="locked",s.range="range",s.none="none",s))(ze||{});class We{constructor(o){g(this,K);this.setBarcodeProperties=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableBackground=async(e,t)=>{const n={enableBackground:t};return this.setBarcodeProperties(e,n)},this.setBackgroundColor=async(e,t)=>{const n={backgroundColor:t};return this.setBarcodeProperties(e,n)},this.setEnableBars=async(e,t)=>{const n={enableBars:t};return this.setBarcodeProperties(e,n)},this.setBarColor=async(e,t)=>{const n={barColor:t};return this.setBarcodeProperties(e,n)},this.setBarcodeSource=async(e,t)=>(await a(this,K)).setBarcodeSource(e,JSON.stringify(t)).then(r=>i(r)),this.removeBarcodeSource=async e=>(await a(this,K)).setBarcodeSource(e,null).then(n=>i(n)),this.setEnableText=async(e,t)=>{const n={enableText:t};return this.setBarcodeProperties(e,n)},this.setBarHeight=async(e,t)=>{const n={barHeight:t};return this.setBarcodeProperties(e,n)},this.setMagnification=async(e,t)=>{const n={magnification:t};return this.setBarcodeProperties(e,n)},this.setQuietZoneValue=async(e,t,n)=>{const r=n?{left:n===Q.left?t:void 0,top:n===Q.top?t:void 0,right:n===Q.right?t:void 0,bottom:n===Q.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,K)).setBarcodeProperties(e,JSON.stringify({quietZone:r})).then(d=>i(d))},this.setAreQuietZoneValuesCombined=async(e,t)=>{const n={areQuietZoneValuesCombined:t};return(await a(this,K)).setBarcodeProperties(e,JSON.stringify({quietZone:n})).then(h=>i(h))},this.setErrorCorrectionLevel=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify({errorCorrectionLevel:t})).then(r=>i(r)),this.setCharacterSet=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify({characterSet:t})).then(r=>i(r)),this.setDrawLightMarginIndicator=async(e,t)=>{const n={drawStartStopChars:t};return this.setBarcodeProperties(e,n)},this.setDrawStartStopChars=async(e,t)=>{const n={drawStartStopChars:t};return this.setBarcodeProperties(e,n)},this.getBarcodeConfigationOptions=e=>{let t=!0,n=!0,r=!0,h,d,u=!1,m=!1,p=!1;switch(e){case W.qr:h=[wt.iso8859_1,wt.utf8],d=[Et.low,Et.medium,Et.quartile,Et.high];case W.dataMatrix:t=!1,n=!1,r=!1,u=!0;break;case W.ean13:t=!1,m=!0;break;case W.ean8:m=!0;case W.upca:case W.upce:t=!1;break;case W.code128:case W.gs1128:h=[wt.code128a,wt.code128b,wt.code128c];break;case W.code39:p=!0;break}return{allowEnableMagnification:r,allowBarHeight:n,allowQuietZone:!0,allowedCharacterSets:h,allowedErrorCorrectionLevels:d,allowToggleText:t,quietZoneAlwaysCombined:u,allowToggleLightMarginIndicator:m,allowToggleDrawStartAndEndChar:p}},y(this,K,o)}}K=new WeakMap;class Ke{constructor(o,e){g(this,P);this.getId=async()=>(await a(this,P)).getBrandKitId().then(n=>i(n)),this.getVersion=async()=>(await a(this,P)).getBrandKitVersion().then(n=>i(n)),this.getName=async()=>(await a(this,P)).getBrandKitName().then(n=>i(n)),this.rename=async t=>(await a(this,P)).renameBrandKit(t).then(r=>i(r)),this.updateIdAndVersion=async(t,n)=>(await a(this,P)).updateBrandKitIdAndVersion(t,n).then(h=>i(h)),this.get=async()=>(await a(this,P)).getBrandKit().then(n=>i(n)),this.getAllMedia=async()=>(await a(this,P)).getAllBrandKitMedia().then(n=>i(n)),this.addMedia=async(t,n,r)=>(await a(this,P)).addBrandKitMedia(t,n,r).then(d=>i(d)),this.updateMedia=async(t,n,r)=>(await a(this,P)).updateBrandKitMedia(t,n,r).then(d=>i(d)),this.renameMedia=async(t,n)=>(await a(this,P)).renameBrandKitMedia(t,n).then(h=>i(h)),this.removeMedia=async t=>(await a(this,P)).removeBrandKitMedia(t).then(r=>i(r)),this.set=async t=>(await a(this,P)).setBrandKit(JSON.stringify(t)).then(r=>i(r)),this.sync=async t=>(await a(this,P)).syncBrandKit(JSON.stringify(t)).then(r=>i(r)),this.isAutoSync=async()=>(await a(this,P)).isBrandKitAutoSync().then(n=>i(n)),this.enableAutoSync=async t=>(await a(this,P)).enableBrandKitAutoSync(t).then(r=>i(r)),this.switchTheme=async t=>(await a(this,P)).switchBrandKitTheme(t).then(r=>i(r)),y(this,P,o),this.sdk=e}}P=new WeakMap;class fe{constructor(o){g(this,ot);this.zoomToPage=async(e,t,n,r,h)=>(e!==void 0&&console.warn("id has no effect and will be deprecated in the future"),(await a(this,ot)).zoomToPage(t,n,r,h).then(u=>i(u))),this.getZoomPercentage=async()=>(await a(this,ot)).getZoomPercentage().then(t=>i(t)),this.setZoomPercentage=async e=>(await a(this,ot)).setZoomPercentage(e).then(n=>i(n)),this.setViewMode=async e=>(await a(this,ot)).setViewMode(e).then(n=>i(n)),y(this,ot,o)}}ot=new WeakMap;class qe{constructor(o){g(this,_);this.getAll=async()=>(await a(this,_)).getCharacterStyles().then(t=>i(t)),this.getById=async e=>(await a(this,_)).getCharacterStyleById(e).then(n=>i(n)),this.create=async()=>(await a(this,_)).createCharacterStyle().then(t=>i(t)),this.update=async(e,t)=>(await a(this,_)).updateCharacterStyle(e,JSON.stringify(t)).then(r=>i(r)),this.remove=async e=>(await a(this,_)).removeCharacterStyle(e).then(n=>i(n)),this.duplicate=async e=>(await a(this,_)).duplicateCharacterStyle(e).then(n=>i(n)),this.rename=async(e,t)=>(await a(this,_)).renameCharacterStyle(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,_)).moveCharacterStyles(e,t).then(r=>i(r)),y(this,_,o)}}_=new WeakMap;class Ye{constructor(o){g(this,ht);this.copyFrames=async e=>{const n=await(await a(this,ht)).copyFrames(e);return n.data&&await navigator.clipboard.writeText(n.data),i(n)},this.cutFrames=async e=>{const n=await(await a(this,ht)).cutFrames(e);return n.data&&await navigator.clipboard.writeText(n.data),i(n)},this.pasteFrames=async()=>{const e=await a(this,ht),t=await navigator.clipboard.readText(),n=await e.pasteFrames(t);return i(n)},this.getContentType=async()=>{const e=await a(this,ht),t=await navigator.clipboard.readText(),n=await e.getClipboardContentType(t);return i(n)},y(this,ht,o)}}ht=new WeakMap;class Ze{constructor(o){g(this,qt);this.convertToRgb=async e=>(await a(this,qt)).colorToRgb(JSON.stringify(e)).then(n=>i(n)),y(this,qt,o)}}qt=new WeakMap;var Qe=(s=>(s.rgb="rgb",s.hex="hex",s.cmyk="cmyk",s.spotCmyk="spotCmyk",s.spotRgb="spotRgb",s.spotHex="spotHex",s))(Qe||{}),he=(s=>(s.rgb="rgb",s.hex="hex",s.cmyk="cmyk",s.gray="gray",s.hsl="hsl",s.spot="spot",s.spotCMYK="spotCMYK",s.spotRGB="spotRGB",s.spotHEX="spotHEX",s))(he||{}),Xe=(s=>(s.local="local",s.brandKit="brandKit",s.stylekit="brandKit",s))(Xe||{});class ts{constructor(o){g(this,H);this.getAll=async()=>(await a(this,H)).getColors().then(t=>i(t)),this.getById=async e=>(await a(this,H)).getColorById(e).then(n=>i(n)),this.create=async()=>(await a(this,H)).createColor().then(t=>i(t)),this.duplicate=async e=>(await a(this,H)).duplicateColor(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,H)).moveColors(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,H)).renameColor(e,t).then(r=>i(r)),this.update=async(e,t)=>{const n=await a(this,H),r=t;return r.type===he.spot&&(r.type=he.spotCMYK),n.updateColor(e,JSON.stringify(r)).then(h=>i(h))},this.remove=async e=>(await a(this,H)).removeColor(e).then(n=>i(n)),y(this,H,o)}}H=new WeakMap;var Ot=(s=>(s[s.file=0]="file",s[s.collection=1]="collection",s))(Ot||{}),ce=(s=>(s.LowResolutionWeb="lowresWeb",s.HighResolutionWeb="highresWeb",s))(ce||{}),Dt=(s=>(s.file="file",s.collection="collection",s))(Dt||{}),es=(s=>(s.media="media",s.fonts="fonts",s.data="data",s.components="components",s))(es||{}),ss=(s=>(s.name="name",s.path="relativePath",s.id="id",s))(ss||{}),ns=(s=>(s.ascending="asc",s.descending="desc",s))(ns||{}),rs=(s=>(s.text="text",s.boolean="boolean",s.number="number",s))(rs||{}),as=(s=>(s.query="query",s.upload="upload",s))(as||{}),Ft=(s=>(s.url="url",s.grafx="grafx",s.local="local",s))(Ft||{});class _r{constructor(o,e,t,n="engineToConnector",r){this.direction="engineToConnector",this.name=o,this.direction=n,e==="var"?(this.value=`var.${t}`,this.id=t,this.type="var",this.sourceField=r):(this.value=t,this.type="value")}}var is=(s=>(s.variable="var",s.value="value",s))(is||{}),os=(s=>(s.engineToConnector="engineToConnector",s.connectorToEngine="connectorToEngine",s))(os||{}),de=(s=>(s.loading="loading",s.loaded="loaded",s.running="running",s.ready="ready",s.error="error",s))(de||{}),hs=(s=>(s.stateChanged="stateChanged",s.authChanged="authChanged",s.reloadRequired="reloadRequired",s.unloaded="unloaded",s))(hs||{});const Hr={url:"grafx-media.json",source:"local"};class xr{constructor(o,e){this.type="grafxToken",this.token=o,this.headers=e}}class $r{constructor(o){this.type="refreshed",this.headers=o}}var cs=(s=>(s.grafxToken="grafxToken",s.refreshed="refreshed",s))(cs||{}),ds=(s=>(s.grafxToken="grafxToken",s.any="any",s))(ds||{}),Se=(s=>(s.minDimension="minDimension",s))(Se||{});class ls extends Error{constructor(o,e){super(o),this.type=e}}var us=(s=>(s.StaticKey="staticKey",s.OAuth2ClientCredentials="oAuth2ClientCredentials",s.OAuth2AuthorizationCode="oAuth2AuthorizationCode",s.OAuth2ResourceOwnerPassword="oAuth2ResourceOwnerPassword",s.OAuth2JwtBearer="oAuth2JwtBearer",s.None="none",s))(us||{});class le{constructor(){this.makeConnectorSourceForwardsCompatible=o=>{if(o.source!=Ft.grafx||this.isSourceMigrated(o))return o;let e=o.url;for(;e.endsWith("/");)e=e.substring(0,e.length-1);const t=e.split("/");return{id:t[t.length-1],source:Ft.grafx}},this.makeMultipleConnectorsBackwardsCompatible=(o,e)=>o.map(t=>this.makeSingleConnectorBackwardsCompatible(t,e)),this.makeSingleConnectorBackwardsCompatible=(o,e)=>o.source.source!=Ft.grafx?o:{id:o.id,name:o.name,iconUrl:o.iconUrl,source:this.makeConnectorSourceBackwardsCompatible(o.source,e)},this.makeConnectorSourceBackwardsCompatible=(o,e)=>{let t=e;for(;t!=null&&t.endsWith("/");)t=t.substring(0,t.length-1);return{url:`${t}/connectors/${o.id}`,source:Ft.grafx}},this.isSourceMigrated=o=>"id"in o}}let gs=($n=class{constructor(o,e){g(this,J);g(this,Mt);g(this,Ct);this.getById=async t=>(await a(this,J)).getConnectorById(t).then(r=>i(r)).then(r=>{const h={...r,parsedData:null};return r.parsedData&&(h.parsedData=a(this,Ct).makeSingleConnectorBackwardsCompatible(r.parsedData,a(this,Mt).get(Z.GraFxStudioEnvironmentApiUrl))),h}),this.getAllByType=async t=>(await a(this,J)).getConnectors(t).then(r=>i(r)).then(r=>{const h={...r,parsedData:null};return r.parsedData&&(h.parsedData=a(this,Ct).makeMultipleConnectorsBackwardsCompatible(r.parsedData,a(this,Mt).get(Z.GraFxStudioEnvironmentApiUrl))),h}),this.register=async t=>{const n=await a(this,J),r=a(this,Ct).makeConnectorSourceForwardsCompatible(t);return n.registerConnector(JSON.stringify(r)).then(h=>i(h))},this.unregister=async t=>(await a(this,J)).unregisterConnector(t).then(r=>i(r)),this.configure=async(t,n)=>{const r=await a(this,J);return await this.waitToBeReady(t),await n(new jr(t,r)),r.updateConnectorConfiguration(t).then(h=>i(h))},this.getState=async t=>(await a(this,J)).getConnectorState(t).then(r=>i(r)),this.getOptions=async t=>(await a(this,J)).getConnectorOptions(t).then(r=>i(r)),this.waitToBeReady=async(t,n=2e3)=>{let r=Math.max(n,500);r=Math.min(r,5e3);const h=100;let d=0;try{for(;d*h<r;){const u=await this.getState(t);if(u.success&&u.parsedData&&(u.parsedData.type===de.running||u.parsedData.type===de.ready))return i({data:null,success:!0,error:void 0,status:0,parsedData:void 0},!1);await new Promise(m=>setTimeout(m,h)),d++}}catch(u){return i({data:null,success:!1,error:`Error while getting connector state ${u}`,status:5e4,parsedData:void 0},!1)}return i({data:null,success:!1,error:"Timed out waiting for connector",status:5e4,parsedData:void 0},!1)},this.updateMappings=async(t,n)=>await this.configure(t,async r=>{const{parsedData:h}=await this.getMappings(t),d=(h==null?void 0:h.filter(p=>!n.some(S=>S.name===p.name&&S.direction===p.direction)))??[],u=n.filter(p=>p.name!==""&&p.value!==""),m=[...d,...u];await r.setMappings(m)}),this.applyMappings=async(t,n)=>await this.configure(t,async r=>{const h=n.filter(d=>d.name!==""&&d.value!=="");await r.setMappings(h)}),this.setHttpHeaders=async(t,n)=>(await a(this,J)).remoteConnectorAuthenticationSetHttpHeaders(t,JSON.stringify(n)).then(h=>i(h)),y(this,J,o),y(this,Mt,e),y(this,Ct,new le)}async getMappings(o,e){return(await a(this,J)).getConnectorMappings(o).then(n=>i(n)).then(n=>{var r;return e?{...n,parsedData:(r=n.parsedData)==null?void 0:r.filter(h=>h.direction===e)}:n})}},J=new WeakMap,Mt=new WeakMap,Ct=new WeakMap,$n);class jr{constructor(o,e){g(this,ft);g(this,St);this.setOptions=async t=>a(this,St).setConnectorOptions(a(this,ft),JSON.stringify(t)).then(n=>i(n)),this.setMappings=async t=>{const n=await a(this,St).setConnectorMappings(a(this,ft),t.map(function(r){return JSON.stringify(r)}));return i(n)},this.setHttpHeader=async(t,n)=>a(this,St).connectorAuthenticationSetHttpHeader(a(this,ft),t,n).then(r=>i(r)),y(this,ft,o),y(this,St,e)}}ft=new WeakMap,St=new WeakMap;class ys{constructor(o,e){g(this,et);g(this,Rt);this.getPageItemById=async(t,n,r,h={})=>{const u=await(await a(this,et)).dataConnectorGetPageItemById(t,n,JSON.stringify(r),JSON.stringify(h)),m=i(u),p={...m,parsedData:null};return m.parsedData&&(p.parsedData={...m.parsedData,data:a(this,Rt).mapEngineToDataItem(m.parsedData.data)}),p},this.getConfigurationOptions=async t=>(await a(this,et)).dataConnectorGetConfigurationOptions(t).then(r=>i(r)),this.getCapabilities=async t=>(await a(this,et)).dataConnectorGetCapabilities(t).then(r=>i(r)),y(this,et,o),y(this,Rt,e)}async getPage(o,e,t={}){const{previousPageToken:n,continuationToken:r}=e;if(n!=null&&r!=null)throw new Error('Invalid page config: "previousPageToken" and "continuationToken" are mutually exclusive. Provide only one to indicate navigation direction.');const d=await(await a(this,et)).dataConnectorGetPage(o,JSON.stringify(e),JSON.stringify(t)),u=i(d),m={...u,parsedData:null};return u.parsedData&&(m.parsedData={...u.parsedData,data:u.parsedData.data.map(p=>a(this,Rt).mapEngineToDataItem(p))}),m}async getModel(o,e={}){return(await a(this,et)).dataConnectorGetModel(o,JSON.stringify(e)).then(n=>i(n))}}et=new WeakMap,Rt=new WeakMap;class ps{constructor(o,e){g(this,ct);g(this,Yt);this.setDataSource=async t=>(await a(this,ct)).setDataSource(t).then(r=>i(r)),this.getDataSource=async()=>(await a(this,ct)).getDataSource().then(n=>i(n)),this.removeDataSource=async()=>(await a(this,ct)).removeDataSource().then(n=>i(n)),this.setDataRow=async t=>{const n=await a(this,ct),r=a(this,Yt).mapDataItemToEngine(t);return n.setDataRow(JSON.stringify(r)).then(h=>i(h))},y(this,ct,o),y(this,Yt,e)}}ct=new WeakMap,Yt=new WeakMap;class ms{constructor(o){g(this,dt);this.getAllLogs=async()=>(await a(this,dt)).getLogs().then(t=>i(t)),this.toggleDebugPanel=async()=>(await a(this,dt)).toggleDebugPanel().then(t=>i(t)),this.enableDebug=async()=>(await a(this,dt)).enableDebug().then(t=>i(t)),this.disableDebug=async()=>(await a(this,dt)).disableDebug().then(t=>i(t)),y(this,dt,o)}}dt=new WeakMap;class ws{constructor(o){g(this,bt);this.getCurrentState=async()=>(await a(this,bt)).getCurrentDocumentState().then(t=>i(t)),this.load=async(e,t={keepConnectors:!1})=>{const n=await a(this,bt),r=typeof e!="string"?JSON.stringify(e):e;return n.loadDocument(r,JSON.stringify(t)).then(h=>i(h))},this.createAndLoad=async e=>{const t=await a(this,bt),n=JSON.stringify(e);return t.createAndLoadDocument(n).then(r=>i(r))},y(this,bt,o)}}bt=new WeakMap;var Cs=(s=>(s.resize="resize",s.scale="scale",s.scaleAndResize="scaleAndResize",s))(Cs||{}),fs=(s=>(s.top="top",s.bottom="bottom",s.left="left",s.right="right",s))(fs||{}),zt=(s=>(s.url="url",s.variable="variable",s.connector="connector",s.brandKitMedia="brandKitMedia",s))(zt||{}),Ss=(s=>(s.connector="connector",s))(Ss||{}),bs=(s=>(s.text="text",s.image="image",s.shape="shape",s.barcode="barcode",s.component="component",s.componentGrid="componentGrid",s))(bs||{}),Is=(s=>(s.variable="variable",s.text="text",s))(Is||{}),vs=(s=>(s.leftToRight="leftToRight",s.rightToLeft="rightToLeft",s.weak="weak",s))(vs||{}),As=(s=>(s.horizontal="horizontal",s.vertical="vertical",s.onPath="onPath",s))(As||{}),Ps=(s=>(s.top="top",s.bottom="bottom",s.middle="middle",s.justify="justify",s))(Ps||{}),Es=(s=>(s.normal="normal",s.screen="screen",s.overlay="overlay",s.darken="darken",s.lighten="lighten",s.colorDodge="colorDodge",s.colorBurn="colorBurn",s.hardLight="hardLight",s.softLight="softLight",s.difference="difference",s.exclusion="exclusion",s.multiply="multiply",s.hue="hue",s.saturation="saturation",s.color="color",s.luminosity="luminosity",s))(Es||{}),Os=(s=>(s.fill="fill",s.fit="fit",s.smartCrop="smartCrop",s.manualCrop="manualCrop",s))(Os||{}),Ds=(s=>(s.topLeft="topLeft",s.topCenter="topCenter",s.topRight="topRight",s.centerLeft="centerLeft",s.center="center",s.centerRight="centerRight",s.bottomLeft="bottomLeft",s.bottomCenter="bottomCenter",s.bottomRight="bottomRight",s))(Ds||{}),Fs=(s=>(s.bringToFront="bringToFront",s.sendToBack="sendToBack",s.bringForward="bringForward",s.sendBackward="sendBackward",s))(Fs||{}),Ls=(s=>(s.relative="relative",s.start="start",s.end="end",s.startAndEnd="startAndEnd",s.center="center",s))(Ls||{}),Ns=(s=>(s.page="page",s.frame="frame",s))(Ns||{}),Ms=(s=>(s.start="start",s.end="end",s.center="center",s))(Ms||{});class zr{constructor(){this.type="page"}}class Wr{constructor(o,e){this.type="frame",this.frameId=o,this.edge=e}}var be=(s=>(s.frameCrop="frameCrop",s.assetCrop="assetCrop",s))(be||{}),Rs=(s=>(s.v1="v1",s.v2="v2",s))(Rs||{});const Kr="v2";var Vs=(s=>(s.start="start",s.center="center",s.end="end",s))(Vs||{});class Ts{constructor(o){g(this,x);this.insertImageVariableToFrame=async(e,t)=>{const n=await a(this,x),r={id:t,type:zt.variable};return n.setImageSource(e,JSON.stringify(r)).then(h=>i(h))},this.insertTextVariable=async e=>(await a(this,x)).insertTextVariable(e).then(n=>i(n)),this.enterTextEditMode=async e=>(await a(this,x)).enterTextEditMode(e).then(n=>i(n)),this.exitTextEditMode=async()=>(await a(this,x)).exitTextEditMode().then(t=>i(t)),this.getText=async(e,t)=>(await a(this,x)).getTextByFrameId(e,t).then(r=>i(r)),this.setText=async(e,t)=>(await a(this,x)).setTextByFrameId(e,t).then(r=>i(r)),this.selectText=async(e,t,n)=>(await a(this,x)).selectTextById(e,t,n).then(h=>i(h)),this.addCustomUndoData=async(e,t,n)=>(await a(this,x)).setCustomUndoData(e,t,n??!1).then(h=>i(h)),y(this,x,o)}}x=new WeakMap;class ks{constructor(o){g(this,lt);g(this,Vt);this.query=async(e,t,n={})=>(await a(this,lt)).fontConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(h=>i(h)),this.detail=async(e,t,n={})=>(await a(this,lt)).fontConnectorDetail(e,t,JSON.stringify(n)).then(h=>i(h)),this.download=async(e,t,n={})=>(await a(this,Vt)).fontConnectorDownload(e,t,JSON.stringify(n)).then(h=>h??h),this.preview=async(e,t,n,r={})=>(await a(this,Vt)).fontConnectorPreview(e,t,n,JSON.stringify(r)).then(d=>d??d),this.getConfigurationOptions=async e=>(await a(this,lt)).fontConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,lt)).fontConnectorGetCapabilities(e).then(n=>i(n)),this.parseDeprecatedFontType=e=>{if(e===Ot.file)return Dt.file;if(e===Ot.collection)return Dt.collection},y(this,lt,o),y(this,Vt,o)}}lt=new WeakMap,Vt=new WeakMap;class Bs{constructor(o){g(this,E);this.addFontFamily=async(e,t)=>(await a(this,E)).addFontFamily(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontFamily=async e=>(await a(this,E)).removeFontFamily(e).then(n=>i(n)),this.addFontStyle=async(e,t)=>(await a(this,E)).addFontStyle(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontStyle=async e=>(await a(this,E)).removeFontStyle(e).then(n=>i(n)),this.getFontFamilies=async()=>(await a(this,E)).getFontFamilies().then(t=>i(t)),this.getFontStyles=async e=>(await a(this,E)).getFontStyles(e).then(n=>i(n)),this.getFontFamilyById=async e=>(await a(this,E)).getFontFamilyById(e).then(n=>i(n)),this.getFontStyleById=async e=>(await a(this,E)).getFontStyleById(e).then(n=>i(n)),this.getDefaultFontStyle=async()=>(await a(this,E)).getDefaultFontStyle().then(t=>i(t)),this.getDefaultFontFamily=async()=>(await a(this,E)).getDefaultFontFamily().then(t=>i(t)),this.isFontFamilyUsed=async e=>(await a(this,E)).isFontFamilyUsed(e).then(n=>i(n)),this.isFontStyleUsed=async e=>(await a(this,E)).isFontStyleUsed(e).then(n=>i(n)),this.moveFontFamilies=async(e,t)=>(await a(this,E)).moveFontFamilies(e,t).then(r=>i(r)),this.getPreviewsOfCharacterStrings=async(e,t)=>(await a(this,E)).getPreviewsOfCharacterStrings(e,JSON.stringify(t)).then(r=>i(r)),y(this,E,o)}}E=new WeakMap;class Ie{constructor(o){g(this,Tt);this.setShapeProperties=async(e,t)=>(await a(this,Tt)).setShapeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableFill=async(e,t)=>{const n={enableFill:t};return this.setShapeProperties(e,n)},this.setFillColor=async(e,t)=>{const n={fillColor:t};return this.setShapeProperties(e,n)},this.setEnableStroke=async(e,t)=>{const n={enableStroke:t};return this.setShapeProperties(e,n)},this.setStrokeColor=async(e,t)=>{const n={strokeColor:t};return this.setShapeProperties(e,n)},this.setStrokeWeight=async(e,t)=>{const n={strokeWeight:t};return this.setShapeProperties(e,n)},this.setFlagAllCornersSame=async(e,t)=>{const n={allCornersSame:t};return this.setShapeProperties(e,n)},this.setShapeCorners=async(e,t)=>(await a(this,Tt)).setShapeCorners(e,JSON.stringify(t)).then(r=>i(r)),this.setRadiusAll=async(e,t)=>{const n={radiusAll:t};return this.setShapeCorners(e,n)},this.setRadiusTopLeft=async(e,t)=>{const n={topLeft:t};return this.setShapeCorners(e,n)},this.setRadiusBottomLeft=async(e,t)=>{const n={bottomLeft:t};return this.setShapeCorners(e,n)},this.setRadiusTopRight=async(e,t)=>{const n={topRight:t};return this.setShapeCorners(e,n)},this.setRadiusBottomRight=async(e,t)=>{const n={bottomRight:t};return this.setShapeCorners(e,n)},y(this,Tt,o)}}Tt=new WeakMap;class Js{constructor(o){g(this,l);this.getAll=async()=>(await a(this,l)).getFrames().then(t=>i(t)),this.getSelected=async()=>(await a(this,l)).getSelectedFrames().then(t=>i(t)),this.getAllByPageId=async e=>(await a(this,l)).getFramesByPageId(e).then(n=>i(n)),this.getByName=async e=>(await a(this,l)).getFrameByName(e).then(n=>i(n)),this.getById=async e=>(await a(this,l)).getFrameById(e).then(n=>i(n)),this.getPropertiesOnSelectedLayout=async()=>(await a(this,l)).getFramePropertiesOnSelectedLayout().then(t=>i(t)),this.getLayoutProperties=async(e,t)=>(await a(this,l)).getFramePropertiesByFrameId(e,t).then(r=>i(r)),this.getAllLayoutProperties=async e=>(await a(this,l)).getFramesProperties(e).then(n=>i(n)),this.resetTransformation=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetSize=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.select=async e=>(await a(this,l)).selectFrames([e]).then(n=>i(n)),this.selectMultiple=async e=>(await a(this,l)).selectFrames(e).then(n=>i(n)),this.deselectAll=async()=>(await a(this,l)).deselectFrames().then(t=>i(t)),this.reorderFrames=async(e,t)=>(await a(this,l)).reorderFrames(e,t).then(r=>i(r)),this.setZIndex=async(e,t)=>(await a(this,l)).setFrameZIndex(e,t).then(r=>i(r)),this.setHeight=async(e,t)=>(await a(this,l)).setFrameHeight(e,t).then(r=>i(r)),this.setRotation=async(e,t)=>(await a(this,l)).setFrameRotation(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,l)).setFrameWidth(e,t).then(r=>i(r)),this.setX=async(e,t)=>(await a(this,l)).setFrameX(e,t).then(r=>i(r)),this.setY=async(e,t)=>(await a(this,l)).setFrameY(e,t).then(r=>i(r)),this.setOpacity=async(e,t)=>(await a(this,l)).setFrameOpacity(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,l)).renameFrame(e,t).then(r=>i(r)),this.reset=async e=>(await a(this,l)).resetFrame(e).then(n=>i(n)),this.resetX=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetY=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetRotation=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetWidth=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetHeight=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetImageFrameFitMode=async e=>(await a(this,l)).resetImageFrameFitMode(e).then(n=>i(n)),this.setVisibility=async(e,t)=>(await a(this,l)).setFrameIsVisible(e,t).then(r=>i(r)),this.setIsVisible=async(e,t)=>(await a(this,l)).setFrameIsVisible(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,l)).removeFrames([e]).then(n=>i(n)),this.removeFrames=async e=>(await a(this,l)).removeFrames(e).then(n=>i(n)),this.create=async(e,t,n,r,h)=>(await a(this,l)).addFrame(e,t,n,r,h).then(u=>i(u)),this.createShapeFrame=async(e,t,n,r,h)=>(await a(this,l)).addFrame(e,t,n,r,h).then(u=>i(u)),this.createBarcodeFrame=async(e,t)=>(await a(this,l)).addBarcodeFrame(e,t==null?void 0:t.x,t==null?void 0:t.y).then(r=>i(r)),this.createComponentFrame=async(e,t,n,r,h)=>(await a(this,l)).addComponentFrame(t,n,r,h,JSON.stringify(e)).then(u=>i(u)),this.duplicateFrames=async e=>(await a(this,l)).duplicateFrames(e).then(n=>i(n)),this.updateImageSource=async(e,t)=>{const n=await a(this,l),r=t!==null?JSON.stringify(t):null;return n.setImageSource(e,r).then(h=>i(h))},this.removeImageSource=async e=>this.updateImageSource(e,null),this.setImageFromConnector=async(e,t,n)=>{const r={id:t,assetId:n,type:zt.connector};return this.updateImageSource(e,r)},this.setImageFromUrl=async(e,t)=>{const n={url:t,type:zt.url};return this.updateImageSource(e,n)},this.setImageFrameFitMode=async(e,t)=>(await a(this,l)).setImageFrameFitMode(e,t).then(r=>i(r)),this.setImageFrameFitModePosition=async(e,t)=>(await a(this,l)).setImageFrameFitModePosition(e,t).then(r=>i(r)),this.setImageFrameSmartCropSettings=async(e,t)=>(await a(this,l)).setImageFrameSmartCropSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setFrameConstrainProportions=async(e,t)=>(console.error("setFrameConstrainProportions is not supported anymore"),i({success:!1,status:0,error:"setFrameConstrainProportions is not supported anymore",parsedData:null})),this.setVerticalAlign=async(e,t)=>(await a(this,l)).setVerticalAlignment(e,t).then(r=>i(r)),this.setNumberOfColumns=async(e,t)=>(await a(this,l)).setNumberOfColumns(e,t).then(r=>i(r)),this.setColumnGap=async(e,t)=>(await a(this,l)).setColumnGap(e,t).then(r=>i(r)),this.setMinCopyfitting=async(e,t)=>(await a(this,l)).setMinCopyfitting(e,t).then(r=>i(r)),this.setMaxCopyfitting=async(e,t)=>(await a(this,l)).setMaxCopyfitting(e,t).then(r=>i(r)),this.setEnableCopyfitting=async(e,t)=>(await a(this,l)).setEnableCopyfitting(e,t).then(r=>i(r)),this.resetMinCopyfitting=async e=>(await a(this,l)).resetMinCopyfitting(e).then(n=>i(n)),this.resetMaxCopyfitting=async e=>(await a(this,l)).resetMaxCopyfitting(e).then(n=>i(n)),this.resetEnableCopyfitting=async e=>(await a(this,l)).resetEnableCopyfitting(e).then(n=>i(n)),this.setShapeFrameEnableFill=async(e,t)=>this.shapeController.setEnableFill(e,t),this.setShapeFrameFillColor=async(e,t)=>this.shapeController.setFillColor(e,t),this.setShapeFrameEnableStroke=async(e,t)=>this.shapeController.setEnableStroke(e,t),this.setShapeFrameStrokeColor=async(e,t)=>this.shapeController.setStrokeColor(e,t),this.setShapeFrameStrokeWeight=async(e,t)=>this.shapeController.setStrokeWeight(e,t),this.setBlendMode=async(e,t)=>(await a(this,l)).setFrameBlendMode(e,t).then(r=>i(r)),this.setFrameContainerShape=async(e,t)=>(await a(this,l)).setFrameContainerShape(e,JSON.stringify(t)).then(r=>i(r)),this.enterCropMode=async(e,t=be.frameCrop)=>(await a(this,l)).enterCropMode(e,t).then(r=>i(r)),this.applyCropMode=async()=>(await a(this,l)).applyCropMode().then(t=>i(t)),this.exitCropMode=async()=>(await a(this,l)).cancelCropMode().then(t=>i(t)),this.enterSubjectMode=async e=>(await a(this,l)).enterSubjectMode(e).then(n=>i(n)),this.applySubjectMode=async()=>(await a(this,l)).applySubjectMode().then(t=>i(t)),this.exitSubjectMode=async()=>(await a(this,l)).cancelSubjectMode().then(t=>i(t)),this.enterGradientMode=async e=>(await a(this,l)).enterGradientMode(e).then(n=>i(n)),this.applyGradientMode=async()=>(await a(this,l)).applyGradientMode().then(t=>i(t)),this.cancelGradientMode=async()=>(await a(this,l)).cancelGradientMode().then(t=>i(t)),this.resetCropMode=async e=>(console.error("resetCropMode is not supported anymore"),i({success:!1,status:0,error:"resetCropMode is not supported anymore",parsedData:null})),this.setEnableAutoGrow=async(e,t)=>{const n={enabled:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setAutoGrowMinWidth=async(e,t)=>{const n={minWidth:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setAutoGrowMaxWidth=async(e,t)=>{const n={maxWidth:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setAutoGrowMinHeight=async(e,t)=>{const n={minHeight:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setAutoGrowMaxHeight=async(e,t)=>{const n={maxHeight:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setAutoGrowDirections=async(e,t)=>{const n={directions:{value:t}};return(await a(this,l)).updateAutoGrowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.resetAutoGrowSettingsEnabled=async e=>(console.error("resetAutoGrowSettingsEnabled is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowSettingsEnabled is not supported anymore",parsedData:null})),this.resetAutoGrowMinWidth=async e=>(console.error("resetAutoGrowMinWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMaxWidth=async e=>(console.error("resetAutoGrowMaxWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMinHeight=async e=>(console.error("resetAutoGrowMinHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinHeight is not supported anymore",parsedData:null})),this.resetAutoGrowMaxHeight=async e=>(console.error("resetAutoGrowMaxHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxHeight is not supported anymore",parsedData:null})),this.resetAutoGrowDirections=async e=>(console.error("resetAutoGrowDirections is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowDirections is not supported anymore",parsedData:null})),this.resetAutoGrow=async e=>(console.error("resetAutoGrow is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrow is not supported anymore",parsedData:null})),this.setShadowEnabled=async(e,t)=>{const n={enabled:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setShadowDistance=async(e,t)=>{const n={distance:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setShadowAngleDegrees=async(e,t)=>{const n={angleDegrees:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setShadowBlurRadius=async(e,t)=>{const n={blurRadius:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setShadowColor=async(e,t)=>{const n={color:{value:t}};return(await a(this,l)).updateFrameShadowSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setAnchor=async(e,t,n,r,h)=>{const d={horizontal:t,type:n,target:r,endTarget:h};return(await a(this,l)).setAnchorProperties(e,JSON.stringify(d)).then(m=>i(m))},this.setVerticalAnchor=async(e,t,n,r)=>this.setAnchor(e,!1,t,n,r),this.setHorizontalAnchor=async(e,t,n,r)=>this.setAnchor(e,!0,t,n,r),this.resetAnchoring=async e=>(await a(this,l)).resetFrameTransformation(e).then(n=>i(n)),this.resetVisibility=async e=>(await a(this,l)).setFrameIsVisible(e,null).then(n=>i(n)),this.getConfiguration=async e=>(await a(this,l)).getFrameConfiguration(e).then(n=>i(n)),this.resetAssetCropOverride=async e=>(await a(this,l)).resetAssetCropOverride(e).then(n=>i(n)),this.resetAllAssetCropOverrides=async e=>(await a(this,l)).resetAllAssetCropOverrides(e).then(n=>i(n)),this.setGradientApplied=async(e,t)=>{const n={isApplied:t};return(await a(this,l)).updateFrameGradientSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setLocalGradient=async(e,t)=>{const n={gradient:t};return(await a(this,l)).updateFrameGradientSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setBrandKitGradient=async(e,t)=>{const n={id:t};return(await a(this,l)).updateFrameGradientSettings(e,JSON.stringify(n)).then(h=>i(h))},this.setSmartCropSubjectId=async(e,t)=>(await a(this,l)).setSmartCropSubjectId(e,t).then(r=>i(r)),y(this,l,o),this.shapeController=new Ie(a(this,l)),this.constraints=new qr(a(this,l))}}l=new WeakMap;class qr{constructor(o){g(this,N);this.get=async e=>(await a(this,N)).getFrameConstraints(e).then(n=>i(n)),this.setSelectable=async(e,t)=>{const n={selectionAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setHorizontalMovement=async(e,t)=>{const n={horizontalMovementAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setVerticalMovement=async(e,t)=>{const n={verticalMovementAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setRotation=async(e,t)=>{const n={rotationAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setResize=async(e,t,n)=>{const r={resizeAllowed:{value:t},...n!==void 0&&{proportionLocked:{value:n}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(r)).then(d=>i(d))},this.setCrop=async(e,t)=>{const n={image:{cropAllowed:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setTextEditingAllowed=async(e,t)=>{const n={text:{editingAllowed:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setAllowedParagraphStyles=async(e,t)=>{const n={text:{paragraphStyles:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setAllowedCharacterStyles=async(e,t)=>{const n={text:{characterStyles:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setAllowedColors=async(e,t)=>{const n={text:{colors:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},this.setAllowedFontSizes=async(e,t)=>{const n={text:{fontSizes:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(h=>i(h))},y(this,N,o)}}N=new WeakMap;class Us{constructor(){this.currentEngineVersion=k.current,this.currentSDKVersion=Fe.version}}class Gs{constructor(o){g(this,f);g(this,Zt);this.getAll=async()=>(await a(this,f)).getLayouts().then(t=>i(t)),this.getById=async e=>(await a(this,f)).getLayoutById(e).then(n=>i(n)),this.getByName=async e=>(await a(this,f)).getLayoutByName(e).then(n=>i(n)),this.getSelected=async()=>(await a(this,f)).getSelectedLayout().then(t=>i(t)),this.remove=async e=>(await a(this,f)).removeLayout(e).then(n=>i(n)),this.create=async(e,t)=>{const n=await a(this,f);return t!=null&&t.length?n.addLayouts(e,JSON.stringify(t)).then(r=>i(r)):n.addLayout(e).then(r=>i(r))},this.rename=async(e,t)=>(await a(this,f)).renameLayout(e,t).then(r=>i(r)),this.select=async e=>(await a(this,f)).selectLayoutWithOptions(e,null).then(n=>i(n)),this.selectWithPageSize=async(e,t)=>{const n=await a(this,f),r={pageSize:t};return n.selectLayoutWithOptions(e,JSON.stringify(r)).then(h=>i(h))},this.duplicate=async e=>(await a(this,f)).duplicateLayout(e).then(n=>i(n)),this.reset=async e=>(await a(this,f)).resetLayout(e).then(n=>i(n)),this.setHeight=async(e,t)=>(await a(this,f)).setLayoutHeight(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,f)).setLayoutWidth(e,t).then(r=>i(r)),this.setUnit=async(e,t)=>(await a(this,f)).setLayoutUnit(e,t).then(r=>i(r)),this.resetHeight=async e=>(await a(this,f)).resetLayoutHeight(e).then(n=>i(n)),this.resetWidth=async e=>(await a(this,f)).resetLayoutWidth(e).then(n=>i(n)),this.resetUnit=async e=>(await a(this,f)).resetLayoutUnit(e).then(n=>i(n)),this.getSelectedSnapshot=async()=>(await a(this,Zt)).getPageSnapshot().then(t=>t??t),this.setIntent=async(e,t)=>(await a(this,f)).setLayoutIntent(e,t).then(r=>i(r)),this.resetIntent=async e=>(await a(this,f)).resetLayoutIntent(e).then(n=>i(n)),this.setFillColor=async(e,t)=>(await a(this,f)).setLayoutFillColor(e,JSON.stringify(t)).then(r=>i(r)),this.setFillColorEnabled=async(e,t)=>(await a(this,f)).setLayoutFillColorEnabled(e,t).then(r=>i(r)),this.resetFillColor=async e=>(await a(this,f)).resetLayoutFillColor(e).then(n=>i(n)),this.setBleedValue=async(e,t,n)=>{const r=n?{left:n===Q.left?t:void 0,top:n===Q.top?t:void 0,right:n===Q.right?t:void 0,bottom:n===Q.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,f)).updateLayoutBleed(e,JSON.stringify(r)).then(d=>i(d))},this.setAreBleedValuesCombined=async(e,t)=>{const n={areBleedValuesCombined:t};return(await a(this,f)).updateLayoutBleed(e,JSON.stringify(n)).then(h=>i(h))},this.resetBleedValues=async e=>(await a(this,f)).updateLayoutBleed(e,null).then(n=>i(n)),this.setPrivateData=async(e,t)=>(await a(this,f)).setLayoutPrivateData(e,JSON.stringify(t)).then(r=>i(r)),this.getPrivateData=async e=>(await a(this,f)).getLayoutPrivateData(e).then(n=>i(n)),this.setDisplayName=async(e,t)=>(await a(this,f)).setLayoutDisplayName(e,t).then(r=>i(r)),this.getDisplayName=async e=>(await a(this,f)).getLayoutDisplayName(e).then(n=>i(n)),this.resetDisplayName=async e=>(await a(this,f)).setLayoutDisplayName(e,null).then(n=>i(n)),this.setAvailableForUser=async(e,t)=>(await a(this,f)).setLayoutAvailableForUser(e,t).then(r=>i(r)),this.setSelectedByUser=async(e,t)=>(await a(this,f)).setLayoutSelectedByUser(e,t).then(r=>i(r)),this.setResizableByUser=async(e,t)=>(await a(this,f)).setLayoutResizableByUser(e,JSON.stringify(t)).then(r=>i(r)),y(this,f,o),y(this,Zt,o)}}f=new WeakMap,Zt=new WeakMap;var ue=(s=>(s.thumbnail="thumbnail",s.mediumres="mediumres",s.highres="highres",s.original="original",s))(ue||{}),ve=(s=>(s.web="web",s.print="print",s.animation="animation",s))(ve||{});class _s{constructor(o){g(this,st);g(this,Qt);this.query=async(e,t,n={})=>(await a(this,st)).mediaConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(h=>i(h)),this.detail=async(e,t,n={})=>(await a(this,st)).mediaConnectorDetail(e,t,JSON.stringify(n)).then(h=>i(h)),this.download=async(e,t,n,r={})=>{const h=this.parseDeprecatedMediaDownloadType(n);return(await a(this,Qt)).mediaConnectorDownload(e,t,h,ve.web,JSON.stringify(r)).then(u=>{if(u instanceof Uint8Array)return u;throw typeof u=="object"&&u!==null&&"success"in u&&!u.success&&mt(u),new Error(`Unexpected response type: ${typeof u}.`)})},this.getConfigurationOptions=async e=>(await a(this,st)).mediaConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,st)).mediaConnectorGetCapabilities(e).then(n=>i(n)),this.parseDeprecatedMediaType=e=>{if(e===Ot.file)return Dt.file;if(e===Ot.collection)return Dt.collection},this.upload=async(e,t,n={})=>(await a(this,st)).mediaConnectorUpload(e,JSON.stringify(t),JSON.stringify(n)).then(h=>i(h)),y(this,st,o),y(this,Qt,o)}parseDeprecatedMediaDownloadType(o){switch(o){case ce.HighResolutionWeb:return ue.highres;case ce.LowResolutionWeb:return ue.thumbnail;default:return o}}}st=new WeakMap,Qt=new WeakMap;let Hs=(jn=class{constructor(o){g(this,R);g(this,Xt);this.add=async()=>(await a(this,R)).addPage().then(t=>i(t)),this.remove=async e=>(await a(this,R)).removePage(e).then(n=>i(n)),this.select=async e=>(await a(this,R)).selectPage(e).then(n=>i(n)),this.setVisibility=async(e,t)=>(await a(this,R)).setPageIsVisible(e,t).then(r=>i(r)),this.duplicate=async e=>(await a(this,R)).duplicatePage(e).then(n=>i(n)),this.getAll=async()=>(await a(this,R)).getPages().then(t=>i(t)),this.getById=async e=>(await a(this,R)).getPageById(e).then(n=>i(n)),this.getSnapshot=async(e,t)=>(await a(this,Xt)).getPageSnapshotWithSettings(e,t==null?null:JSON.stringify(t)).then(r=>{if(r instanceof Uint8Array)return r;throw typeof r=="object"&&r!==null&&"success"in r&&!r.success&&mt(r),new Error(`Unexpected response type: ${typeof r}.`)}),this.setWidth=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,R)).setPageWidth(t).then(r=>i(r))),this.setHeight=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,R)).setPageHeight(t).then(r=>i(r))),this.setSize=async(e,t)=>(await a(this,R)).setPageSize(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,R)).reorderPages(e,t).then(r=>i(r)),y(this,R,o),y(this,Xt,o)}},R=new WeakMap,Xt=new WeakMap,jn);class xs{constructor(o){g(this,$);this.getAll=async()=>(await a(this,$)).getParagraphStyles().then(t=>i(t)),this.getById=async e=>(await a(this,$)).getParagraphStyleById(e).then(n=>i(n)),this.create=async()=>(await a(this,$)).createParagraphStyle().then(t=>i(t)),this.duplicate=async e=>(await a(this,$)).duplicateParagraphStyle(e).then(n=>i(n)),this.update=async(e,t)=>(await a(this,$)).updateParagraphStyle(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,$)).renameParagraphStyle(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,$)).removeParagraphStyle(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,$)).moveParagraphStyles(e,t).then(r=>i(r)),y(this,$,o)}}$=new WeakMap;var Wt=(s=>(s.shortText="shortText",s.longText="longText",s.richText="richText",s.image="image",s.list="list",s.boolean="boolean",s.group="group",s.number="number",s.date="date",s.dataSource="dataSource",s))(Wt||{}),$s=(s=>(s.Monday="monday",s.Tuesday="tuesday",s.Wednesday="wednesday",s.Thursday="thursday",s.Friday="friday",s.Saturday="saturday",s.Sunday="sunday",s))($s||{}),js=(s=>(s.en_US="en_US",s.cs="cs",s.da="da",s.nl="nl",s.fi="fi",s.fr="fr",s.de="de",s.it="it",s.no="no",s.pl="pl",s.pt_PT="pt_PT",s.es_ES="es_ES",s.sv="sv",s))(js||{}),Lt=(s=>(s.visible="visible",s.invisible="invisible",s.conditional="conditional",s))(Lt||{}),zs=(s=>(s.boolean="boolean",s.text="text",s.number="number",s))(zs||{}),Ws=(s=>(s.equals="=",s.notEquals="!=",s.greaterThan=">",s.greaterThanOrEquals=">=",s.lessThan="<",s.lessThanOrEquals="<=",s))(Ws||{}),Ae=(s=>(s.injected="injected",s.connector="connector",s))(Ae||{}),Ks=(s=>(s.table="table",s.list="list",s))(Ks||{});let Yr=class{constructor(o,e){this.onActionsChanged=t=>{this.config.events.onActionsChanged.trigger(JSON.parse(t))},this.onAnimationChanged=t=>{this.config.events.onFrameAnimationsChanged.trigger(JSON.parse(t))},this.onAnimationPlaybackChanged=t=>{this.config.events.onScrubberPositionChanged.trigger(JSON.parse(t))},this.onSelectedLayoutPropertiesChanged=t=>{this.config.events.onSelectedLayoutPropertiesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutUnitChanged=t=>{this.config.events.onSelectedLayoutUnitChanged.trigger(t)},this.onFramesLayoutChanged=t=>{const n=JSON.parse(t);this.config.events.onFramesLayoutChanged.trigger(n)},this.onSelectedFramesLayoutChanged=t=>{const n=JSON.parse(t);this.config.events.onSelectedFramesLayoutChanged.trigger(n);const r=this.config.onSelectedFrameLayoutChanged;r&&r(n.length>1?void 0:n[0])},this.onSelectedFramesContentChanged=t=>{const n=JSON.parse(t);this.config.events.onSelectedFramesContentChanged.trigger(n);const r=this.config.onSelectedFrameContentChanged;r&&r(n.length>1?null:n[0])},this.onStateChanged=()=>{this.config.events.onStateChanged.trigger()},this.onAuthExpired=async t=>{const n=await this.config.handlers.onAuthExpired.trigger(JSON.parse(t));return n!=null?JSON.stringify(n):null},this.onViewportRequested=()=>{const t=this.config.handlers.onViewportRequested.trigger();return t!=null?JSON.stringify(t):null},this.onDocumentLoaded=()=>{this.config.events.onDocumentLoaded.trigger()},this.onPageSelectionChanged=t=>{this.config.events.onPageSelectionChanged.trigger(t)},this.onVariableListChanged=t=>{const r=JSON.parse(t).map(h=>{var d;return h.type===Wt.list?{...h,items:h.items.map(u=>u.value),selected:(d=h.selected)==null?void 0:d.value}:h});this.config.events.onVariableListChanged.trigger(r)},this.onSelectedToolChanged=t=>{this.config.events.onSelectedToolChanged.trigger(t)},this.onUndoStateChanged=t=>{this.config.events.onUndoStackStateChanged.trigger(JSON.parse(t))},this.onCustomUndoDataChanged=t=>{this.config.events.onCustomUndoDataChanged.trigger(JSON.parse(t))},this.onSelectedLayoutFramesChanged=t=>{this.config.events.onSelectedLayoutFramesChanged.trigger(JSON.parse(t))},this.onSelectedTextStyleChanged=t=>{this.config.events.onSelectedTextStyleChanged.trigger(JSON.parse(t))},this.onColorsChanged=t=>{this.config.events.onColorsChanged.trigger(JSON.parse(t))},this.onParagraphStylesChanged=t=>{this.config.events.onParagraphStylesChanged.trigger(JSON.parse(t))},this.onCharacterStylesChanged=t=>{this.config.events.onCharacterStylesChanged.trigger(JSON.parse(t))},this.onFontFamiliesChanged=t=>{this.config.events.onFontFamiliesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutIdChanged=t=>{this.config.events.onSelectedLayoutIdChanged.trigger(t)},this.onLayoutsChanged=t=>{this.config.events.onLayoutsChanged.trigger(JSON.parse(t))},this.onZoomChanged=t=>{this.config.events.onZoomChanged.trigger(JSON.parse(t))},this.onConnectorEvent=t=>{this.config.events.onConnectorEvent.trigger(JSON.parse(t))},this.onConnectorsChanged=t=>{const r=new le().makeMultipleConnectorsBackwardsCompatible(JSON.parse(t),this.localConfig.get(Z.GraFxStudioEnvironmentApiUrl));this.config.events.onConnectorsChanged.trigger(r)},this.onSelectedPageIdChanged=t=>{this.config.events.onSelectedPageIdChanged.trigger(t)},this.onPagesChanged=t=>{this.config.events.onPagesChanged.trigger(JSON.parse(t))},this.onPageSnapshotInvalidated=t=>{this.config.events.onPageSnapshotInvalidated.trigger(t)},this.onPageSizeChanged=t=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(t))},this.onShapeCornerRadiusChanged=t=>{this.config.events.onShapeCornerRadiusChanged.trigger(JSON.parse(t))},this.onCropActiveFrameIdChanged=t=>{this.config.events.onCropActiveFrameIdChanged.trigger(t)},this.onAsyncError=t=>{const n=JSON.parse(t);if((n==null?void 0:n.type)==="dataRow"){const r=new Be(n.count,n.message,n.exceptions);this.config.events.onAsyncError.trigger(r)}else if((n==null?void 0:n.type)==="action"){const r=new ke(n.message,n.id,n.event,n.eventChain);this.config.events.onAsyncError.trigger(r)}else this.config.events.onAsyncError.trigger(n)},this.onViewModeChanged=t=>{this.config.events.onViewModeChanged.trigger(t)},this.onBarcodeValidationChanged=t=>{this.config.events.onBarcodeValidationChanged.trigger(JSON.parse(t))},this.onDataSourceIdChanged=t=>{this.config.events.onDataSourceIdChanged.trigger(t)},this.onInjectedDataChanged=t=>{this.config.events.onInjectedDataChanged.trigger(t)},this.onDocumentIssueListChanged=t=>{this.config.events.onDocumentIssueListChanged.trigger(JSON.parse(t))},this.onEngineEditModeChanged=t=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(t))},this.onBrandKitMediaChanged=t=>{this.config.events.onBrandKitMediaChanged.trigger(JSON.parse(t))},this.config=o,this.localConfig=e}};class qs{constructor(o){g(this,It);this.set=async e=>(await a(this,It)).selectedTextStyleDeltaUpdate(JSON.stringify(e)).then(n=>i(n)),this.removeSelected=async()=>(await a(this,It)).selectedTextStyleClean().then(t=>i(t)),this.getSelected=async()=>(await a(this,It)).getSelectedTextStyle().then(t=>i(t)),y(this,It,o)}}It=new WeakMap;var Ys=(s=>(s.FRAME_X="frameX",s.FRAME_Y="frameY",s.WIDTH="width",s.HEIGHT="height",s.FRAME_ROTATION="frameRotation",s))(Ys||{}),Zs=(s=>(s.LAYOUT_HEIGHT="layoutHeight",s.LAYOUT_WIDTH="layoutWidth",s.BLEED_TOP="bleedTop",s.BLEED_BOTTOM="bleedBottom",s.BLEED_LEFT="bleedLeft",s.BLEED_RIGHT="bleedRight",s.BLEED_VALUES_COMBINED="areBleedValuesCombined",s))(Zs||{}),G=(s=>(s.SELECT="select",s.ZOOM="zoom",s.HAND="hand",s.IMAGE_FRAME="imageFrame",s.TEXT_FRAME="textFrame",s.SHAPE_RECT="rect",s.SHAPE_ELLIPSE="ellipse",s.SHAPE_POLYGON="polygon",s.COMPONENT_GRID_FRAME="componentGridFrame",s))(G||{}),Qs=(s=>(s.MP4="mp4",s.GIF="gif",s.PNG="png",s.JPG="jpg",s.PDF="pdf",s.HTML="html",s))(Qs||{}),ge=(s=>(s.SANDBOX="sandbox",s.PRODUCTION="online",s))(ge||{});class Xs{constructor(o){g(this,kt);this.setTool=async e=>(await a(this,kt)).setTool(e).then(n=>i(n)),this.getSelected=async()=>(await a(this,kt)).getSelectedTool().then(t=>i(t)),this.setPointer=async()=>this.setTool(G.SELECT),this.setSelect=async()=>this.setTool(G.SELECT),this.setHand=async()=>this.setTool(G.HAND),this.setZoom=async()=>this.setTool(G.ZOOM),this.setTextFrame=async()=>this.setTool(G.TEXT_FRAME),this.setImageFrame=async()=>this.setTool(G.IMAGE_FRAME),this.setShapeRect=async()=>this.setTool(G.SHAPE_RECT),this.setShapeEllipse=async()=>this.setTool(G.SHAPE_ELLIPSE),this.setShapePolygon=async()=>this.setTool(G.SHAPE_POLYGON),this.setComponentGrid=async()=>this.setTool(G.COMPONENT_GRID_FRAME),y(this,kt,o)}}kt=new WeakMap;class tn{constructor(o,e){g(this,X);g(this,q);g(this,te);this.undo=async()=>(await a(this,X)).undo().then(n=>i(n)),this.redo=async()=>(await a(this,X)).redo().then(n=>i(n)),this.addCustomData=async(t,n)=>(await a(this,X)).setCustomUndoData(t,n,!1).then(h=>i(h)),this.record=async(t,n)=>{try{await a(this,q).beginIfNoneActive(t),await n(a(this,te)),await a(this,q).end()}catch(r){throw await a(this,q).abort(),r}},this.pause=async()=>(await a(this,X)).pause().then(n=>i(n)),this.resume=async()=>(await a(this,X)).resume().then(n=>i(n)),this.clear=async()=>(await a(this,X)).clear().then(n=>i(n)),this.advanced={begin:async t=>a(this,q).begin(t),beginIfNoneActive:async t=>a(this,q).beginIfNoneActive(t),end:async()=>a(this,q).end(),abort:async()=>a(this,q).abort()},y(this,X,o),y(this,te,e),y(this,q,new Zr(o))}}X=new WeakMap,q=new WeakMap,te=new WeakMap;class Zr{constructor(o){g(this,ut);this.begin=async e=>(await a(this,ut)).begin(e).then(n=>i(n)),this.beginIfNoneActive=async e=>(await a(this,ut)).beginIfNoneActive(e).then(n=>i(n)),this.end=async()=>(await a(this,ut)).end().then(t=>i(t)),this.abort=async()=>(await a(this,ut)).abort().then(t=>i(t)),y(this,ut,o)}}ut=new WeakMap;var B=(s=>(s.info="info",s.warn="warn",s.error="error",s))(B||{}),ye=(s=>(s.general="general",s.connector="connector",s.event="event",s.engine="engine",s.sdk="sdk",s))(ye||{}),Nt=(s=>(s.throw="throw",s.log="log",s))(Nt||{});class en extends Error{constructor(o){super(o)}}const Qr=(s,o=2)=>{const e=Math.pow(10,o);return Math.round(s*e)/e};class sn{constructor(o,e){g(this,ee);g(this,Bt);this.round=(t,n)=>i({data:String(Qr(t,n)),success:!0,status:200,parsedData:null}),this.createEnvironmentBaseURL=t=>{const{type:n=ge.SANDBOX,environment:r="ft-nostress",version:h="1"}=t,d=n==ge.SANDBOX?"chili-publish-sandbox":"chili-publish";return`https://${r}.${d}.online/grafx/api/v${h}/environment/${r}`},this.stageFiles=async(t,n,r)=>{const h=a(this,Bt).get(Z.GraFxStudioEnvironmentApiUrl);if(!h)throw new Error("GraFx Studio Environment API URL is not set");const d=`${h}connectors/${n}/stage`,u=a(this,Bt).get(Z.GraFxStudioAuthToken);if(!u)throw new Error("GraFx Studio Auth Token is not set");const m=new FormData;t.forEach((b,v)=>{const O=b instanceof File?b.name:`blob-${v}`;m.append("files",b,O)}),r&&m.append("validationJson",JSON.stringify({allowedMimeTypes:r.mimeTypes,minDimensions:{width:r.minWidthPixels,height:r.minHeightPixels}}));const p=await fetch(d,{method:"POST",body:m,headers:{Authorization:`Bearer ${u}`}});if(p.status===422){const b=await p.json();throw new ls(b.message,Se.minDimension)}if(p.status===401){const b=await p.json();throw new en(b.message)}if(!p.ok)throw new Error("Failed to stage files");return await p.json()},this.unitEvaluate=async(t,n)=>(await a(this,ee)).unitEvaluate(t,n).then(h=>i(h)),y(this,ee,o),y(this,Bt,e)}}ee=new WeakMap,Bt=new WeakMap;const Xr=s=>s.type===Wt.dataSource,ta=s=>{var o;return s?Xr(s)&&((o=s==null?void 0:s.value)==null?void 0:o.type)===Ae.injected:!1};class ea{constructor(o){g(this,se);this.setMinimum=async(e,t)=>{const n={minValue:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setMaximum=async(e,t)=>{const n={maxValue:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setShowStepper=async(e,t)=>{const n={showStepper:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setStepSize=async(e,t)=>{const n={stepSize:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setThousandsSeparator=async(e,t)=>{const n={thousandsSeparator:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setDecimalSeparator=async(e,t)=>{const n={decimalSeparator:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setDecimalCharacterStyle=async(e,t)=>{const n={decimalCharacterStyleId:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setNumberOfDecimals=async(e,t)=>{const n={numberOfDecimals:{value:t}};return this.applyPropertiesUpdate(e,n)},y(this,se,o)}async applyPropertiesUpdate(o,e){const n=await(await a(this,se)).updateNumberVariableProperties(o,JSON.stringify(e));return i(n)}}se=new WeakMap;class sa{constructor(o){g(this,ne);this.setDisplayFormat=async(e,t)=>{const n={displayFormat:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setLocale=async(e,t)=>{const n={locale:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setStartDate=async(e,t)=>{const n={startDate:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setEndDate=async(e,t)=>{const n={endDate:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setExcludedDays=async(e,t)=>{const n={excludedDays:{value:t}};return this.applyPropertiesUpdate(e,n)},y(this,ne,o)}async applyPropertiesUpdate(o,e){const n=await(await a(this,ne)).updateDateVariableProperties(o,JSON.stringify(e));return i(n)}}ne=new WeakMap;class na{constructor(o,e){g(this,j);g(this,Jt);this.setValue=async(t,n)=>{const r=await a(this,j);let h;return Array.isArray(n)?h=n.map(d=>a(this,Jt).mapDataItemToEngine(d)):h=n,r.setVariableValue(t,h).then(d=>i(d))},this.getInjectedData=async t=>(await a(this,j)).getInjectedDataSourceVariableData(t).then(r=>i(r)).then(r=>{const h={...r,parsedData:null};return r.parsedData&&(h.parsedData={...r.parsedData,data:r.parsedData.data.map(d=>a(this,Jt).mapEngineToDataItem(d))}),h}),this.getInjectedItemById=async(t,n)=>{var p;const h=await(await a(this,j)).getVariableById(t).then(S=>i(S));ta(h.parsedData)||mt({status:400,error:"Variable is not an injected data source variable"});const d=h.parsedData.value.itemIdPropertyName,m=(p=(await this.getInjectedData(t)).parsedData)==null?void 0:p.data.find(S=>{var b;return((b=S[d])==null?void 0:b.toString())===n.toString()});return m||mt({status:404,error:`Item not found in injected data for variable ${t}`}),{success:!0,status:200,parsedData:{data:m,continuationToken:null,previousPageToken:null}}},this.setInjectedModel=async(t,n)=>{const r=n.properties,h=n.itemIdPropertyName;return(await a(this,j)).setInjectedDataSourceVariableModel(t,JSON.stringify(r),h).then(u=>i(u))},this.setSourceType=async(t,n)=>(await a(this,j)).setDataSourceVariableSourceType(t,n).then(h=>i(h)),this.setConnector=async(t,n)=>{const r=await a(this,j),d=new le().makeConnectorSourceForwardsCompatible(n);return r.setDataSourceVariableConnector(t,JSON.stringify(d)).then(u=>i(u))},this.removeConnector=async t=>(await a(this,j)).setDataSourceVariableConnector(t,null).then(r=>i(r)),y(this,j,o),y(this,Jt,e)}async setDisplayOptions(o,e,t){return(await a(this,j)).setDataSourceVariableDisplayOptions(o,e,t??void 0).then(r=>i(r))}}j=new WeakMap,Jt=new WeakMap;let nn=(zn=class{constructor(o,e){g(this,w);g(this,Ut);g(this,Gt);this.getAll=async()=>(await a(this,w)).getVariables().then(n=>i(n)).then(n=>{const r=n;return r.parsedData&&(r.parsedData=this.makeVariablesBackwardsCompatible(r.parsedData)),r}),this.getById=async t=>(await a(this,w)).getVariableById(t).then(r=>i(r)).then(r=>{const h=r;return h.parsedData&&(h.parsedData=this.makeVariableBackwardsCompatible(h.parsedData)),h}),this.getByName=async t=>(await a(this,w)).getVariableByName(t).then(r=>i(r)).then(r=>{const h=r;return h.parsedData&&(h.parsedData=this.makeVariableBackwardsCompatible(h.parsedData)),h}),this.create=async(t,n)=>(await a(this,w)).addVariable(t,n).then(h=>i(h)),this.remove=async t=>(await a(this,w)).removeVariables(t).then(r=>i(r)),this.rename=async(t,n)=>(await a(this,w)).setVariableName(t,n).then(h=>i(h)),this.setLabel=async(t,n)=>(await a(this,w)).setVariableLabel(t,n).then(h=>i(h)),y(this,Ut,async(t,n)=>(await a(this,w)).setVariablePlaceholder(t,n).then(h=>i(h))),this.setPlaceholder=async(t,n)=>a(this,Ut).call(this,t,n),this.resetPlaceholder=async t=>a(this,Ut).call(this,t,null),y(this,Gt,async(t,n)=>(await a(this,w)).setVariableHelpText(t,n).then(h=>i(h))),this.setHelpText=async(t,n)=>a(this,Gt).call(this,t,n),this.resetHelpText=async t=>a(this,Gt).call(this,t,null),this.setType=async(t,n)=>(await a(this,w)).setVariableType(t,n).then(h=>i(h)),this.setRuleSetId=async(t,n)=>(await a(this,w)).setVariableRuleSetId(t,n).then(h=>i(h)),this.setListVariable=async(t,n)=>(await a(this,w)).setListVariableItems(t,n.map(h=>JSON.stringify({value:h}))).then(h=>i(h)),this.setValue=async(t,n)=>(await a(this,w)).setVariableValue(t,n).then(h=>i(h,d=>Ur(d,{id:t}))),this.duplicate=async t=>(await a(this,w)).duplicateVariable(t).then(r=>i(r)),this.groupVariables=async(t,n)=>(await a(this,w)).groupVariables(t,n).then(h=>i(h)),this.ungroupVariables=async t=>(await a(this,w)).ungroupVariable(t).then(r=>i(r)),this.move=async(t,n,r)=>(await a(this,w)).moveVariable(n,r,t).then(d=>i(d)),this.moveVariables=async(t,n,r)=>(await a(this,w)).moveVariables(n,r,t).then(d=>i(d)),this.setIsVisible=async(t,n)=>{const r=n?{type:Lt.visible}:{type:Lt.invisible};return this.setVariableVisibility(t,r)},this.setIsHidden=async(t,n)=>{const r=n?{type:Lt.invisible}:{type:Lt.visible};return this.setVariableVisibility(t,r)},this.setVariableVisibility=async(t,n)=>(await a(this,w)).setVariableVisibility(t,JSON.stringify(n)).then(h=>i(h)),this.setLayoutsForVariableVisibility=async t=>(await a(this,w)).setLayoutsForVariableVisibility(t?JSON.stringify(t):null).then(r=>i(r)),this.setIsRequired=async(t,n)=>(await a(this,w)).setVariableIsRequired(t,n).then(h=>i(h)),this.setRemoveParagraphIfEmpty=async(t,n)=>(await a(this,w)).setVariableRemoveParagraphIfEmpty(t,n).then(h=>i(h)),this.setVariableCharacterLimit=async(t,n)=>(await a(this,w)).setVariableCharacterLimit(t,n).then(h=>i(h)),this.setIsReadonly=async(t,n)=>(await a(this,w)).setVariableIsReadonly(t,n).then(h=>i(h)),this.getImageVariableConnectorId=async t=>(await a(this,w)).getImageVariableConnectorId(t).then(r=>i(r)),this.setImageVariableConnector=async(t,n)=>{const r=await a(this,w),d=new le().makeConnectorSourceForwardsCompatible(n);return r.setImageVariableConnector(t,JSON.stringify(d)).then(u=>i(u))},this.setImageVariableValueWithContext=async(t,n,r)=>(await a(this,w)).setImageVariableValueWithContext(t,n,JSON.stringify(r)).then(d=>i(d)),this.removeSource=async t=>this.setValue(t,null),this.setPrefix=async(t,n)=>{const r={prefix:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffix=async(t,n)=>{const r={suffix:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrefixCharacterStyle=async(t,n)=>{const r={prefixCharacterStyleId:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffixCharacterStyle=async(t,n)=>{const r={suffixCharacterStyleId:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrivateData=async(t,n)=>(await a(this,w)).setVariablePrivateData(t,JSON.stringify(n)).then(h=>i(h)),this.getPrivateData=async t=>(await a(this,w)).getVariablePrivateData(t).then(r=>i(r)),this.setAllowImageQuery=async(t,n)=>(await a(this,w)).setImageVariableAllowQuery(t,n).then(h=>i(h)),this.setAllowImageUpload=async(t,n)=>(await a(this,w)).setImageVariableAllowUpload(t,n).then(h=>i(h)),this.setMinImageUploadSize=async(t,n,r)=>(await a(this,w)).setImageVariableUploadMinSize(t,n,r).then(d=>i(d)),this.setIsDontBreak=async(t,n)=>(await a(this,w)).setVariableIsDontBreak(t,n).then(h=>i(h)),this.highlightUsages=async t=>(await a(this,w)).highlightVariableUsages(t).then(r=>i(r)),this.setRichTextRules=async t=>(await a(this,w)).setRichTextRulesets(JSON.stringify(t)).then(r=>i(r)),y(this,w,o),this.number=new ea(a(this,w)),this.date=new sa(a(this,w)),this.dataSource=new na(a(this,w),e)}makeVariablesBackwardsCompatible(o){return o.map(e=>this.makeVariableBackwardsCompatible(e))}makeVariableBackwardsCompatible(o){return o.type!==Wt.list?o:this.makeListVariableBackwardsCompatible(o)}makeListVariableBackwardsCompatible(o){const e=o,t=o.items,n=o.selected,r=t.map(h=>h.value);return e.items=r,e.selected=n==null?void 0:n.value,e}async applyPrefixSuffixDeltaUpdate(o,e){const n=await(await a(this,w)).updateVariablePrefixSuffixProperties(o,JSON.stringify(e));return i(n)}},w=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,zn);class ra{constructor(o){this.onVariableListChanged=e=>{this.config.events.onVariableListChanged.trigger(JSON.parse(e))},this.onConnectorsChanged=e=>{this.config.events.onConnectorsChanged.trigger(JSON.parse(e))},this.onPageSizeChanged=e=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(e))},this.onEngineEditModeChanged=e=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(e))},this.config=o}}class aa{constructor(o){g(this,gt);this.getAll=async()=>(await a(this,gt)).getVariables().then(t=>i(t)),this.getById=async e=>(await a(this,gt)).getVariableById(e).then(n=>i(n)),this.getByName=async e=>(await a(this,gt)).getVariableByName(e).then(n=>i(n)),this.setListVariable=async(e,t)=>(await a(this,gt)).setListVariableItems(e,t.map(r=>JSON.stringify(r))).then(r=>i(r)),y(this,gt,o),this.image=new ia(o),this.dataSource=new oa(o)}}gt=new WeakMap;class ia{constructor(o){g(this,nt);this.setAllowQuery=async(e,t)=>(await a(this,nt)).setImageVariableAllowQuery(e,t).then(r=>i(r)),this.setAllowUpload=async(e,t)=>(await a(this,nt)).setImageVariableAllowUpload(e,t).then(r=>i(r)),this.setMinUploadSize=async(e,t,n)=>(await a(this,nt)).setImageVariableUploadMinSize(e,t,n).then(h=>i(h)),this.setConnector=async(e,t)=>(await a(this,nt)).setImageVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),this.setConnectorContext=async(e,t)=>(await a(this,nt)).setImageVariableConnectorContext(e,JSON.stringify(t)).then(r=>i(r)),y(this,nt,o)}}nt=new WeakMap;class oa{constructor(o){g(this,re);this.setConnector=async(e,t)=>(await a(this,re)).setDataSourceVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),y(this,re,o)}}re=new WeakMap;class ha{constructor(o){g(this,vt);this.register=async e=>(await a(this,vt)).registerConnector(JSON.stringify(e)).then(n=>i(n)),this.getById=async e=>(await a(this,vt)).getConnectorById(e).then(n=>i(n)),this.getAllByType=async e=>(await a(this,vt)).getConnectors(e).then(n=>i(n)),y(this,vt,o)}}vt=new WeakMap;class ca{constructor(o){g(this,_t);g(this,pe);this.setWidth=async e=>(await a(this,_t)).setPageWidth(e).then(n=>i(n)),this.setHeight=async e=>(await a(this,_t)).setPageHeight(e).then(n=>i(n)),y(this,_t,o),y(this,pe,o)}}_t=new WeakMap,pe=new WeakMap;class rn{constructor(o,e,t){this.config=o,this.connection=e,this.editorAPI=t,this.subscriber=new ra(o),this.variable=new aa(this.editorAPI),this.connector=new ha(this.editorAPI),this.page=new ca(this.editorAPI),this.canvas=new fe(this.editorAPI)}}class Pe{constructor(o){this.logger=o}getLogCategory(){return ye.event}createEventHandlerFn(o,e){return(...n)=>{try{const r=o(...n);return r instanceof Promise?r.catch(h=>this.handleError(h,e,o.name)):r}catch(r){this.handleError(r,e,o.name)}}}handleError(o,e,t){var n;if(e===Nt.log)(n=this.logger)==null||n.call(this,B.error,this.getLogCategory(),`Error in callback ${t}: ${o}`);else throw o}}class an extends Pe{constructor(o,e){super(e),this.handler=o}trigger(...o){const e=this.handler();if(e)return this.createEventHandlerFn(e,Nt.throw)(...o)}}class C extends Pe{constructor(o,e){super(e),this.legacyHandler=o,this.subscriptions=new Set}trigger(...o){const e=this.legacyHandler();e&&this.createEventHandlerFn(e,Nt.log)(...o);for(const t of this.subscriptions)t(...o)}registerCallback(o,e=Nt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class Ee{static createRuntimeConfig(o){var t,n,r,h,d,u,m,p,S,b,v,O,A,L,D,M,I,U,rt,xt,$t,Wn,Kn,qn,Yn,Zn,Qn,Xn,tr,er,sr,nr,rr,ar,ir;const e={...o};return e.logging={logLevel:((t=o.logging)==null?void 0:t.logLevel)||B.error,logger:((n=o.logging)==null?void 0:n.logger)||((ie,Oe,De)=>{var or;if(Ee.isLoggingEnabled(ie,((or=e.logging)==null?void 0:or.logLevel)??B.error))switch(ie){case B.error:console.error(`[${Oe}] [${ie}] ${De}`);break;case B.warn:console.warn(`[${Oe}] [${ie}] ${De}`);break;default:console.log(`[${Oe}] [${ie}] ${De}`)}})},e.handlers={onAuthExpired:new an(()=>e.onAuthExpired,(r=e.logging)==null?void 0:r.logger),onViewportRequested:new an(()=>e.onViewportRequested,(h=e.logging)==null?void 0:h.logger)},e.events={onActionsChanged:new C(()=>e.onActionsChanged,(d=e.logging)==null?void 0:d.logger),onStateChanged:new C(()=>e.onStateChanged,(u=e.logging)==null?void 0:u.logger),onDocumentLoaded:new C(()=>e.onDocumentLoaded,(m=e.logging)==null?void 0:m.logger),onSelectedFramesLayoutChanged:new C(()=>e.onSelectedFramesLayoutChanged,(p=e.logging)==null?void 0:p.logger),onFramesLayoutChanged:new C(()=>e.onFramesLayoutChanged,(S=e.logging)==null?void 0:S.logger),onSelectedFramesContentChanged:new C(()=>e.onSelectedFramesContentChanged,(b=e.logging)==null?void 0:b.logger),onPageSelectionChanged:new C(()=>e.onPageSelectionChanged,(v=e.logging)==null?void 0:v.logger),onSelectedLayoutPropertiesChanged:new C(()=>e.onSelectedLayoutPropertiesChanged,(O=e.logging)==null?void 0:O.logger),onSelectedLayoutUnitChanged:new C(()=>e.onSelectedLayoutUnitChanged,(A=e.logging)==null?void 0:A.logger),onScrubberPositionChanged:new C(()=>e.onScrubberPositionChanged,(L=e.logging)==null?void 0:L.logger),onFrameAnimationsChanged:new C(()=>e.onFrameAnimationsChanged,(D=e.logging)==null?void 0:D.logger),onVariableListChanged:new C(()=>e.onVariableListChanged,(M=e.logging)==null?void 0:M.logger),onSelectedToolChanged:new C(()=>e.onSelectedToolChanged,(I=e.logging)==null?void 0:I.logger),onUndoStackStateChanged:new C(()=>e.onUndoStackStateChanged,(U=e.logging)==null?void 0:U.logger),onSelectedLayoutFramesChanged:new C(()=>e.onSelectedLayoutFramesChanged,(rt=e.logging)==null?void 0:rt.logger),onSelectedTextStyleChanged:new C(()=>e.onSelectedTextStyleChanged,(xt=e.logging)==null?void 0:xt.logger),onColorsChanged:new C(()=>e.onColorsChanged,($t=e.logging)==null?void 0:$t.logger),onParagraphStylesChanged:new C(()=>e.onParagraphStylesChanged,(Wn=e.logging)==null?void 0:Wn.logger),onCharacterStylesChanged:new C(()=>e.onCharacterStylesChanged,(Kn=e.logging)==null?void 0:Kn.logger),onFontFamiliesChanged:new C(()=>e.onFontFamiliesChanged,(qn=e.logging)==null?void 0:qn.logger),onSelectedLayoutIdChanged:new C(()=>e.onSelectedLayoutIdChanged,(Yn=e.logging)==null?void 0:Yn.logger),onLayoutsChanged:new C(()=>e.onLayoutsChanged,(Zn=e.logging)==null?void 0:Zn.logger),onConnectorEvent:new C(()=>e.onConnectorEvent,(Qn=e.logging)==null?void 0:Qn.logger),onConnectorsChanged:new C(()=>e.onConnectorsChanged,(Xn=e.logging)==null?void 0:Xn.logger),onZoomChanged:new C(()=>e.onZoomChanged,(tr=e.logging)==null?void 0:tr.logger),onSelectedPageIdChanged:new C(()=>e.onSelectedPageIdChanged,e.logging.logger),onPagesChanged:new C(()=>e.onPagesChanged,e.logging.logger),onPageSnapshotInvalidated:new C(()=>e.onPageSnapshotInvalidated,e.logging.logger),onPageSizeChanged:new C(()=>e.onPageSizeChanged,(er=e.logging)==null?void 0:er.logger),onShapeCornerRadiusChanged:new C(()=>e.onShapeCornerRadiusChanged,(sr=e.logging)==null?void 0:sr.logger),onCropActiveFrameIdChanged:new C(()=>e.onCropActiveFrameIdChanged,(nr=e.logging)==null?void 0:nr.logger),onAsyncError:new C(()=>e.onAsyncError,(rr=e.logging)==null?void 0:rr.logger),onViewModeChanged:new C(()=>e.onViewModeChanged,(ar=e.logging)==null?void 0:ar.logger),onBarcodeValidationChanged:new C(()=>e.onBarcodeValidationChanged,(ir=e.logging)==null?void 0:ir.logger),onDataSourceIdChanged:new C(()=>e.onDataSourceIdChanged,e.logging.logger),onInjectedDataChanged:new C(()=>e.onInjectedDataChanged,e.logging.logger),onDocumentIssueListChanged:new C(()=>e.onDocumentIssueListChanged,e.logging.logger),onCustomUndoDataChanged:new C(()=>e.onCustomUndoDataChanged,e.logging.logger),onEngineEditModeChanged:new C(()=>e.onEngineEditModeChanged,e.logging.logger),onBrandKitMediaChanged:new C(()=>e.onBrandKitMediaChanged,e.logging.logger)},e}static isLoggingEnabled(o,e){return e==B.info||e==B.warn&&(o==B.warn||o==B.error)?!0:e==B.error&&o==B.error}}class da{isDatePropertyWrapper(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&"type"in o&&o.type==="date"&&"chiliReservedTag"in o&&o.chiliReservedTag==="date"}isDateObject(o){return o instanceof Date}mapEngineToDataItem(o){const e={};return Object.entries(o).forEach(([t,n])=>{e[t]=this.isDatePropertyWrapper(n)?new Date(n.value):n}),e}mapDataItemToEngine(o){const e={};return Object.entries(o).forEach(([t,n])=>{e[t]=this.isDateObject(n)?{value:n.getTime(),type:"date",chiliReservedTag:"date"}:n}),e}}class la{constructor(o){g(this,yt);y(this,yt,o)}async getValue(o){return(await a(this,yt)).getConfigValue(o).then(t=>i(t))}async setValue(o,e){return(await a(this,yt)).setConfigValue(o,e).then(n=>i(n))}async updateStudioOptions(o){return(await a(this,yt)).updateStudioOptions(JSON.stringify(o)).then(t=>i(t))}async getEngineSessionId(){return(await a(this,yt)).getEngineSessionId().then(e=>i(e))}getLatestSmartCropVersion(){return Kr}}yt=new WeakMap;class on extends la{constructor(e,t){super(e);g(this,Ht);y(this,Ht,t)}async getValue(e){const t=a(this,Ht).get(e);return t!=null?i({status:200,success:!0,parsedData:t,data:t},!1):super.getValue(e)}async setValue(e,t){const n=super.setValue(e,t);return a(this,Ht).set(e,t),n}}Ht=new WeakMap;class hn{constructor(o){g(this,z);this.getAll=async()=>(await a(this,z)).getGradients().then(t=>i(t)),this.getById=async e=>(await a(this,z)).getGradientById(e).then(n=>i(n)),this.create=async()=>(await a(this,z)).createGradient().then(t=>i(t)),this.duplicate=async e=>(await a(this,z)).duplicateGradient(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,z)).moveGradients(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,z)).renameGradient(e,t).then(r=>i(r)),this.update=async(e,t)=>{const n=await a(this,z),r=t;return n.updateGradient(e,JSON.stringify(r)).then(h=>i(h))},this.remove=async e=>(await a(this,z)).removeGradient(e).then(n=>i(n)),y(this,z,o)}}z=new WeakMap;class cn{constructor(o){g(this,At);g(this,ae);this.query=async(e,t,n={})=>(await a(this,At)).componentConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(h=>i(h)),this.preview=async(e,t,n,r={})=>(await a(this,ae)).componentConnectorPreview(e,t,n,JSON.stringify(r)).then(d=>{if(d instanceof Uint8Array)return d;throw typeof d=="object"&&d!==null&&"success"in d&&!d.success&&mt(d),new Error(`Unexpected response type: ${typeof d}.`)}),this.getConfigurationOptions=async e=>(await a(this,At)).componentConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,At)).componentConnectorGetCapabilities(e).then(n=>i(n)),y(this,At,o),y(this,ae,o)}}At=new WeakMap,ae=new WeakMap;class dn{constructor(o){g(this,Pt);this.linkVariable=async(e,t,n,r)=>(await a(this,Pt)).linkComponentVariable(e,t,n,r??null).then(d=>i(d)),this.getComponentVariables=async e=>(await a(this,Pt)).getComponentVariables(e).then(n=>i(n)),this.setFitMode=async(e,t)=>(await a(this,Pt)).setComponentLayoutFit(e,t).then(r=>i(r)),y(this,Pt,o)}}Pt=new WeakMap;class ln{constructor(o){g(this,tt);this.updateSettings=async(e,t)=>(await a(this,tt)).updateComponentGridSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setMapping=async(e,t,n,r,h)=>(await a(this,tt)).setComponentGridMapping(e,t,n,r,h).then(u=>i(u)),this.resetSettings=async e=>(await a(this,tt)).resetComponentGridSettings(e).then(n=>i(n)),this.setComponentSource=async(e,t)=>(await a(this,tt)).setComponentGridComponentSource(e,t?JSON.stringify(t):null).then(r=>i(r)),this.setDataSourceVariable=async(e,t)=>(await a(this,tt)).setComponentGridDataSourceVariable(e,t).then(r=>i(r)),this.setResizeMode=async(e,t)=>(await a(this,tt)).setComponentGridResizeMode(e,t).then(r=>i(r)),y(this,tt,o)}}tt=new WeakMap;const ua=()=>{};class ga{constructor(){this.listeners=new Map}add(o,e){if(typeof e!="function")return ua;const t=this.listeners.get(o)??new Set;return t.add(e),this.listeners.set(o,t),()=>{this.remove(o,e)}}remove(o,e){const t=this.listeners.get(o);t&&(t.delete(e),t.size===0&&this.listeners.delete(o))}getListeners(o){return[...this.listeners.get(o)??[]]}}const ya=s=>!s||typeof s!="object"?!1:typeof s.then=="function",pa=s=>!(!s||typeof s!="object"||Array.isArray(s)),un=(s,o,e)=>{e==null||e(B.error,ye.sdk,`Error in method listener for ${s}: ${String(o)}`)},Kt=(s,o,e,t,n)=>{for(const r of e.getListeners(s))try{r(o)}catch(h){un(s,h,n)}try{o.phase==="invoke"?t.onMethodInvoked.trigger(o):t.onMethodCompleted.trigger(o)}catch(r){un(s,r,n)}};function gn(s,o,e,t,n){const r=new Map,h=new Map;return new Proxy(s,{get(d,u,m){const p=Reflect.get(d,u,m);if(typeof u=="symbol")return p;if(typeof p=="function"){if(r.has(u))return r.get(u);const S=`${o}.${String(u)}`,b=o.split(".")[0]||o,v=String(u),O=((...A)=>{const L={phase:"invoke",path:S,controller:b,method:v,args:[...A]};Kt(S,L,e,t,n);try{const D=p.apply(d,A);if(ya(D))return D.then(I=>{const U={phase:"complete",path:S,controller:b,method:v,args:[...A],success:!0,result:I};return Kt(S,U,e,t,n),I}).catch(I=>{const U={phase:"complete",path:S,controller:b,method:v,args:[...A],success:!1,error:I};throw Kt(S,U,e,t,n),I});const M={phase:"complete",path:S,controller:b,method:v,args:[...A],success:!0,result:D};return Kt(S,M,e,t,n),D}catch(D){const M={phase:"complete",path:S,controller:b,method:v,args:[...A],success:!1,error:D};throw Kt(S,M,e,t,n),D}});return O.addEventListener=A=>e.add(S,A),O.removeEventListener=A=>{e.remove(S,A)},r.set(u,O),O}if(pa(p)){if(h.has(u))return h.get(u);const S=`${o}.${String(u)}`,b=gn(p,S,e,t,n);return h.set(u,b),b}return p}})}class yn extends Pe{constructor(o){super(o),this.subscriptions=new Set}getLogCategory(){return ye.sdk}trigger(...o){const e=Array.from(this.subscriptions);for(const t of e)t(...o)}registerCallback(o,e=Nt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class ma{constructor(o){this.onMethodInvoked=new yn(o),this.onMethodCompleted=new yn(o)}}const wa=`https://studio-cdn.chiligrafx.com/editor/${k.current}/web`;let it;const pn=Symbol("pendingInstrumentation"),Ca=s=>{Object.defineProperty(s,pn,{value:!0,enumerable:!1,configurable:!0})},fa=s=>typeof s=="object"&&s!==null&&s[pn]===!0;class Sa{constructor(o){var e;this.localConfig=new Map,this.dataItemMappingTools=new da,this.methodListeners=new ga,this.loadEditor=()=>{var t;Vr(this.config.editorLink||wa,{onActionsChanged:this.subscriber.onActionsChanged,onStateChanged:this.subscriber.onStateChanged,onAuthExpired:this.subscriber.onAuthExpired,onViewportRequested:this.subscriber.onViewportRequested,onDocumentLoaded:this.subscriber.onDocumentLoaded,onSelectedFramesContentChanged:this.subscriber.onSelectedFramesContentChanged,onSelectedFramesLayoutChanged:this.subscriber.onSelectedFramesLayoutChanged,onFramesLayoutChanged:this.subscriber.onFramesLayoutChanged,onSelectedLayoutPropertiesChanged:this.subscriber.onSelectedLayoutPropertiesChanged,onSelectedLayoutUnitChanged:this.subscriber.onSelectedLayoutUnitChanged,onPageSelectionChanged:this.subscriber.onPageSelectionChanged,onScrubberPositionChanged:this.subscriber.onAnimationPlaybackChanged,onFrameAnimationsChanged:this.subscriber.onAnimationChanged,onVariableListChanged:n=>{var r;(r=this.enabledNextSubscribers)!=null&&r.onVariableListChanged?this.next.subscriber.onVariableListChanged(n):this.subscriber.onVariableListChanged(n)},onSelectedToolChanged:this.subscriber.onSelectedToolChanged,onUndoStateChanged:this.subscriber.onUndoStateChanged,onSelectedLayoutFramesChanged:this.subscriber.onSelectedLayoutFramesChanged,onSelectedTextStyleChanged:this.subscriber.onSelectedTextStyleChanged,onColorsChanged:this.subscriber.onColorsChanged,onParagraphStylesChanged:this.subscriber.onParagraphStylesChanged,onCharacterStylesChanged:this.subscriber.onCharacterStylesChanged,onFontFamiliesChanged:this.subscriber.onFontFamiliesChanged,onSelectedLayoutIdChanged:this.subscriber.onSelectedLayoutIdChanged,onLayoutsChanged:this.subscriber.onLayoutsChanged,onConnectorEvent:this.subscriber.onConnectorEvent,onConnectorsChanged:n=>{var r;(r=this.enabledNextSubscribers)!=null&&r.onConnectorsChanged?this.next.subscriber.onConnectorsChanged(n):this.subscriber.onConnectorsChanged(n)},onZoomChanged:this.subscriber.onZoomChanged,onSelectedPageIdChanged:this.subscriber.onSelectedPageIdChanged,onPagesChanged:this.subscriber.onPagesChanged,onPageSnapshotInvalidated:this.subscriber.onPageSnapshotInvalidated,onPageSizeChanged:n=>{var r;(r=this.enabledNextSubscribers)!=null&&r.onPageSizeChanged?this.next.subscriber.onPageSizeChanged(n):this.subscriber.onPageSizeChanged(n)},onShapeCornerRadiusChanged:this.subscriber.onShapeCornerRadiusChanged,onCropActiveFrameIdChanged:this.subscriber.onCropActiveFrameIdChanged,onAsyncError:this.subscriber.onAsyncError,onViewModeChanged:this.subscriber.onViewModeChanged,onBarcodeValidationChanged:this.subscriber.onBarcodeValidationChanged,onDataSourceIdChanged:this.subscriber.onDataSourceIdChanged,onInjectedDataChanged:this.subscriber.onInjectedDataChanged,onDocumentIssueListChanged:this.subscriber.onDocumentIssueListChanged,onCustomUndoDataChanged:this.subscriber.onCustomUndoDataChanged,onEngineEditModeChanged:this.subscriber.onEngineEditModeChanged,onBrandKitMediaChanged:this.subscriber.onBrandKitMediaChanged},this.setConnection,this.config.editorId,this.config.studioStyling,n=>{var r,h;(h=(r=this.config).onConnectionError)==null||h.call(r,n)}),this.editorAPI=it==null?void 0:it.promise.then(n=>n),this.action=this.toInstrumented(new Ge(this.editorAPI)),this.layout=this.toInstrumented(new Gs(this.editorAPI)),this.frame=this.toInstrumented(new Js(this.editorAPI)),this.barcode=this.toInstrumented(new We(this.editorAPI)),this.component=this.toInstrumented(new dn(this.editorAPI)),this.animation=this.toInstrumented(new _e(this.editorAPI)),this.document=this.toInstrumented(new ws(this.editorAPI)),this.configuration=this.toInstrumented(new on(this.editorAPI,this.localConfig)),this.utils=this.toInstrumented(new sn(this.editorAPI,this.localConfig)),this.tool=this.toInstrumented(new Xs(this.editorAPI)),this.page=this.toInstrumented(new Hs(this.editorAPI)),this.debug=this.toInstrumented(new ms(this.editorAPI)),this.undoManager=this.toInstrumented(new tn(this.editorAPI,this)),this.textSelection=this.toInstrumented(new qs(this.editorAPI)),this.colorStyle=this.toInstrumented(new ts(this.editorAPI)),this.gradientStyle=this.toInstrumented(new hn(this.editorAPI)),this.paragraphStyle=this.toInstrumented(new xs(this.editorAPI)),this.characterStyle=this.toInstrumented(new qe(this.editorAPI)),this.mediaConnector=this.toInstrumented(new _s(this.editorAPI)),this.fontConnector=this.toInstrumented(new ks(this.editorAPI)),this.componentConnector=this.toInstrumented(new cn(this.editorAPI)),this.dataConnector=this.toInstrumented(new ys(this.editorAPI,this.dataItemMappingTools)),this.dataSource=this.toInstrumented(new ps(this.editorAPI,this.dataItemMappingTools)),this.connector=this.toInstrumented(new gs(this.editorAPI,this.localConfig)),this.variable=this.toInstrumented(new nn(this.editorAPI,this.dataItemMappingTools)),this.font=this.toInstrumented(new Bs(this.editorAPI)),this.experiment=this.toInstrumented(new Ts(this.editorAPI)),this.canvas=this.toInstrumented(new fe(this.editorAPI)),this.shape=this.toInstrumented(new Ie(this.editorAPI)),this.colorConversion=this.toInstrumented(new Ze(this.editorAPI)),this.info=this.toInstrumented(new Us),this.clipboard=this.toInstrumented(new Ye(this.editorAPI)),this.brandKit=this.toInstrumented(new Ke(this.editorAPI,this)),this.componentGrid=this.toInstrumented(new ln(this.editorAPI)),this.next=new rn(this.config,this.connection,this.editorAPI),this.applyMethodInstrumentation(),this.configuration.setValue(Z.GraFxStudioSdkVersion,Fe.version),this.configuration.setValue(Z.GraFxStudioDocumentType,this.config.documentType||Ce.template),this.configuration.updateStudioOptions(this.config.studioOptions||Tr),this.configuration.setValue(Z.QueryCallCacheEnabled,((t=this.config.enableQueryCallCache)==null?void 0:t.toString())||"false")},this.setConnection=t=>{it=t},this.toInstrumented=t=>(Ca(t),t),this.applyMethodInstrumentation=()=>{var n;const t=this;for(const r of Object.keys(t)){const h=t[r];fa(h)&&(t[r]=gn(h,r,this.methodListeners,this.sdkEvents,(n=this.config.logging)==null?void 0:n.logger))}},this.config=Ee.createRuntimeConfig(o),this.sdkEvents=new ma((e=this.config.logging)==null?void 0:e.logger),this.connection=it,this.editorAPI=it==null?void 0:it.promise.then(t=>t),this.action=this.toInstrumented(new Ge(this.editorAPI)),this.layout=this.toInstrumented(new Gs(this.editorAPI)),this.frame=this.toInstrumented(new Js(this.editorAPI)),this.shape=this.toInstrumented(new Ie(this.editorAPI)),this.barcode=this.toInstrumented(new We(this.editorAPI)),this.component=this.toInstrumented(new dn(this.editorAPI)),this.undoManager=this.toInstrumented(new tn(this.editorAPI,this)),this.connector=this.toInstrumented(new gs(this.editorAPI,this.localConfig)),this.mediaConnector=this.toInstrumented(new _s(this.editorAPI)),this.fontConnector=this.toInstrumented(new ks(this.editorAPI)),this.componentConnector=this.toInstrumented(new cn(this.editorAPI)),this.dataConnector=this.toInstrumented(new ys(this.editorAPI,this.dataItemMappingTools)),this.dataSource=this.toInstrumented(new ps(this.editorAPI,this.dataItemMappingTools)),this.animation=this.toInstrumented(new _e(this.editorAPI)),this.document=this.toInstrumented(new ws(this.editorAPI)),this.configuration=this.toInstrumented(new on(this.editorAPI,this.localConfig)),this.variable=this.toInstrumented(new nn(this.editorAPI,this.dataItemMappingTools)),this.utils=this.toInstrumented(new sn(this.editorAPI,this.localConfig)),this.subscriber=new Yr(this.config,this.localConfig),this.tool=this.toInstrumented(new Xs(this.editorAPI)),this.page=this.toInstrumented(new Hs(this.editorAPI)),this.debug=this.toInstrumented(new ms(this.editorAPI)),this.textSelection=this.toInstrumented(new qs(this.editorAPI)),this.colorStyle=this.toInstrumented(new ts(this.editorAPI)),this.gradientStyle=this.toInstrumented(new hn(this.editorAPI)),this.paragraphStyle=this.toInstrumented(new xs(this.editorAPI)),this.characterStyle=this.toInstrumented(new qe(this.editorAPI)),this.font=this.toInstrumented(new Bs(this.editorAPI)),this.experiment=this.toInstrumented(new Ts(this.editorAPI)),this.canvas=this.toInstrumented(new fe(this.editorAPI)),this.colorConversion=this.toInstrumented(new Ze(this.editorAPI)),this.info=this.toInstrumented(new Us),this.clipboard=this.toInstrumented(new Ye(this.editorAPI)),this.next=new rn(this.config,this.connection,this.editorAPI),this.enabledNextSubscribers=this.config.enableNextSubscribers,this.brandKit=this.toInstrumented(new Ke(this.editorAPI,this)),this.componentGrid=this.toInstrumented(new ln(this.editorAPI)),this.applyMethodInstrumentation()}}var mn=(s=>(s.top="top",s.left="left",s.right="right",s.bottom="bottom",s.topLeft="topLeft",s.topRight="topRight",s.bottomLeft="bottomLeft",s.bottomRight="bottomRight",s))(mn||{}),wn=(s=>(s.horizontal="horizontal",s.vertical="vertical",s))(wn||{}),Cn=(s=>(s.easeIn="easeIn",s.easeOut="easeOut",s.easeInOut="easeInOut",s))(Cn||{}),fn=(s=>(s.quadratic="Quadratic",s.cubic="Cubic",s.quartic="Quartic",s.quintic="Quintic",s.sine="Sine",s.exponential="Exponential",s.circular="Circular",s.elastic="Elastic",s.bounce="Bounce",s.back="Back",s))(fn||{}),Sn=(s=>(s.bounce="bounce",s.flash="flash",s.headshake="headShake",s.heartbeat="heartbeat",s.pulse="pulse",s.rubberBand="rubberBand",s.vertical="vertical",s.horizontal="horizontal",s.swing="swing",s.tada="tada",s))(Sn||{}),bn=(s=>(s.preview="preview",s.normal="normal",s))(bn||{}),In=(s=>(s.linear="linear",s))(In||{}),vn=(s=>(s.local="linearLocal",s.linearBrandKit="linearBrandKit",s))(vn||{}),An=(s=>(s.Square="square",s.Line="line",s))(An||{}),Pn=(s=>(s.thumbnail="thumbnail",s.highest="highest",s.medium="medium",s))(Pn||{}),En=(s=>(s.BOLD="Bold",s.ITALIC="Italic",s.REGULAR="Regular",s))(En||{}),On=(s=>(s.LEFT="left",s.CENTER="center",s.RIGHT="right",s.JUSTIFY="justify",s))(On||{}),Dn=(s=>(s.TOP="top",s.CENTER="center",s.BOTTOM="bottom",s))(Dn||{}),Fn=(s=>(s.TO_LOWER_CASE="lowercase",s.TO_UPPER_CASE="uppercase",s.NORMAL="normal",s))(Fn||{}),Ln=(s=>(s.SUPERSCRIPT="superscript",s.SUBSCRIPT="subscript",s.NORMAL="normal",s))(Ln||{}),Nn=(s=>(s.none="none",s.bullet="bullet",s.number="number",s))(Nn||{}),Mn=(s=>(s.STYLE="textStyle",s.PROPERTIES="textProperties",s.APPEARANCE="appearance",s))(Mn||{}),Rn=(s=>(s.PARAGRAPH="paragraphStyleId",s.CHARACTER="characterStyleId",s.FONT_FAMILY="fontKey",s.FONT_STYLE="fontStyle",s.FONT_SIZE="fontSize",s.LETTER_SPACING="letterSpacing",s.LINE_HEIGHT="lineHeight",s.TEXT_ALIGN="textAlign",s.VERTICAL_ALIGN="verticalAlign",s.TYPOGRAPHIC_CASE="typographicCase",s.SUB_SUPER_SCRIPT="subSuperScript",s.UNDERLINE="underline",s.LINE_THROUGH="lineThrough",s.FILL_COLOR="fillColor",s.COLOR="color",s.FILL_COLOR_APPLIED="fillColorApplied",s.STROKE_COLOR="strokeColor",s.STROKE_COLOR_APPLIED="strokeColorApplied",s.BACKGROUND_COLOR="backgroundColor",s.BACKGROUND_COLOR_APPLIED="backgroundColorApplied",s.DROP_SHADOW_COLOR="dropShadowColor",s.BLEND_MODE="blendMode",s.OPACITY="opacity",s.TRACKING_RIGHT="trackingRight",s.BASELINE_SHIFT="baselineShiftValue",s.STROKE_WIDTH="strokeWidth",s.MARKED_LIST_TYPE="markedListType",s.MARKED_LIST_GROUP="markedListGroup",s.MARKED_LIST_LEVEL="markedListLevel",s))(Rn||{}),Vn=(s=>(s.arabic="arabic",s.romanUpperCase="romanUpperCase",s.romanLowerCase="romanLowerCase",s.latinUpperCase="latinUpperCase",s.latinLowerCase="latinLowerCase",s))(Vn||{}),Tn=(s=>(s.none="none",s.dash="dash",s.dot="dot",s.colon="colon",s.roundBracket="roundBracket",s))(Tn||{}),kn=(s=>(s.fixed="fixed",s))(kn||{}),Bn=(s=>(s.selectedLayoutChanged="selectedLayoutChanged",s.frameMoved="frameMoved",s.pageSizeChanged="pageSizeChanged",s.documentLoaded="documentLoaded",s.variableValueChanged="variableValueChanged",s))(Bn||{}),Jn=(s=>(s.ellipse="ellipse",s.rectangle="rectangle",s.polygon="polygon",s))(Jn||{}),Un=(s=>(s.all="all",s.only="only",s.none="none",s))(Un||{}),Gn=(s=>(s.paragraph="paragraph",s.character="character",s.lineBreak="lineBreak",s.inlineStyle="inlineStyle",s))(Gn||{}),_n=(s=>(s.exists="exists",s.missing="missing",s.equals="equals",s.notEquals="notEquals",s.contains="contains",s.startsWith="startsWith",s.endsWith="endsWith",s))(_n||{}),Hn=(s=>(s.normal="normal",s.textEdit="textEdit",s.customCrop="customCrop",s.frameSubjectArea="frameSubjectArea",s.perAssetCrop="perAssetCrop",s.gradient="gradient",s))(Hn||{}),xn=(s=>(s.url="url",s.grafx="grafx",s.local="local",s))(xn||{});const ba=Object.freeze(Object.defineProperty({__proto__:null,ConnectorRegistrationSource:xn},Symbol.toStringTag,{value:"Module"}));c.APIColorType=Qe,c.ActionAsyncError=ke,c.ActionEditorEvent=Bn,c.Alignment=On,c.AnchorTargetEdgeType=Ms,c.AnchorTargetType=Ns,c.AuthCredentialsTypeEnum=cs,c.AuthRefreshTypeEnum=ds,c.AutoGrowDirection=fs,c.BarcodeCharacterSet=wt,c.BarcodeErrorCorrectionLevel=Et,c.BarcodeSourceTypeEnum=Is,c.BarcodeType=W,c.BarcodeValidationResult=He,c.BasicAnimationsEmphasisStyles=Sn,c.BlendMode=Es,c.Case=Fn,c.ColorType=he,c.ColorUsageType=Xe,c.ComponentFitEnum=Cs,c.ComponentGridLayoutAlgorithm=kn,c.ComponentPreviewType=Pn,c.ComponentSourceTypeEnum=Ss,c.ConnectorConfigContextType=as,c.ConnectorConfigValueType=rs,c.ConnectorEventType=hs,c.ConnectorHttpError=Je,c.ConnectorMapping=_r,c.ConnectorMappingDirection=os,c.ConnectorMappingSource=is,c.ConnectorRegistrationSource=Ft,c.ConnectorStateType=de,c.ConnectorSupportedAuth=us,c.ConnectorType=es,c.ConstraintMode=ze,c.CornerRadiusType=Un,c.CropType=be,c.DataRowAsyncError=Be,c.DataSourceVariableDisplayOptionsType=Ks,c.DataSourceVariableSourceType=Ae,c.Day=$s,c.DeprecatedMediaConnectorDownloadType=ce,c.DeprecatedMediaType=Ot,c.DocumentIssueTypeEnum=Te,c.DocumentType=Ce,c.DownloadFormats=Qs,c.EaseTypes=Cn,c.EngineEditModeType=Hn,c.EnvironmentType=ge,c.FitMode=Os,c.FitModePosition=Ds,c.FlowDirection=As,c.FontPreviewFormat=An,c.FontWeights=En,c.FrameAnchorTarget=Wr,c.FrameAnchorType=Ls,c.FrameEditingMode=Ve,c.FramePropertyNames=Ys,c.FrameTypeEnum=bs,c.GradientType=In,c.GradientUsageType=vn,c.GrafxTokenAuthCredentials=xr,c.ImageSourceTypeEnum=zt,c.LayoutIntent=je,c.LayoutPropertyNames=Zs,c.LayoutType=$e,c.Locale=js,c.MarkedListType=Nn,c.MeasurementUnit=xe,c.MediaDownloadIntent=ve,c.MediaDownloadType=ue,c.MediaType=Dt,c.Next=ba,c.NumberListFormat=Vn,c.NumberListSeparatorSymbol=Tn,c.PageAnchorTarget=zr,c.PositionEnum=Q,c.RefreshedAuthCredendentials=$r,c.SDKUnauthorizedError=en,c.Scripting=Ln,c.SelectedTextStyleSections=Mn,c.SelectedTextStyles=Rn,c.ShakeDirections=wn,c.ShapeType=Jn,c.SlideDirections=mn,c.SmartCropAxisBias=Vs,c.SmartCropVersion=Rs,c.SortBy=ss,c.SortOrder=ns,c.StructuredTextAttributeMatchOperator=_n,c.StructuredTextStyleKind=Gn,c.TextDirection=vs,c.TextPosition=Dn,c.ToolType=G,c.TweenTypes=fn,c.UpdateZIndexMethod=Fs,c.UploadAssetValidationError=ls,c.UploadAssetValidationErrorType=Se,c.VariableType=Wt,c.VariableValueConstrainsViolationError=Ue,c.VariableVisibilityOperator=Ws,c.VariableVisibilityTargetType=zs,c.VariableVisibilityType=Lt,c.VerticalAlign=Ps,c.ViewMode=bn,c.WellKnownConfigurationKeys=Z,c.default=Sa,c.grafxMediaConnectorRegistration=Hr,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
69
69
  //# sourceMappingURL=main.js.map