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