@mypixia/simplex-designer 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,9 +12,10 @@ Mypixia is a powerful, customizable JavaScript image editor that allows users to
12
12
 
13
13
 
14
14
  ## Usage
15
- <code>
16
- npm install mypixia --save
17
- </code>
15
+ ```shell
16
+ npm install @mypixia/simplex-designer --save
17
+ ```
18
+
18
19
 
19
20
  ### React
20
21
  ```jsx
@@ -31,7 +32,8 @@ function MyEditor() {
31
32
  secondaryColor: "#cf7e52",
32
33
  tertiaryColor: "#FFFFFF"
33
34
  }}
34
- apiEndpoint={'https://your-api-endpoint.com'}
35
+ apiKey = {"Your API key "} //optional
36
+ apiEndpoint={'you will receive in email if you get api key'} //optional
35
37
  handleSaveClick={(design) => {
36
38
  // Get PNG format
37
39
  design.getPNG().then(returnProps => {
@@ -75,13 +77,14 @@ export default {
75
77
  mounted() {
76
78
  const config = {
77
79
  canvasId: "my-canvas",
80
+ apiKey : "Your API key ", //optional
81
+ apiEndpoint:'you will receive in email if you get api key', //optional
78
82
  theme: {
79
83
  primaryColor: "#000000",
80
84
  primaryColorLight: "#cf7e52",
81
85
  secondaryColor: "#cf7e52",
82
86
  tertiaryColor: "#FFFFFF"
83
87
  },
84
- apiEndpoint: 'https://your-api-endpoint.com',
85
88
  handleSaveClick: (design) => {
86
89
  design.getPNG().then(returnProps => {
87
90
  console.log(returnProps);
@@ -130,7 +133,8 @@ export class EditorComponent implements AfterViewInit {
130
133
  secondaryColor: "#cf7e52",
131
134
  tertiaryColor: "#FFFFFF"
132
135
  },
133
- apiEndpoint: 'https://your-api-endpoint.com',
136
+ apiKey : "Your API key ", //optional
137
+ apiEndpoint:'you will receive in email if you get api key', //optional
134
138
  handleSaveClick: (design) => {
135
139
  design.getPNG().then(returnProps => {
136
140
  console.log(returnProps);
@@ -160,19 +164,25 @@ export class EditorComponent implements AfterViewInit {
160
164
 
161
165
  ```html
162
166
  <!DOCTYPE html>
163
- <html>
167
+ <html lang="en">
164
168
  <head>
165
- <title>Mypixia Editor</title>
169
+ <meta charset="UTF-8">
170
+ <title>Title</title>
166
171
  </head>
167
172
  <body>
168
- <div id="editor-container"></div>
169
173
 
170
- <script src="https://unpkg.com/mypixia/dist/index.umd.js"></script>
174
+ <div id="mypixia-widget-container"></div>
175
+ <script src="https://cdn.mypixia.com/index.umd.js"></script>
171
176
  <script>
177
+ // Make sure the script has loaded by delaying initialization
172
178
  document.addEventListener('DOMContentLoaded', function() {
173
- const container = document.getElementById('editor-container');
179
+ // Check if Mypixia is available in the global scope
180
+ if (typeof Mypixia === 'undefined') {
181
+ console.error('Mypixia not loaded yet. Be sure to load the script before initializing the widget.');
182
+ return;
183
+ }
174
184
 
175
- const config = {
185
+ Mypixia.render(document.getElementById('mypixia-widget-container'), {
176
186
  canvasId: "my-canvas",
177
187
  theme: {
178
188
  primaryColor: "#000000",
@@ -180,29 +190,30 @@ export class EditorComponent implements AfterViewInit {
180
190
  secondaryColor: "#cf7e52",
181
191
  tertiaryColor: "#FFFFFF"
182
192
  },
183
- apiEndpoint: 'https://your-api-endpoint.com',
184
- handleSaveClick: function(design) {
185
- design.getPNG().then(function(returnProps) {
193
+ apiKey:'your api key'
194
+ apiEndpoint: 'available when you get API key',
195
+ handleSaveClick: (design) => {
196
+ //get png format
197
+ design.getPNG().then(returnProps => {
186
198
  console.log(returnProps);
187
199
  });
188
200
  },
189
- enabledModules: ['TXT', 'STICKERS', 'SHAPES', 'ICONS', 'IMAGE', 'QRCODE', 'BARCODE'],
201
+ enabledModules: ['TXT','STICKERS', 'SHAPES', 'ICONS', 'IMAGE', 'QRCODE', 'BARCODE'],
190
202
  actionButtons: {
191
- share: false,
192
- download: false,
203
+ share: false, //share Design
204
+ download: false, // download button
193
205
  },
194
206
  additionalActionButton: {
195
207
  btnLabel: "Your Custom Action Button",
196
- btnAction: function(designProps) {
197
- console.log("Handle button clicked with following props", designProps);
208
+ btnAction: (designProps) => {
209
+ console.log("handle Button clicked with following props", designProps);
198
210
  },
199
- btnColor: '#008000',
211
+ btnColor: '#008000',//defaults to primary theme color
200
212
  }
201
- };
202
-
203
- new Mypixia(container, config);
213
+ });
204
214
  });
205
215
  </script>
216
+
206
217
  </body>
207
218
  </html>
208
219
 
@@ -223,7 +234,7 @@ export class EditorComponent implements AfterViewInit {
223
234
 
224
235
  ## Theme Configuration
225
236
 
226
- ```json
237
+ ```
227
238
  {
228
239
  primaryColor: "#000000", // Main theme color
229
240
  primaryColorLight: "#cf7e52", // Lighter version of primary color
@@ -235,7 +246,7 @@ export class EditorComponent implements AfterViewInit {
235
246
  ### Available Modules
236
247
  - `TXT` - Text editing capabilities
237
248
  - `STICKERS` - Sticker library
238
- - - Basic shapes (circle, rectangle, etc.) `SHAPES`
249
+ - `SHAPES` - `Basic shapes (circle, rectangle, etc.)
239
250
  - `ICONS` - Icon library
240
251
  - `IMAGE` - Image upload and manipulation
241
252
  - `QRCODE` - QR code generation
@@ -0,0 +1,34 @@
1
+ "use strict";require('./index.css');var qt=Object.create;var gt=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var Qt=Object.getOwnPropertyNames;var Zt=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty;var tr=(f,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Qt(t))!er.call(f,l)&&l!==i&&gt(f,l,{get:()=>t[l],enumerable:!(o=Xt(t,l))||o.enumerable});return f};var rr=(f,t,i)=>(i=f!=null?qt(Zt(f)):{},tr(t||!f||!f.__esModule?gt(i,"default",{value:f,enumerable:!0}):i,f));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),Lt=require("react-dom"),_=require("fabric"),be=require("axios"),sr=require("qrcode"),nr=require("react-barcode"),ne=require("react-share");function ir(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var nt={exports:{}},rt={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var mt;function or(){if(mt)return rt;mt=1;var f=h,t=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function g(d,y,a){var j,u={},w=null,n=null;a!==void 0&&(w=""+a),y.key!==void 0&&(w=""+y.key),y.ref!==void 0&&(n=y.ref);for(j in y)o.call(y,j)&&!x.hasOwnProperty(j)&&(u[j]=y[j]);if(d&&d.defaultProps)for(j in y=d.defaultProps,y)u[j]===void 0&&(u[j]=y[j]);return{$$typeof:t,type:d,key:w,ref:n,props:u,_owner:l.current}}return rt.Fragment=i,rt.jsx=g,rt.jsxs=g,rt}var st={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var vt;function cr(){return vt||(vt=1,process.env.NODE_ENV!=="production"&&function(){var f=h,t=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),d=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),n=Symbol.for("react.offscreen"),v=Symbol.iterator,p="@@iterator";function b(r){if(r===null||typeof r!="object")return null;var m=v&&r[v]||r[p];return typeof m=="function"?m:null}var s=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(r){{for(var m=arguments.length,S=new Array(m>1?m-1:0),z=1;z<m;z++)S[z-1]=arguments[z];L("error",r,S)}}function L(r,m,S){{var z=s.ReactDebugCurrentFrame,U=z.getStackAddendum();U!==""&&(m+="%s",S=S.concat([U]));var W=S.map(function(F){return String(F)});W.unshift("Warning: "+m),Function.prototype.apply.call(console[r],console,W)}}var I=!1,R=!1,D=!1,E=!1,T=!1,H;H=Symbol.for("react.module.reference");function Y(r){return!!(typeof r=="string"||typeof r=="function"||r===o||r===x||T||r===l||r===a||r===j||E||r===n||I||R||D||typeof r=="object"&&r!==null&&(r.$$typeof===w||r.$$typeof===u||r.$$typeof===g||r.$$typeof===d||r.$$typeof===y||r.$$typeof===H||r.getModuleId!==void 0))}function J(r,m,S){var z=r.displayName;if(z)return z;var U=m.displayName||m.name||"";return U!==""?S+"("+U+")":S}function oe(r){return r.displayName||"Context"}function re(r){if(r==null)return null;if(typeof r.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case o:return"Fragment";case i:return"Portal";case x:return"Profiler";case l:return"StrictMode";case a:return"Suspense";case j:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case d:var m=r;return oe(m)+".Consumer";case g:var S=r;return oe(S._context)+".Provider";case y:return J(r,r.render,"ForwardRef");case u:var z=r.displayName||null;return z!==null?z:re(r.type)||"Memo";case w:{var U=r,W=U._payload,F=U._init;try{return re(F(W))}catch{return null}}}return null}var se=Object.assign,he=0,Ee,ye,Xe,Te,ee,De,Pe;function Fe(){}Fe.__reactDisabledLog=!0;function Me(){{if(he===0){Ee=console.log,ye=console.info,Xe=console.warn,Te=console.error,ee=console.group,De=console.groupCollapsed,Pe=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Fe,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}he++}}function He(){{if(he--,he===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},r,{value:Ee}),info:se({},r,{value:ye}),warn:se({},r,{value:Xe}),error:se({},r,{value:Te}),group:se({},r,{value:ee}),groupCollapsed:se({},r,{value:De}),groupEnd:se({},r,{value:Pe})})}he<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var we=s.ReactCurrentDispatcher,ge;function $(r,m,S){{if(ge===void 0)try{throw Error()}catch(U){var z=U.stack.trim().match(/\n( *(at )?)/);ge=z&&z[1]||""}return`
18
+ `+ge+r}}var ze=!1,Ne;{var X=typeof WeakMap=="function"?WeakMap:Map;Ne=new X}function Ve(r,m){if(!r||ze)return"";{var S=Ne.get(r);if(S!==void 0)return S}var z;ze=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=we.current,we.current=null,Me();try{if(m){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(ce){z=ce}Reflect.construct(r,[],F)}else{try{F.call()}catch(ce){z=ce}r.call(F.prototype)}}else{try{throw Error()}catch(ce){z=ce}r()}}catch(ce){if(ce&&z&&typeof ce.stack=="string"){for(var P=ce.stack.split(`
19
+ `),ie=z.stack.split(`
20
+ `),q=P.length-1,Z=ie.length-1;q>=1&&Z>=0&&P[q]!==ie[Z];)Z--;for(;q>=1&&Z>=0;q--,Z--)if(P[q]!==ie[Z]){if(q!==1||Z!==1)do if(q--,Z--,Z<0||P[q]!==ie[Z]){var de=`
21
+ `+P[q].replace(" at new "," at ");return r.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",r.displayName)),typeof r=="function"&&Ne.set(r,de),de}while(q>=1&&Z>=0);break}}}finally{ze=!1,we.current=W,He(),Error.prepareStackTrace=U}var Ge=r?r.displayName||r.name:"",_e=Ge?$(Ge):"";return typeof r=="function"&&Ne.set(r,_e),_e}function le(r,m,S){return Ve(r,!1)}function pe(r){var m=r.prototype;return!!(m&&m.isReactComponent)}function Ce(r,m,S){if(r==null)return"";if(typeof r=="function")return Ve(r,pe(r));if(typeof r=="string")return $(r);switch(r){case a:return $("Suspense");case j:return $("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case y:return le(r.render);case u:return Ce(r.type,m,S);case w:{var z=r,U=z._payload,W=z._init;try{return Ce(W(U),m,S)}catch{}}}return""}var me=Object.prototype.hasOwnProperty,Ue={},Se=s.ReactDebugCurrentFrame;function Oe(r){if(r){var m=r._owner,S=Ce(r.type,r._source,m?m.type:null);Se.setExtraStackFrame(S)}else Se.setExtraStackFrame(null)}function We(r,m,S,z,U){{var W=Function.call.bind(me);for(var F in r)if(W(r,F)){var P=void 0;try{if(typeof r[F]!="function"){var ie=Error((z||"React class")+": "+S+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ie.name="Invariant Violation",ie}P=r[F](m,F,z,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){P=q}P&&!(P instanceof Error)&&(Oe(U),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",z||"React class",S,F,typeof P),Oe(null)),P instanceof Error&&!(P.message in Ue)&&(Ue[P.message]=!0,Oe(U),C("Failed %s type: %s",S,P.message),Oe(null))}}}var Qe=Array.isArray;function Re(r){return Qe(r)}function Ze(r){{var m=typeof Symbol=="function"&&Symbol.toStringTag,S=m&&r[Symbol.toStringTag]||r.constructor.name||"Object";return S}}function et(r){try{return Ae(r),!1}catch{return!0}}function Ae(r){return""+r}function k(r){if(et(r))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(r)),Ae(r)}var O=s.ReactCurrentOwner,G={key:!0,ref:!0,__self:!0,__source:!0},B,Q;function ue(r){if(me.call(r,"ref")){var m=Object.getOwnPropertyDescriptor(r,"ref").get;if(m&&m.isReactWarning)return!1}return r.ref!==void 0}function ve(r){if(me.call(r,"key")){var m=Object.getOwnPropertyDescriptor(r,"key").get;if(m&&m.isReactWarning)return!1}return r.key!==void 0}function te(r,m){typeof r.ref=="string"&&O.current}function $e(r,m){{var S=function(){B||(B=!0,C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};S.isReactWarning=!0,Object.defineProperty(r,"key",{get:S,configurable:!0})}}function Le(r,m){{var S=function(){Q||(Q=!0,C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};S.isReactWarning=!0,Object.defineProperty(r,"ref",{get:S,configurable:!0})}}var je=function(r,m,S,z,U,W,F){var P={$$typeof:t,type:r,key:m,ref:S,props:F,_owner:W};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function c(r,m,S,z,U){{var W,F={},P=null,ie=null;S!==void 0&&(k(S),P=""+S),ve(m)&&(k(m.key),P=""+m.key),ue(m)&&(ie=m.ref,te(m,U));for(W in m)me.call(m,W)&&!G.hasOwnProperty(W)&&(F[W]=m[W]);if(r&&r.defaultProps){var q=r.defaultProps;for(W in q)F[W]===void 0&&(F[W]=q[W])}if(P||ie){var Z=typeof r=="function"?r.displayName||r.name||"Unknown":r;P&&$e(F,Z),ie&&Le(F,Z)}return je(r,P,ie,U,z,O.current,F)}}var A=s.ReactCurrentOwner,M=s.ReactDebugCurrentFrame;function N(r){if(r){var m=r._owner,S=Ce(r.type,r._source,m?m.type:null);M.setExtraStackFrame(S)}else M.setExtraStackFrame(null)}var ae;ae=!1;function V(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function K(){{if(A.current){var r=re(A.current.type);if(r)return`
22
+
23
+ Check the render method of \``+r+"`."}return""}}function tt(r){return""}var ht={};function Ht(r){{var m=K();if(!m){var S=typeof r=="string"?r:r.displayName||r.name;S&&(m=`
24
+
25
+ Check the top-level render call using <`+S+">.")}return m}}function pt(r,m){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var S=Ht(m);if(ht[S])return;ht[S]=!0;var z="";r&&r._owner&&r._owner!==A.current&&(z=" It was passed a child from "+re(r._owner.type)+"."),N(r),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,z),N(null)}}function ut(r,m){{if(typeof r!="object")return;if(Re(r))for(var S=0;S<r.length;S++){var z=r[S];V(z)&&pt(z,m)}else if(V(r))r._store&&(r._store.validated=!0);else if(r){var U=b(r);if(typeof U=="function"&&U!==r.entries)for(var W=U.call(r),F;!(F=W.next()).done;)V(F.value)&&pt(F.value,m)}}}function Vt(r){{var m=r.type;if(m==null||typeof m=="string")return;var S;if(typeof m=="function")S=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===y||m.$$typeof===u))S=m.propTypes;else return;if(S){var z=re(m);We(S,r.props,"prop",z,r)}else if(m.PropTypes!==void 0&&!ae){ae=!0;var U=re(m);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ut(r){{for(var m=Object.keys(r.props),S=0;S<m.length;S++){var z=m[S];if(z!=="children"&&z!=="key"){N(r),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),N(null);break}}r.ref!==null&&(N(r),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}var ft={};function xt(r,m,S,z,U,W){{var F=Y(r);if(!F){var P="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(P+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ie=tt();ie?P+=ie:P+=K();var q;r===null?q="null":Re(r)?q="array":r!==void 0&&r.$$typeof===t?(q="<"+(re(r.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):q=typeof r,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,P)}var Z=c(r,m,S,U,W);if(Z==null)return Z;if(F){var de=m.children;if(de!==void 0)if(z)if(Re(de)){for(var Ge=0;Ge<de.length;Ge++)ut(de[Ge],r);Object.freeze&&Object.freeze(de)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ut(de,r)}if(me.call(m,"key")){var _e=re(r),ce=Object.keys(m).filter(function(Kt){return Kt!=="key"}),lt=ce.length>0?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}";if(!ft[_e+lt]){var Yt=ce.length>0?"{"+ce.join(": ..., ")+": ...}":"{}";C(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,lt,_e,Yt,_e),ft[_e+lt]=!0}}return r===o?Ut(Z):Vt(Z),Z}}function Wt(r,m,S){return xt(r,m,S,!0)}function $t(r,m,S){return xt(r,m,S,!1)}var Gt=$t,Jt=Wt;st.Fragment=o,st.jsx=Gt,st.jsxs=Jt}()),st}var jt;function ar(){return jt||(jt=1,process.env.NODE_ENV==="production"?nt.exports=or():nt.exports=cr()),nt.exports}var e=ar(),Je={},bt;function lr(){if(bt)return Je;bt=1;var f=Lt;if(process.env.NODE_ENV==="production")Je.createRoot=f.createRoot,Je.hydrateRoot=f.hydrateRoot;else{var t=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Je.createRoot=function(i,o){t.usingClientEntryPoint=!0;try{return f.createRoot(i,o)}finally{t.usingClientEntryPoint=!1}},Je.hydrateRoot=function(i,o,l){t.usingClientEntryPoint=!0;try{return f.hydrateRoot(i,o,l)}finally{t.usingClientEntryPoint=!1}}}return Je}var dr=lr();const hr=ir(dr),pr={primaryColor:"#f88300",primaryColorLight:"#6858c1",secondaryColor:"#005a53",tertiaryColor:"#FFFFFF"},ur="M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z",fr="M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z",xr="M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z",gr="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z",mr="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z",vr="M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16V200c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16V392c0 39.8-32.2 72-72 72H272 212.3h-.9c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23V320 64zM176 0c-35.3 0-64 28.7-64 64V261.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2h.9H272h56c66.3 0 120-53.7 120-120V288l0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5V64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z",jr="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z",br="M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z",yt="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z",wt="M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6V377.4c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4V134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1v-188L288 246.6v188z",dt="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z",Ct="M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9v28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5V291.9c0-30.2 10.2-58.7 27.9-81.5c12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5 .8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32zM128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6 354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6L143.3 262.6 128 408z",yr="M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z",wr="M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.7 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z",Cr="M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z",Sr="M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z",St="M123.6 391.3c12.9-9.4 29.6-11.8 44.6-6.4c26.5 9.6 56.2 15.1 87.8 15.1c124.7 0 208-80.5 208-160s-83.3-160-208-160S48 160.5 48 240c0 32 12.4 62.8 35.7 89.2c8.6 9.7 12.8 22.5 11.8 35.5c-1.4 18.1-5.7 34.7-11.3 49.4c17-7.9 31.1-16.7 39.4-22.7zM21.2 431.9c1.8-2.7 3.5-5.4 5.1-8.1c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208s-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6c-15.1 6.6-32.3 12.6-50.1 16.1c-.8 .2-1.6 .3-2.4 .5c-4.4 .8-8.7 1.5-13.2 1.9c-.2 0-.5 .1-.7 .1c-5.1 .5-10.2 .8-15.3 .8c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c4.1-4.2 7.8-8.7 11.3-13.5c1.7-2.3 3.3-4.6 4.8-6.9c.1-.2 .2-.3 .3-.5z",kt="M0 24C0 10.7 10.7 0 24 0H69.5c22 0 41.5 12.8 50.6 32h411c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3H170.7l5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H199.7c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5H24C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z",Nt="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z",Ot="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z",At="M225.8 468.2l-2.5-2.3L48.1 303.2C17.4 274.7 0 234.7 0 192.8v-3.3c0-70.4 50-130.8 119.2-144C158.6 37.9 198.9 47 231 69.6c9 6.4 17.4 13.8 25 22.3c4.2-4.8 8.7-9.2 13.5-13.3c3.7-3.2 7.5-6.2 11.5-9c0 0 0 0 0 0C313.1 47 353.4 37.9 392.8 45.4C462 58.6 512 119.1 512 189.5v3.3c0 41.9-17.4 81.9-48.1 110.4L288.7 465.9l-2.5 2.3c-8.2 7.6-19 11.9-30.2 11.9s-22-4.2-30.2-11.9zM239.1 145c-.4-.3-.7-.7-1-1.1l-17.8-20c0 0-.1-.1-.1-.1c0 0 0 0 0 0c-23.1-25.9-58-37.7-92-31.2C81.6 101.5 48 142.1 48 189.5v3.3c0 28.5 11.9 55.8 32.8 75.2L256 430.7 431.2 268c20.9-19.4 32.8-46.7 32.8-75.2v-3.3c0-47.3-33.6-88-80.1-96.9c-34-6.5-69 5.4-92 31.2c0 0 0 0-.1 .1s0 0-.1 .1l-17.8 20c-.3 .4-.7 .7-1 1.1c-4.5 4.5-10.6 7-16.9 7s-12.4-2.5-16.9-7z",kr="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z",It="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z",Et="M0 336c0 79.5 64.5 144 144 144H512c70.7 0 128-57.3 128-128c0-61.9-44-113.6-102.4-125.4c4.1-10.7 6.4-22.4 6.4-34.6c0-53-43-96-96-96c-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32C167.6 32 96 103.6 96 192c0 2.7 .1 5.4 .2 8.1C40.2 219.8 0 273.2 0 336z",Tt="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM164.1 325.5C182 346.2 212.6 368 256 368s74-21.8 91.9-42.5c5.8-6.7 15.9-7.4 22.6-1.6s7.4 15.9 1.6 22.6C349.8 372.1 311.1 400 256 400s-93.8-27.9-116.1-53.5c-5.8-6.7-5.1-16.8 1.6-22.6s16.8-5.1 22.6 1.6zM144.4 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z",Mt="M48 256C48 141.1 141.1 48 256 48c63.1 0 119.6 28.1 157.8 72.5c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0C114.6 0 0 114.6 0 256v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1v40c0 13.3 10.7 24 24 24s24-10.7 24-24V256c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6c-15.2 5-18.7 23.7-8.3 35.9c7.1 8.3 18.8 10.8 29.4 7.9c10.6-2.9 21.8-4.4 33.4-4.4c70.7 0 128 57.3 128 128v24.9c0 25.2-1.5 50.3-4.4 75.3c-1.7 14.6 9.4 27.8 24.2 27.8c11.8 0 21.9-8.6 23.3-20.3c3.3-27.4 5-55 5-82.7V256c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4C93.7 178 80 215.4 80 256v24.9c0 24.2-2.6 48.4-7.8 71.9C68.8 368.4 80.1 384 96.1 384c10.5 0 19.9-7 22.2-17.3c6.4-28.1 9.7-56.8 9.7-85.8V256c0-27.2 8.5-52.4 22.9-73.1c7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96v24.9c0 35.9-4.6 71.5-13.8 106.1c-3.8 14.3 6.7 29 21.5 29c9.5 0 17.9-6.2 20.4-15.4c10.5-39 15.9-79.2 15.9-119.7V256c0-28.7 23.3-52 52-52s52 23.3 52 52v24.9c0 36.3-3.5 72.4-10.4 107.9c-2.7 13.9 7.7 27.2 21.8 27.2c10.2 0 19-7 21-17c7.7-38.8 11.6-78.3 11.6-118.1V256c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24v24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9V256z",Nr="M315.4 15.5C309.7 5.9 299.2 0 288 0s-21.7 5.9-27.4 15.5l-96 160c-5.9 9.9-6.1 22.2-.4 32.2s16.3 16.2 27.8 16.2H384c11.5 0 22.2-6.2 27.8-16.2s5.5-22.3-.4-32.2l-96-160zM288 312V456c0 22.1 17.9 40 40 40H472c22.1 0 40-17.9 40-40V312c0-22.1-17.9-40-40-40H328c-22.1 0-40 17.9-40 40zM128 512a128 128 0 1 0 0-256 128 128 0 1 0 0 256z",Or="M116.7 219.4a15.7 15.7 0 0 0 22.7 0l96.8-99.8c28.2-29 26.5-77.1-4.9-103.9C203.8-7.7 163-3.5 137.9 22.4L128 32.6l-9.9-10.1C93.1-3.5 52.3-7.7 24.9 15.6c-31.4 26.8-33 74.9-5 103.9zm143.9 100.5h-48l-7.1-14.2a27.4 27.4 0 0 0 -25.7-17.8h-71.7a27.4 27.4 0 0 0 -25.7 17.8l-7 14.2h-48A27.5 27.5 0 0 0 0 347.3v137.3A27.4 27.4 0 0 0 27.4 512h233.1A27.5 27.5 0 0 0 288 484.6V347.3a27.5 27.5 0 0 0 -27.4-27.5zM144 468a52 52 0 1 1 52-52 52 52 0 0 1 -52 52zm355.4-115.9h-60.6l22.4-50.8c2.1-6.7-3.9-13.2-12.2-13.2h-75.6c-6.3 0-11.7 3.9-12.5 9.1l-16.8 106.9c-1 6.3 4.9 11.9 12.5 11.9h62.3l-24.2 83c-1.9 6.7 4.2 12.9 12.2 12.9a13.3 13.3 0 0 0 10.9-5.3l92.4-138.9c4.9-6.9-1.2-15.7-10.9-15.7zM478.1 .3L329.5 23.2C314.9 25.4 304 38.9 304 54.8V161.6a83.3 83.3 0 0 0 -16-1.7c-35.4 0-64 21.5-64 48s28.7 48 64 48c35.2 0 63.7-21.3 64-47.7V99.7l112-17.2v47.2a83.3 83.3 0 0 0 -16-1.7c-35.4 0-64 21.5-64 48s28.7 48 64 48c35.2 0 63.7-21.3 64-47.7V32c0-19.5-16-34.4-33.9-31.7z",Ar="M432 416h-23.4L277.9 53.7A32 32 0 0 0 247.6 32h-47.2a32 32 0 0 0 -30.3 21.7L39.4 416H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16h-19.6l23.3-64h152.6l23.3 64H304a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16zM176.9 272L224 142.5 271.2 272z",Ir="M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z",Er="M608 0H160a32 32 0 0 0 -32 32v96h160V64h192v320h128a32 32 0 0 0 32-32V32a32 32 0 0 0 -32-32zM232 103a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm352 208a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9v-30a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm0-104a9 9 0 0 1 -9 9h-30a9 9 0 0 1 -9-9V73a9 9 0 0 1 9-9h30a9 9 0 0 1 9 9zm-168 57H32a32 32 0 0 0 -32 32v288a32 32 0 0 0 32 32h384a32 32 0 0 0 32-32V192a32 32 0 0 0 -32-32zM96 224a32 32 0 1 1 -32 32 32 32 0 0 1 32-32zm288 224H64v-32l64-64 32 32 128-128 96 96z",Tr="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z",Mr="M0 448V64h18v384H0zm26.9-.3V64H36v383.7h-9.1zm27.1 0V64h8.9v383.7H54zm44.9 0V64h8.9v383.7h-8.9zm36 0V64h17.7v383.7h-17.7zm44.9 0V64h8.9v383.7h-8.9zm18 0V64h8.9v383.7h-8.9zm18 0V64h8.9v383.7h-8.9zm35.7 0V64h18v383.7h-18zm44.9 0V64h18v383.7h-18zm36 0V64h18v383.7h-18zm36 0V64h18v383.7h-18zm26.9 0V64h18v383.7h-18zm45.1 0V64h26.9v383.7h-26.9zm35.7 0V64h9.1v383.7H476zm18 .3V64h18v384h-18z",zr="M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z",_t="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1 -32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.7 23.7 0 0 0 -21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0 -16-16z",Rr="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z",Lr="M576 128c0-35.3-28.7-64-64-64H205.3c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7H512c35.3 0 64-28.7 64-64V128zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z",_r="M 6 3.6 V 0 L 0 6 l 6 6 V 8 c 6 -0.27 7.53 3.76 7.88 5.77 a 0.27 0.27 0 0 0 0.53 0 C 17.08 2.86 6 3.6 6 3.6 Z",Br="M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z",Dr="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z",Pr="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z",Fr="M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z",Hr="M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z",Vr="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z",Ur="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z",Bt="M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",Wr="M134.1 296H436c6.6 0 12-5.4 12-12v-56c0-6.6-5.4-12-12-12H134.1v-46.1c0-21.4-25.9-32.1-41-17L7 239c-9.4 9.4-9.4 24.6 0 33.9l86.1 86.1c15.1 15.1 41 4.4 41-17V296z",$r="apcDB",ke="APCObjectStore",Gr=1;function it(){return new Promise((f,t)=>{const i=indexedDB.open($r,Gr);i.onupgradeneeded=function(o){let l=o.target.result,x;l.objectStoreNames.contains(ke)?x=i.transaction.objectStore(ke):x=l.createObjectStore(ke,{keyPath:"id"}),x.indexNames.contains("nameIndex")||x.createIndex("nameIndex","name",{unique:!1})},i.onsuccess=function(o){f(o.target.result)},i.onerror=function(o){t("Database error: "+o.target.errorCode)}})}function Be(f,t,i,o){return it().then(l=>new Promise((x,g)=>{const d=l.transaction(["APCObjectStore"],"readwrite"),y=d.objectStore("APCObjectStore"),a={id:f,classification:t,content:i,misc:o},j=y.put(a);j.onsuccess=()=>x(j.result),j.onerror=()=>g(j.error),d.oncomplete=()=>l.close()}))}function Ke(f){return it().then(t=>new Promise((i,o)=>{const l=t.transaction([ke],"readonly"),g=l.objectStore(ke).get(f);g.onsuccess=()=>i(g.result),g.onerror=()=>o(g.error),l.oncomplete=()=>t.close()}))}function Jr(f){return it().then(t=>new Promise((i,o)=>{const l=t.transaction([ke],"readwrite"),g=l.objectStore(ke).delete(f);g.onsuccess=()=>i(),g.onerror=()=>o(g.error),l.oncomplete=()=>t.close()}))}function Ie(f=null){return it().then(t=>new Promise((i,o)=>{const l=t.transaction([ke],"readonly"),g=l.objectStore(ke).openCursor(),d=[];g.onsuccess=y=>{const a=y.target.result;a?((!f||f(a.value))&&d.push(a.value),a.continue()):i(d)},g.onerror=y=>{o("Failed to retrieve items: "+y.target.errorCode)},l.oncomplete=()=>{t.close()}}))}function Yr(f){const{currentTabNo:t,theme:i,apcCanvasInstance:o,apiEndpoint:l,reloadTabs:x,updateActiveSection:g,initCategory:d,initInstance:y,apiKey:a,setActiveTab:j}=f,[u,w]=h.useState(),[n,v]=h.useState(d||"Hats"),[p,b]=h.useState(!1),[s,C]=h.useState(),L=`${l}/api/v1/designer`;h.useEffect(()=>{I()},[]),h.useEffect(()=>{o&&y&&y.fabricID&&R(y.fabricID)},[y]);const I=()=>{b(!0);const E=`${L}/search-designs-images/${n}`;be.get(E).then(T=>{b(!1),T.data.object.length>0?w(T.data):C("No matching results found")}).catch(T=>{b(!1),console.error("Error fetching data:",T)})},R=E=>{const T=L+"/find-public-design/"+E;be.get(T).then(H=>{const{object:Y}=H==null?void 0:H.data;Y&&(window.location.href=`/design-center/${Y.pdid}`)}).catch(H=>{console.error("Error fetching data:",H)})},D=()=>u?u.object.map((E,T)=>e.jsx(h.Fragment,{children:e.jsxs("div",{style:{position:"relative",backgroundColor:"#ffffff",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",borderRadius:"2px",overflow:"hidden",marginBottom:"9px"},tabIndex:0,className:"apc-mpx-widget-responsive-image-container",onClick:()=>R(E.fabricID),children:[e.jsxs("div",{style:{position:"absolute",top:0,right:0,backgroundColor:i.secondaryColor,padding:"5px",zIndex:1,color:"#ffffff"},children:["$",E.product.price]}),e.jsx("img",{src:E.imageURL,alt:E.description,className:"apc-mpx-widget-responsive-image"}),e.jsx("div",{children:E.product.name})]})},T)):null;return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.jsx("div",{children:e.jsx("input",{placeholder:"Search templates",type:"text",onChange:E=>v(E.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`,height:"40px"}})}),e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>I(),style:{backgroundColor:i.primaryColor,color:"#ffffff",height:"35px"},children:p?"...Processing":"Search"})})]}),s?e.jsxs("div",{style:{color:"orangered",fontWeight:"bold"},children:[e.jsx("br",{}),s]}):null,e.jsx("br",{})," ",e.jsx("br",{})," ",e.jsx("br",{}),D()]})}const Kr={fontFamily:"Arial",fontSize:"40px",color:"transparent",background:"linear-gradient(to bottom, red 0%, yellow 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",cursor:"pointer"},qr={fontFamily:"comic sans ms",fontSize:"40px",color:"#000",width:"300px",textShadow:`
31
+ -1px -1px 0 #ff0000,
32
+ 1px -1px 0 #ff0000,
33
+ -1px 1px 0 #ff0000,
34
+ 1px 1px 0 #ff0000`,cursor:"pointer"},Xr={fontFamily:"Arial",fontSize:"40px",color:"#000",width:"300px",transform:"skewX(20deg) skewY(10deg)",textAlign:"center",cursor:"pointer"},Qr={fontFamily:"Arial",fontSize:"40px",color:"#000",textShadow:"0 0 10px green",textAlign:"center",cursor:"pointer"},Zr={fontFamily:"Arial",fontSize:"40px",color:"#000",backgroundColor:"orange",borderRadius:"5px",cursor:"pointer"},es={color:"black",fontSize:"40px",opacity:"0.5",fontFamily:"Arial, sans-serif",cursor:"pointer"};function ts(f){const{apcCanvasInstance:t,isMobile:i,closeMobileModalSecondaryPanel:o}=f,l=(n,v)=>{const p=new _.fabric.Textbox("Stay Humble!",{width:300,left:200,top:200,fontFamily:n,fill:v,hasControls:!0});t.add(p),t.setActiveObject(p),i&&o(!0)},x=({primaryTextLabel:n,primaryTextFontFamily:v,primaryTextColor:p,secondaryTextLabel:b,SecondaryTextFontFamily:s,secondaryTextColor:C})=>{const L=new _.fabric.Textbox(n,{fontFamily:v,width:300,left:200,top:200,fill:p}),I=new _.fabric.Textbox(b,{fontFamily:s,fill:C,fontSize:12,width:150});I.top=L.top+L.height+10,I.left=L.left,t.add(L),t.add(I),t.setActiveObject(L),i&&o(!0)},g=(n,v)=>{const p=new _.fabric.Textbox("Adventure Awaits!",{width:300,left:200,top:200,fontFamily:n,fill:v}),b={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5};p.shadow=b,t.add(p),t.setActiveObject(p),i&&o(!0)},d=()=>{const n=new _.fabric.Textbox("Love More",{left:100,top:100,width:300,fontFamily:"Arial",fill:new _.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:50},colorStops:[{offset:0,color:"red"},{offset:1,color:"yellow"}]})});t.add(n),t.setActiveObject(n),i&&o(!0)},y=()=>{const n=new _.fabric.Textbox("Good Vibes Only",{left:150,top:150,fontFamily:"comic sans ms",fontSize:40,width:300,fill:"#000",stroke:"#ff0000",strokeWidth:2});t.add(n),t.setActiveObject(n),i&&o(!0)},a=()=>{const n=new _.fabric.Textbox("Dream Big",{left:300,top:300,width:300,fontFamily:"Arial",fill:"#000",skewX:20,skewY:10});t.add(n),t.setActiveObject(n),i&&o(!0)},j=()=>{const n=new _.fabric.Textbox("Choose Joy",{left:350,top:350,fontFamily:"Arial",fill:"#000",opacity:.5});t.add(n),t.setActiveObject(n),i&&o(!0)},u=()=>{const n=new _.fabric.Textbox("Find Your Fire",{left:550,top:550,fontFamily:"Arial",fill:"#000",shadow:"yellow 0 0 10px"});t.add(n),t.setActiveObject(n),i&&o(!0)},w=()=>{const n=new _.fabric.Textbox("Be Kind",{left:650,top:650,fontFamily:"Arial",fill:"#000",backgroundColor:"orange"});t.add(n),t.setActiveObject(n),i&&o(!0)};return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("div",{style:{fontSize:"20px",cursor:"pointer"},onClick:()=>l("Arial, sans-serif","#6a45d2"),children:e.jsx("span",{style:{color:"#6a45d2",fontFamily:"Arial, sans-serif",fontSize:"30px"},children:"Stay Humble "})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer"},onClick:()=>x({primaryTextLabel:"Life is full of",primaryTextFontFamily:"Rock Salt, cursive",primaryTextColor:"black",secondaryTextLabel:"surprises",SecondaryTextFontFamily:"Arial, sans-serif",secondaryTextColor:"black"}),children:e.jsxs("span",{style:{color:"black",fontFamily:"Rock Salt, cursive",fontSize:"30px"},children:["Life is full of ",e.jsx("div",{style:{fontFamily:"Arial, sans-serif",fontSize:"14px"},children:"surprises"})," "]})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer",paddingLeft:"20px"},onClick:()=>x({primaryTextLabel:"You are invited!",primaryTextFontFamily:"Bilbao Swash Caps",primaryTextColor:"green",secondaryTextLabel:"Taste the best wines from the best makers",SecondaryTextFontFamily:"Arial, sans-serif",secondaryTextColor:"green"}),children:e.jsxs("span",{style:{color:"green",fontFamily:"Bilbao Swash Caps",fontSize:"30px"},children:["You are invited! ",e.jsx("div",{style:{color:"green",fontFamily:"Arial, sans-serif",fontSize:"14px",textAlign:"right"},children:"Taste the best wines from the best makers"})," "]})}),e.jsx("div",{style:{fontSize:"20px",cursor:"pointer",paddingLeft:"20px"},onClick:()=>g("aclonica","#6a45d2"),children:e.jsx("span",{style:{color:"#6a45d2",fontFamily:"aclonica",fontSize:"30px",textShadow:"2px 2px 4px rgba(0, 0, 0, 2)"},children:"Adventure Awaits "})}),e.jsx("div",{onClick:()=>d(),style:Kr,children:"Love More"}),e.jsx("div",{onClick:()=>y(),style:qr,children:"Good Vibes Only"}),e.jsx("div",{onClick:()=>a(),style:Xr,children:"Dream Big"}),e.jsx("div",{onClick:()=>u(),style:Qr,children:"Find Your Fire"}),e.jsx("div",{onClick:()=>w(),style:Zr,children:"Be Kind"}),e.jsx("div",{onClick:()=>j(),style:es,children:"Choose Joy"})]})})}const Dt=async f=>{try{const i=await(await fetch(f)).blob();return new Promise((o,l)=>{const x=new FileReader;x.onloadend=()=>o(x.result),x.onerror=l,x.readAsDataURL(i)})}catch(t){throw console.error("Error converting image to base64:",t),t}};function rs({apcCanvasInstance:f,theme:t}){const[i,o]=h.useState(!1),l=a=>{const j=a.target.files[0];if(j){const u=new FileReader;u.onload=w=>g(w.target.result),u.readAsDataURL(j)}},x=a=>{a.preventDefault(),o(!1);const j=a.dataTransfer.files[0];if(j){const u=new FileReader;u.onload=w=>g(w.target.result),u.readAsDataURL(j)}},g=a=>{_.fabric.Image.fromURL(a,j=>{j.set({left:100,top:100,scaleX:.5,scaleY:.5}),f.add(j)})},d=a=>{a.preventDefault(),o(!0)},y=()=>{o(!1)};return e.jsxs("div",{style:{border:i?"2px dashed #4CAF50":"2px dashed #ccc",padding:"40px",margin:"20px",borderRadius:"10px",textAlign:"center",backgroundColor:i?"#f0fff4":"#f9f9f9",transition:"background-color 0.3s",cursor:"pointer",position:"relative"},onDragOver:d,onDragLeave:y,onDrop:x,onClick:()=>document.getElementById("file-input").click(),children:[e.jsx("input",{type:"file",accept:"image/*",style:{display:"none"},id:"file-input",onChange:l}),e.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:i?"#4CAF50":"#ccc",fontSize:"48px"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 512 512",style:{fill:t.primaryColor},children:e.jsx("path",{d:Bt})}),e.jsx("br",{})," ",e.jsx("br",{})]}),e.jsx("label",{htmlFor:"file-input",style:{display:"block",marginTop:"80px",fontSize:"16px",color:"#333"},children:"Click or drag & drop to upload an image"}),e.jsx("div",{style:{fontSize:"12px",color:"#888"},children:"Supports PNG, JPG, WEBP formats"})]})}function ot(f){const{featureText:t}=f;return e.jsxs("div",{style:{padding:"10px"},children:[t??"This is a premium feature. Get API key here","  ",e.jsx("a",{href:"https://mypixia.com/api-key",target:"_blank",children:"https://mypixia.com/api-key"}),e.jsx("br",{})]})}function ct(){return e.jsxs("div",{className:"loading-container",children:[e.jsxs("div",{className:"spinner",children:[e.jsx("div",{className:"spinner-circle"}),e.jsx("div",{className:"spinner-circle-inner"})]}),e.jsx("p",{className:"loading-text",children:"Loading..."})]})}function ss(f){const{apcCanvasInstance:t,theme:i,apiKey:o,apiEndpoint:l,isMobile:x,closeMobileModalSecondaryPanel:g}=f,[d,y]=h.useState("flowers"),[a,j]=h.useState(!1),[u,w]=h.useState(),[n,v]=h.useState(!1),[p,b]=h.useState(!1),s=sessionStorage.getItem("apc_x_sub_status"),C=`${l}/api/v1/designer`;h.useEffect(()=>{I()},[]),h.useEffect(()=>{(async()=>{s==="active"?(v(!0),b(!0)):(j(!0),await L())})()},[]);const L=()=>{j(!0);const T=`${C}/get-subscription-status/${o}`;be.get(T).then(H=>{H.data.object&&H.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),v(!0))}).catch(H=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{j(!1),b(!0)})},I=()=>{j(!0);const T={"X-Api-Key":o},H=`${C}/get-images/${d}`;be.get(H,{headers:T}).then(Y=>{var J;j(!1),w((J=Y.data)==null?void 0:J.object)}).catch(Y=>{console.error("Error fetching data:",Y),j(!1)})},R=async T=>{const H=await Dt(T);H&&_.fabric.Image.fromURL(H,Y=>{Y.set({left:0,top:0,scaleX:.3,scaleY:.3}),t.add(Y)}),x&&g(!0)},D=()=>u?e.jsx("div",{children:u.map(T=>e.jsx("div",{onClick:()=>R(T.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:T.urls.regular,alt:T.description||"No description"})},T.id))}):null,E=()=>!n&&!a&&p?e.jsx(ot,{featureText:"Get premium AI images with subscription at "}):n&&!a&&p?e.jsxs("div",{children:[e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:T=>y(T.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>I(),style:{backgroundColor:i.primaryColor,color:"#ffffff"},children:a?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),D()]}):e.jsx(ct,{});return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx(rs,{apcCanvasInstance:t,theme:i}),e.jsx("br",{}),e.jsx("br",{}),E()]})}function zt(f){const{apcCanvasInstance:t,theme:i,isMobile:o,closeMobileModalSecondaryPanel:l}=f,x=b=>{const s=new _.fabric.Rect({width:100,height:60,left:200,top:200,fill:"",stroke:i.primaryColor});t.add(s),t.setActiveObject(s),o&&l(!0)},g=b=>{const s=new _.fabric.Circle({radius:30,fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},d=b=>{const s=new _.fabric.Triangle({width:40,height:50,fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},y=b=>{const s=new _.fabric.Line([50,10,250,10],{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},a=(b,s,C)=>{const L=s,I=s,R=Math.PI/b;let D=[],E=0;for(let T=0;T<b;T++){let H=L+Math.cos(E)*s,Y=I+Math.sin(E)*s;D.push({x:H,y:Y}),E+=R,H=L+Math.cos(E)*C,Y=I+Math.sin(E)*C,D.push({x:H,y:Y}),E+=R}return D},j=(b,s)=>{const C=Math.PI*2/b,L=s,I=s,R=[];for(let D=0;D<b;D++){const E=L+s*Math.cos(D*C),T=I+s*Math.sin(D*C);R.push({x:E,y:T})}return R},u=b=>{const s=a(5,60,30),C=new _.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:i.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);t.add(C),t.setActiveObject(C),o&&l(!0)},w=b=>{const s=j(6,30),C=new _.fabric.Polygon(s,{left:200,top:200,fill:"",stroke:i.primaryColor,strokeWidth:2,strokeLineJoin:"bevil"},!1);t.add(C),t.setActiveObject(C),o&&l(!0)},n=b=>{const s=new _.fabric.Path(yt,{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},v=b=>{const s=new _.fabric.Path(wt,{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)},p=b=>{const s=new _.fabric.Path(dt,{fill:"",stroke:i.primaryColor,left:200,top:200});t.add(s),t.setActiveObject(s),o&&l(!0)};return t?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("div",{onClick:b=>x(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"76",width:"76",viewBox:"0 0 712 712",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:"M512 512H0V0h512v512z"})})}),e.jsx("div",{onClick:b=>g(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"66",width:"66",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})})}),e.jsx("div",{onClick:b=>d(),draggable:!0,style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"106",width:"106",viewBox:"0 0 320 512",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:"M288.7 352H31.3c-17.8 0-26.7-21.5-14.1-34.1l128.7-128.7c7.8-7.8 20.5-7.8 28.3 0l128.7 128.7c12.6 12.6 3.7 34.1-14.1 34.1z"})})}),e.jsx("div",{onClick:b=>u(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 576 512",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"})})}),e.jsx("div",{onClick:b=>w(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:i.primaryColor,height:"80px",width:"80px",version:"1.1",id:"Capa_1",viewBox:"0 0 184.751 184.751",children:e.jsx("path",{d:"M0,92.375l46.188-80h92.378l46.185,80l-46.185,80H46.188L0,92.375z"})})}),e.jsx("div",{onClick:b=>y(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",strokeWidth:"4",stroke:i.primaryColor,id:"Capa_1",width:"86px",height:"86px",viewBox:"0 0 290.658 290.658",children:e.jsx("g",{children:e.jsx("g",{children:e.jsx("rect",{y:"139.474",style:{fill:i.primaryColor},width:"290.658",height:"1.711"})})})})}),e.jsx("div",{onClick:b=>n(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:yt})})}),e.jsx("div",{onClick:b=>v(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 512 512",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:wt})})}),e.jsx("div",{onClick:b=>p(),style:{fontSize:"50px",cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"86",width:"86",viewBox:"0 0 448 512",fill:"none",strokeWidth:"4",stroke:i.primaryColor,children:e.jsx("path",{d:dt})})})]}):null}function ns(f){const{apcCanvasInstance:t,theme:i,isMobile:o,closeMobileModalSecondaryPanel:l}=f,x=d=>{const y=new _.fabric.Path(d,{left:200,top:200,fill:i.primaryColor,scaleX:.1,scaleY:.1});t.add(y),t.setActiveObject(y),o&&l(!0)},g=d=>{switch(d){case"icon-phone":x(fr);break;case"icon-question":x(ur);break;case"icon-clock":x(xr);break;case"icon-twitter":x(gr);break;case"icon-check":x(mr);break;case"icon-pointer":x(vr);break;case"icon-mail":x(jr);break;case"icon-dollar":x(br);break;case"icon-graduation":x(Ct);break;case"icon-business-suit":x(yr);break;case"icon-chat":x(wr);break;case"icon-thumbs-up":x(Cr);break;case"icon-wifi":x(Sr);break;case"icon-info":x(Nt);break;case"icon-cart":x(kt);break;case"icon-comment":x(St);break;case"icon-location-map":x(Ot);break;case"icon-heart-1":x(At);break;case"icon-arrow-right-1":x(dt);break;case"icon-xmark":x(It);break;case"icon-cloud":x(Et);break;case"icon-smile":x(Tt);break;case"icon-like":x(Mt);break;default:console.log("no matching type")}};return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{padding:"5px"},className:o?"apc-mpx-widget-secondary-icons-mobile":"apc-mpx-widget-secondary-icons",children:[e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-phone"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:"M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-question"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:e.jsx("path",{fill:i.primaryColor,d:"M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74V320c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-clock"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:"M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-twitter"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-check"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:i.primaryColor,d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-pointer"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:i.primaryColor,d:"M160 64c0-8.8 7.2-16 16-16s16 7.2 16 16V200c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c8.8 0 16 7.2 16 16c0 10.3 6.6 19.5 16.4 22.8s20.6-.1 26.8-8.3c3-3.9 7.6-6.4 12.8-6.4c7.8 0 14.3 5.6 15.7 13c1.6 8.2 7.3 15.1 15.1 18s16.7 1.6 23.3-3.6c2.7-2.1 6.1-3.4 9.9-3.4c8.8 0 16 7.2 16 16l0 16V392c0 39.8-32.2 72-72 72H272 212.3h-.9c-37.4 0-72.4-18.7-93.2-49.9L50.7 312.9c-4.9-7.4-2.9-17.3 4.4-22.2s17.3-2.9 22.2 4.4L116 353.2c5.9 8.8 16.8 12.7 26.9 9.7s17-12.4 17-23V320 64zM176 0c-35.3 0-64 28.7-64 64V261.7C91.2 238 55.5 232.8 28.5 250.7C-.9 270.4-8.9 310.1 10.8 339.5L78.3 440.8c29.7 44.5 79.6 71.2 133.1 71.2h.9H272h56c66.3 0 120-53.7 120-120V288l0-16c0-35.3-28.7-64-64-64c-4.5 0-8.8 .5-13 1.3c-11.7-15.4-30.2-25.3-51-25.3c-6.9 0-13.5 1.1-19.7 3.1C288.7 170.7 269.6 160 248 160c-2.7 0-5.4 .2-8 .5V64c0-35.3-28.7-64-64-64zm48 304c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304zm48-16c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16s16-7.2 16-16V304z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-mail"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:"M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-dollar"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 320 512",children:e.jsx("path",{fill:i.primaryColor,d:"M160 0c17.7 0 32 14.3 32 32V67.7c1.6 .2 3.1 .4 4.7 .7c.4 .1 .7 .1 1.1 .2l48 8.8c17.4 3.2 28.9 19.9 25.7 37.2s-19.9 28.9-37.2 25.7l-47.5-8.7c-31.3-4.6-58.9-1.5-78.3 6.2s-27.2 18.3-29 28.1c-2 10.7-.5 16.7 1.2 20.4c1.8 3.9 5.5 8.3 12.8 13.2c16.3 10.7 41.3 17.7 73.7 26.3l2.9 .8c28.6 7.6 63.6 16.8 89.6 33.8c14.2 9.3 27.6 21.9 35.9 39.5c8.5 17.9 10.3 37.9 6.4 59.2c-6.9 38-33.1 63.4-65.6 76.7c-13.7 5.6-28.6 9.2-44.4 11V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V445.1c-.4-.1-.9-.1-1.3-.2l-.2 0 0 0c-24.4-3.8-64.5-14.3-91.5-26.3c-16.1-7.2-23.4-26.1-16.2-42.2s26.1-23.4 42.2-16.2c20.9 9.3 55.3 18.5 75.2 21.6c31.9 4.7 58.2 2 76-5.3c16.9-6.9 24.6-16.9 26.8-28.9c1.9-10.6 .4-16.7-1.3-20.4c-1.9-4-5.6-8.4-13-13.3c-16.4-10.7-41.5-17.7-74-26.3l-2.8-.7 0 0C119.4 279.3 84.4 270 58.4 253c-14.2-9.3-27.5-22-35.8-39.6c-8.4-17.9-10.1-37.9-6.1-59.2C23.7 116 52.3 91.2 84.8 78.3c13.3-5.3 27.9-8.9 43.2-11V32c0-17.7 14.3-32 32-32z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-graduation"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:i.primaryColor,d:Ct})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-business-suit"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:i.primaryColor,d:"M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 352h8.2c32.3-39.1 81.1-64 135.8-64c5.4 0 10.7 .2 16 .7V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM320 352H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H360.2C335.1 449.6 320 410.5 320 368c0-5.4 .2-10.7 .7-16l-.7 0zm320 16a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 288c8.8 0 16 7.2 16 16v48h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H496c-8.8 0-16-7.2-16-16V304c0-8.8 7.2-16 16-16z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-chat"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:i.primaryColor,d:"M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.7 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-thumbs-up"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:"M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-wifi"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:i.primaryColor,d:"M54.2 202.9C123.2 136.7 216.8 96 320 96s196.8 40.7 265.8 106.9c12.8 12.2 33 11.8 45.2-.9s11.8-33-.9-45.2C549.7 79.5 440.4 32 320 32S90.3 79.5 9.8 156.7C-2.9 169-3.3 189.2 8.9 202s32.5 13.2 45.2 .9zM320 256c56.8 0 108.6 21.1 148.2 56c13.3 11.7 33.5 10.4 45.2-2.8s10.4-33.5-2.8-45.2C459.8 219.2 393 192 320 192s-139.8 27.2-190.5 72c-13.3 11.7-14.5 31.9-2.8 45.2s31.9 14.5 45.2 2.8c39.5-34.9 91.3-56 148.2-56zm64 160a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z"})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-info"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:Nt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-cart"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 576 512",children:e.jsx("path",{fill:i.primaryColor,d:kt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-comment"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:St})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-location-map"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:e.jsx("path",{fill:i.primaryColor,d:Ot})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-heart-1"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:At})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-arrow-right-1"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:i.primaryColor,d:kr})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-xmark"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 384 512",children:e.jsx("path",{fill:i.primaryColor,d:It})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-cloud"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 640 512",children:e.jsx("path",{fill:i.primaryColor,d:Et})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-smile"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:Tt})})}),e.jsx("div",{className:"apc-mpx-widget-secondary-icon",onClick:d=>g("icon-like"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:i.primaryColor,d:Mt})})})]})})}const qe=({defaultValue:f,size:t,ariaLabel:i,onChange:o})=>{const[l,x]=h.useState(f),g=d=>{const y=d.target.value;x(y),o(y)};return e.jsx("input",{type:"range",value:l,min:"0",max:"100",step:"1",className:`slider ${t}`,"aria-label":i,onChange:g})};function Rt(f){const{apcCanvasInstance:t,theme:i}=f,[o,l]=h.useState(!1),x=h.useRef(null),g=()=>{l(n=>!n)},d=n=>{x.current&&x.current.contains(n.target)||l(!1)};h.useEffect(()=>(document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}),[]);const y=(n,v)=>{if(t.getActiveObject()){if(v==="family"&&t.getActiveObject().set({fontFamily:n}),v==="bold"&&t.getActiveObject().set({fontWeight:n}),v==="italic"&&t.getActiveObject().set({fontStyle:n}),v==="underline"&&t.getActiveObject().set({underline:n}),v==="line-through"&&t.getActiveObject().set({linethrough:n}),v==="overline"&&t.getActiveObject().set({overline:n}),v==="color"&&t.getActiveObject().set({fill:n}),v==="shadow"){const p=document.getElementById("apc-text-shadow-color").value;let b=document.getElementById("apc-text-shadow-horiz").value,s=document.getElementById("apc-text-shadow-vert").value,C=document.getElementById("apc-text-shadow-blur").value;b||(b=5),s||(s=5),C||(C=5),t.getActiveObject().set({shadow:p+" "+b+" "+s+" "+C})}if(v==="stroke"){const p=document.getElementById("apc-text-stroke-color").value;let b=document.getElementById("apc-text-stroke-width").value;b||(b=1),t.getActiveObject().set({stroke:p,strokeWidth:b})}v==="bg-color"&&t.getActiveObject().set({textBackgroundColor:n}),v==="font-size"&&t.getActiveObject().set({fontSize:n}),t&&t.renderAll()}},a=n=>{if(t.getActiveObject()){const v=parseFloat(n/100);t.getActiveObject().set({opacity:v.toFixed(1)}),t&&t.renderAll()}},j=({color:n,x:v,y:p,blur:b})=>{if(t.getActiveObject()){const s=t.getActiveObject().shadow;n||(n=s?s.color:"#6a45d2"),v||(v=s?s.offsetX:5),p||(p=s?s.offsetY:5),b||(b=s?s.blur:5),t.getActiveObject().set({shadow:n+" "+v+" "+p+" "+b}),t&&t.renderAll()}},u=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[" ",e.jsx("button",{className:"apc-mpx-widget-effects-button",onClick:g,style:{color:i.primaryColor,cursor:"pointer"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",height:"15px",width:"15px",children:e.jsx("path",{fill:i.primaryColor,d:Pr})})}),o&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:x,children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{id:"split-button-menu",autoFocus:!0,children:[e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Background"}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:n=>y(n.target.value,"bg-color")})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Opacity",e.jsx("div",{children:e.jsx(qe,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:n=>a(n)})})]})]})}),e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Shadow"}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Blur ",e.jsx("input",{type:"text",style:{height:"22px",width:"20px"},onChange:n=>j({blur:n.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:n=>j({color:n.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset X",e.jsx("div",{children:e.jsx(qe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:n=>j({x:n})})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Offset Y",e.jsx("div",{children:e.jsx(qe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:n=>j({y:n})})})]})]})})]})]})]});return e.jsx(h.Fragment,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",color:"#ffffff"},children:[e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px"},children:e.jsx("input",{style:{height:"20px",width:"30px",border:"solid 0px #ffffff"},type:"color",onChange:n=>y(n.target.value,"color")})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsxs("select",{style:{height:"20px",border:"solid 0px #ffffff"},id:"ffamily",onChange:n=>y(n.target.value,"family"),children:[e.jsx("option",{value:"comic sans ms",children:"Comic Sans MS"}),e.jsx("option",{value:"frankruehl",children:"FrankRuehl"}),e.jsx("option",{value:"lucida Bright",children:"Lucida Bright"}),e.jsx("option",{value:"bradley Hand",children:"Bradley Hand"}),e.jsx("option",{value:"Times New Roman",children:"Times New Roman"}),e.jsx("option",{value:"Georgia",children:"Georgia"}),e.jsx("option",{value:"Garamond",children:"Garamond"}),e.jsx("option",{value:"Baskerville",children:"Baskerville"}),e.jsx("option",{value:"Palatino",children:"Palatino"}),e.jsx("option",{value:"Book Antiqua",children:"Book Antiqua"}),e.jsx("option",{value:"Arial",children:"Arial"}),e.jsx("option",{value:"Helvetica",children:"Helvetica"}),e.jsx("option",{value:"Verdana",children:"Verdana"}),e.jsx("option",{value:"Tahoma",children:"Tahoma"}),e.jsx("option",{value:"Futura",children:"Futura"}),e.jsx("option",{value:"Calibri",children:"Calibri"}),e.jsx("option",{value:"Courier New",children:"Courier New"}),e.jsx("option",{value:"Consolas",children:"Consolas"}),e.jsx("option",{value:"Monaco",children:"Monaco"}),e.jsx("option",{value:"Brush Script",children:"Brush Script"}),e.jsx("option",{value:"Lucida Handwriting",children:"Lucida Handwriting"}),e.jsx("option",{value:"Zapfino",children:"Zapfino"}),e.jsx("option",{value:"Impact",children:"Impact"}),e.jsx("option",{value:"Cooper Black",children:"Cooper Black"}),e.jsx("option",{value:"Papyrus",children:"Papyrus"}),e.jsx("option",{value:"Comic Sans MS",children:"Comic Sans MS"}),e.jsx("option",{value:"Gotham",children:"Gotham"}),e.jsx("option",{value:"Franklin Gothic",children:"Franklin Gothic"}),e.jsx("option",{value:"DIN",children:"DIN"}),e.jsx("option",{value:"Rockwell",children:"Rockwell"}),e.jsx("option",{value:"Century Gothic",children:"Century Gothic"}),e.jsx("option",{value:"Trebuchet MS",children:"Trebuchet MS"}),e.jsx("option",{value:"Lobster",children:"Lobster"}),e.jsx("option",{value:"Roboto",children:"Roboto"}),e.jsx("option",{value:"Myriad Pro",children:"Myriad Pro"}),e.jsx("option",{value:"Gill Sans",children:"Gill Sans"}),e.jsx("option",{value:"Bodoni",children:"Bodoni"}),e.jsx("option",{value:"Perpetua",children:"Perpetua"}),e.jsx("option",{value:"Akzidenz-Grotesk",children:"Akzidenz-Grotesk"}),e.jsx("option",{value:"Source Sans Pro",children:"Source Sans Pro"}),e.jsx("option",{value:"Lato",children:"Lato"}),e.jsx("option",{value:"Noto Sans",children:"Noto Sans"}),e.jsx("option",{value:"Open Sans",children:"Open Sans"}),e.jsx("option",{value:"Montserrat",children:"Montserrat"})]})})," ",e.jsx("div",{style:{marginTop:"4px"},children:e.jsx("input",{defaultValue:40,style:{width:"50px",height:"20px",border:"solid 0px #ffffff"},type:"number",onChange:n=>y(n.target.value,"font-size")})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:n=>t.getActiveObject().fontWeight==="normal"?y("bold","bold"):y("normal","bold"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 384 512",children:e.jsx("path",{fill:"#ffffff",d:"M333.5 238a122 122 0 0 0 27-65.2C367.9 96.5 308 32 233.4 32H34a16 16 0 0 0 -16 16v48a16 16 0 0 0 16 16h31.9v288H34a16 16 0 0 0 -16 16v48a16 16 0 0 0 16 16h209.3c70.8 0 134.1-51.8 141-122.4 4.7-48.5-16.4-92.1-50.8-119.6zM145.7 112h87.8a48 48 0 0 1 0 96h-87.8zm87.8 288h-87.8V288h87.8a56 56 0 0 1 0 112z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:n=>t.getActiveObject().fontStyle==="normal"?y("italic","italic"):y("normal","italic"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 320 512",children:e.jsx("path",{fill:"#ffffff",d:"M320 48v32a16 16 0 0 1 -16 16h-62.8l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1 -16 16H16a16 16 0 0 1 -16-16v-32a16 16 0 0 1 16-16h62.8l80-320H112a16 16 0 0 1 -16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button",onClick:n=>t.getActiveObject().underline?y(!1,"underline"):y(!0,"underline"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:"M32 64h32v160c0 88.2 71.8 160 160 160s160-71.8 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0 -16-16H272a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1 -160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0 -16-16H32a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16z"})})}),e.jsx("div",{style:{marginTop:"4px",marginLeft:"2px",cursor:"pointer"},role:"button","aria-label":"Italics",onClick:n=>t.getActiveObject().linethrough?y(!1,"line-through"):y(!0,"line-through"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:"M496 224H293.9l-87.2-26.8A43.6 43.6 0 0 1 219.6 112h66.8A49.9 49.9 0 0 1 331 139.6a16 16 0 0 0 21.5 7.2l42.9-21.5a16 16 0 0 0 7.2-21.5l-.5-1A128 128 0 0 0 287.5 32h-68a123.7 123.7 0 0 0 -123 135.6c2 20.9 10.1 39.8 21.8 56.4H16a16 16 0 0 0 -16 16v32a16 16 0 0 0 16 16h480a16 16 0 0 0 16-16v-32a16 16 0 0 0 -16-16zm-180.2 96A43 43 0 0 1 336 356.5 43.6 43.6 0 0 1 292.5 400h-66.8A49.9 49.9 0 0 1 181 372.4a16 16 0 0 0 -21.5-7.2l-42.9 21.5a16 16 0 0 0 -7.2 21.5l.5 1A128 128 0 0 0 224.5 480h68a123.7 123.7 0 0 0 123-135.6 114.3 114.3 0 0 0 -5.3-24.4z"})})}),e.jsx("div",{children:u()})]})})}function Ye(f){const{apcCanvasInstance:t,theme:i}=f,o=h.useRef(null),[l,x]=h.useState(!1),g=()=>{x(u=>!u)},d=(u,w)=>{if(t&&t.getActiveObject()){if(u==="bg-color"&&t.getActiveObject().set({fill:w}),u==="border-color"&&t.getActiveObject().set({stroke:w}),u==="gradient-bg-color1"||u==="gradient-bg-color2"){let n=document.getElementById("apc-object-bg-gradient-color1").value,v=document.getElementById("apc-object-bg-gradient-color2").value;const p=new _.fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:0,y2:t.getActiveObject().height},colorStops:[{offset:0,color:n||"#000"},{offset:1,color:v||"#fff"}]});t.getActiveObject().set({fill:p})}t&&t.renderAll()}},y=u=>{if(t.getActiveObject()){const w=parseFloat(u/100);t.getActiveObject().set({opacity:w.toFixed(1)}),t&&t.renderAll()}},a=({color:u,x:w,y:n,blur:v})=>{if(t.getActiveObject()){const p=t.getActiveObject().shadow;u||(u=p?p.color:"#6a45d2"),w||(w=p?p.offsetX:5),n||(n=p?p.offsetY:5),v||(v=p?p.blur:5),t.getActiveObject().set({shadow:u+" "+w+" "+n+" "+v}),t&&t.renderAll()}};return e.jsx(h.Fragment,{children:e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("button",{className:"apc-mpx-widget-effects-button",onClick:g,style:{color:i.primaryColor,fontWeight:"bold",cursor:"pointer",borderRadius:"25px"},children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"22px",width:"22px",children:e.jsx("path",{fill:i.primaryColor,d:Fr})})}),l&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:o,style:{marginLeft:"20%"},children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{id:"split-button-menu",autoFocus:!0,children:[e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Background"}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>d("bg-color",u.target.value)})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Gradient:",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},className:"editor-color-input-selector",id:"apc-object-bg-gradient-color1",type:"color",onChange:u=>d("gradient-bg-color1",u.target.value)}),e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},className:"editor-color-input-selector",id:"apc-object-bg-gradient-color2",type:"color",onChange:u=>d("gradient-bg-color2",u.target.value)})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Opacity: ",e.jsx(qe,{defaultValue:100,size:"small","aria-label":"Opacity",onChange:u=>y(u)})]})}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Border color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>d("border-color",u.target.value)})]})]})}),e.jsx("li",{className:"apc-mpx-widget-popper-li",children:e.jsxs("div",{style:{textAlign:"left"},children:[e.jsx("div",{style:{fontWeight:"bold",color:"purple"},children:"Shadow"}),e.jsxs("div",{style:{marginLeft:"10px"},children:["Blur width ",e.jsx("input",{type:"text",style:{height:"22px",width:"25px"},onChange:u=>a({blur:u.target.value})})]}),e.jsxs("div",{style:{marginLeft:"10px"},children:[" Color",e.jsx("input",{style:{height:"25px",width:"25px",border:"none"},type:"color",onChange:u=>a({color:u.target.value})})]}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset X: ",e.jsx(qe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>a({x:u})})]})}),e.jsx("div",{style:{marginLeft:"10px"},children:e.jsxs("div",{children:["Offset Y: ",e.jsx(qe,{defaultValue:0,size:"small","aria-label":"Opacity",onChange:u=>a({y:u})})]})})]})})]})]})]})})}function is(f){const{apcCanvasInstance:t,apiEndpoint:i,apiKey:o}=f,[l,x]=h.useState("art"),[g,d]=h.useState(),[y,a]=h.useState(!1),j=i+"/api/v1/designer";h.useEffect(()=>{u()},[]);const u=()=>{a(!0);const p={"X-Api-Key":o},b=`${j}/get-quote/${l}`;be.get(b,{headers:p}).then(s=>{var C;a(!1),d((C=s.data)==null?void 0:C.object)}).catch(s=>{console.error("Error fetching data:",s),a(!1)})},w=(p,b,s)=>{const C=new _.fabric.Textbox(b,{width:500,left:100,top:200,fontSize:16}),L=new _.fabric.Textbox(s,{fontSize:14,width:200,fontWeight:"bold"});L.top=C.top+C.height+10,L.left=C.left,t.add(C),t.add(L),t.setActiveObject(C)},n=p=>{a(!0),x(p),u()},v=()=>g?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5},children:g.map((p,b)=>e.jsxs("div",{onClick:s=>w(s,p.quote,p.author),style:{cursor:"pointer",padding:"3px",textAlign:"left",color:"#210080",fontFamily:"ui-monospace",border:"1px solid #dedcdc",borderRadius:"8px"},children:[e.jsx("div",{children:p.quote}),e.jsx("div",{children:e.jsx("strong",{children:e.jsx("i",{children:p.author})})}),e.jsx("br",{})]},b))}):null;return e.jsxs(h.Fragment,{children:[e.jsx("h3",{children:"Quotes"}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:v()}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("br",{}),e.jsxs("div",{style:{padding:"3px"},children:[e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("best"),children:[l==="best"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Best"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("business"),children:[l==="business"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("car"),children:[l==="car"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Car"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("change"),children:[l==="change"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Change"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("computers"),children:[l==="computers"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Computers"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("cool"),children:[l==="cool"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Cool"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("courage"),children:[l==="courage"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Courage"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("dad"),children:[l==="dad"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Dad"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("dating"),children:[l==="dating"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Date"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("death"),children:[l==="death"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Death"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("design"),children:[l==="design"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Design"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("dreams"),children:[l==="dreams"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Dreams"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("education"),children:[l==="education"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Education"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("inspirational"),children:[l==="inspirational"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Inspirational"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("happiness"),children:[l==="happiness"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Happiness"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("health"),children:[l==="health"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Health"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("humor"),children:[l==="humor"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Humor"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("marriage"),children:[l==="marriage"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Marriage"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("money"),children:[l==="money"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Money"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("graduation"),children:[l==="graduation"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Graduation"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("hope"),children:[l==="hope"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Hope"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("love"),children:[l==="love"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Love"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("god"),children:[l==="god"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"God"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("equality"),children:[l==="equality"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Equality"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("failure"),children:[l==="failure"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Failure"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("fear"),children:[l==="fear"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Fear"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("legal"),children:[l==="legal"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Legal"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("attitude"),children:[l==="attitude"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Attitude"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("beauty"),children:[l==="beauty"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Beauty"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("age"),children:[l==="age"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Age"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("art"),children:[l==="art"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Art"]}),e.jsx("br",{}),e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>n("birthday"),children:[l==="birthday"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Birthday"]}),e.jsx("br",{})]})]})}function os(f){const{apcCanvasInstance:t,theme:i,apiKey:o,apiEndpoint:l,updateActiveSection:x,reloadTabs:g,currentTabNo:d,isMobile:y,closeMobileModalSecondaryPanel:a}=f,[j,u]=h.useState("background"),[w,n]=h.useState(!1),[v,p]=h.useState(),b=l+"/api/v1/designer";h.useEffect(()=>{C()},[]);const s=R=>{const D=document.getElementById("img-default-id"),E=new _.fabric.Image(D,T=>{T.set({left:100,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});t.add(E),y&&a(!0)},C=()=>{n(!0);const R={"X-Api-Key":o},D=`${b}/get-images/${j}`;be.get(D,{headers:R}).then(E=>{var T;n(!1),p((T=E.data)==null?void 0:T.object)}).catch(E=>{console.error("Error fetching data:",E),n(!1)})},L=R=>{_.fabric.Image.fromURL(R,function(D){D.width=t.width,D.height=t.height,D.scaleToWidth(t.width),D.scaleToHeight(t.height),t.setBackgroundImage(D);const E=localStorage.getItem("apc_x_activeTab"),T=JSON.stringify(t);Be(E,"general",T,null).then(H=>{g(d+1),t&&t.renderAll()})},{crossOrigin:"anonymous"})},I=()=>v?e.jsx("div",{children:v.map(R=>e.jsx("div",{onClick:()=>L(R.urls.regular),style:{cursor:"pointer"},children:e.jsx("img",{height:300,width:300,src:R.urls.regular,alt:R.description||"No description"})},R.id))}):null;return e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsxs("div",{style:{cursor:"pointer"},onClick:()=>s(),children:[e.jsx("img",{alt:"sample-image",id:"img-default-id",src:"https://mypixia.com/images/img-default.png",height:"200",width:"300"})," ",e.jsx("br",{}),"From my device"]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"- OR -"}),e.jsxs("div",{children:[e.jsx("input",{type:"text",onChange:R=>u(R.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>C(),style:{backgroundColor:i.primaryColor,color:"#ffffff"},children:w?"...Processing":"Search"})]}),e.jsx("br",{}),e.jsx("br",{}),I()]})}function cs(f){const[t,i]=h.useState(""),[o,l]=h.useState(""),[x,g]=h.useState(!1),[d,y]=h.useState(!1),[a,j]=h.useState(!1),{apcCanvasInstance:u,theme:w,isMobile:n,closeMobileModalSecondaryPanel:v,apiKey:p,apiEndpoint:b}=f,s=`${b}/api/v1/designer`,C=sessionStorage.getItem("apc_x_sub_status");h.useEffect(()=>{(async()=>{C==="active"?(y(!0),j(!0)):(g(!0),await L())})()},[]);const L=()=>{g(!0);const D=`${s}/get-subscription-status/${p}`;be.get(D).then(E=>{E.data.object&&E.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),y(!0))}).catch(E=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{g(!1),j(!0)})},I=()=>{sr.toDataURL(t,{width:300},(D,E)=>{D&&console.error(D),l(E)})},R=D=>{const E=document.getElementById("apc-qr-code-img"),T=new _.fabric.Image(E,H=>{H.set({left:200,top:200,scaleX:.5,scaleY:.5,imageSmoothing:!0})});u.add(T),u.setActiveObject(T),n&&v(!0)};return!d&&!x&&a?e.jsx(ot,{}):d&&!x&&a?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter data such as url",e.jsx("br",{}),e.jsx("input",{className:"apc-mpc-widget-input",style:{border:`solid 3px ${w.primaryColor}`},type:"text",onChange:D=>i(D.target.value)}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",style:{backgroundColor:w.primaryColor,color:"#ffffff"},disabled:!t,onClick:I,children:"Generate QR code"}),e.jsx("br",{}),e.jsx("br",{}),o&&e.jsxs("div",{className:"generated-view",onClick:()=>R(),style:{cursor:"pointer"},children:[e.jsx("img",{src:o,alt:"qr code",id:"apc-qr-code-img"}),e.jsx("a",{href:o})]})]}):e.jsx("div",{children:e.jsx(ct,{})})}function as(f){const{apcCanvasInstance:t,theme:i,isMobile:o,closeMobileModalSecondaryPanel:l,apiKey:x,apiEndpoint:g}=f,[d,y]=h.useState(""),[a,j]=h.useState(null),[u,w]=h.useState("CODE128"),n=h.useRef(null),[v,p]=h.useState(""),[b,s]=h.useState(!1),[C,L]=h.useState(!1),[I,R]=h.useState(!1),D=sessionStorage.getItem("apc_x_sub_status"),E=`${g}/api/v1/designer`;h.useEffect(()=>{(async()=>{D==="active"?(L(!0),R(!0)):(s(!0),await T())})()},[]);const T=()=>{s(!0);const J=`${E}/get-subscription-status/${x}`;be.get(J).then(oe=>{oe.data.object&&oe.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),L(!0))}).catch(oe=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{s(!1),R(!0)})},H=()=>{j(e.jsx(nr,{value:d,format:u,id:"barcode-element"}));const J=document.getElementById("barcode-element");J&&p(J.innerHTML)},Y=J=>{if(n.current.innerHTML){const oe=n.current.innerHTML;let re=new Image;re.src="data:image/svg+xml,"+encodeURIComponent(oe),re.onload=function(){const se=new _.fabric.Image(re,{left:200,top:200});t.add(se),t.setActiveObject(se)}}o&&l(!0)};return!C&&!b&&I?e.jsx(ot,{}):C&&!b&&I?e.jsxs(h.Fragment,{children:[e.jsx("br",{}),e.jsx("br",{}),"Enter number",e.jsx("input",{type:"text",onChange:J=>y(J.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}}),e.jsx("br",{}),e.jsx("br",{}),"Code type",e.jsxs("select",{value:u,onChange:J=>w(J.target.value),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`},children:[e.jsx("option",{value:"CODE128",children:"CODE128"}),e.jsx("option",{value:"EAN13",children:"EAN / UPC"}),e.jsx("option",{value:"CODE39",children:"CODE39"}),e.jsx("option",{value:"ITF14",children:"ITF-14"}),e.jsx("option",{value:"MSI10",children:"MSI10"}),e.jsx("option",{value:"pharmacode",children:"Pharmacode"}),e.jsx("option",{value:"codabar",children:"Codabar"})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("button",{className:"apc-mpc-widget-btn",disabled:!d,onClick:()=>H(),style:{backgroundColor:i.primaryColor,color:"#ffffff"},children:"Generate Barcode"}),e.jsx("br",{}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:a&&e.jsx("div",{ref:n,onClick:J=>Y(),style:{cursor:"pointer"},children:a})})]}):e.jsxs("div",{children:[" ",e.jsx(ct,{})]})}function ls(f){const{apcCanvasInstance:t,theme:i}=f,[o,l]=h.useState(),[x,g]=h.useState(),[d,y]=h.useState(""),a=(w,n)=>{if(t){if(w==="bg-color"&&n.target.value&&t.set({backgroundColor:n.target.value}),w==="image"&&n.target.value){const v=n.target.files[0],p=new FileReader;p.onload=function(b){const s=b.target.result;_.fabric.Image.fromURL(s,function(C){t.setBackgroundImage(C,t.renderAll.bind(t),{})})},p.readAsDataURL(v)}w==="height"&&n.target.value&&(l(n.target.value),t.setHeight(n.target.value)),w==="width"&&n.target.value&&(g(n.target.value),t.setWidth(n.target.value)),t&&t.renderAll()}},j=(w,n,v)=>{g(n),l(w),t.setWidth(n),t.setHeight(w),y(v)},u=()=>e.jsxs("div",{children:[e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Height(px)",e.jsx("input",{type:"number",value:t.height,onChange:w=>a("height",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}})]})})," ",e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:["Width(px)",e.jsx("input",{color:"info",type:"number",value:t.width,onChange:w=>a("width",w),className:"apc-mpc-widget-input",style:{border:`solid 3px ${i.primaryColor}`}})]})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{style:{textAlign:"left"},children:e.jsx("h3",{children:"Standard dimensions"})}),e.jsx("br",{})," ",e.jsx("br",{}),e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(1440,2560,"YOUC"),children:[d==="YOUC"?e.jsx("span",{style:{color:"green"},children:"✓"}):null," Youtube Channel : 2560 x 1440 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(1080,1920,"FULLHD"),children:[d==="FULLHD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Full HD : 1920 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(1080,1080,"INSTAP"),children:[d==="INSTAP"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Post:1080 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(1920,1080,"INSTAS"),children:[d==="INSTAS"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Story: 1080 x 1920 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(1080,1080,"INSTAA"),children:[d==="INSTAA"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Instagram Ad: 1080 x 1080 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(788,940,"FACEP"),children:[d==="FACEP"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Post: 940 x 788 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(315,851,"FACEC"),children:[d==="FACEC"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Cover: 851 x 315 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(628,1200,"FACEA"),children:[d==="FACEA"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Facebook Ad: 1200 x 628 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(720,1280,"YOUT"),children:[d==="YOUT"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Youtube Thumbnail: 1280 x 720 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(534,534,"INVITE"),children:[d==="INVITE"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Invitation : 14 x 14 cm"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(1112,788,"A4"),children:[d==="A4"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"A4 : 788 x 1112 px"]})}),e.jsx("br",{}),e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:20},children:e.jsxs("div",{style:{backgroundColor:"#e0e0e0"},className:"apc-mpx-widget-custom-chip",onClick:()=>j(192,336,"BUSINESSCARD"),children:[d==="BUSINESSCARD"?e.jsx("span",{style:{color:"green"},children:"✓"}):null,"Business card 3.5 x 2 in"]})})]})]});return e.jsx("div",{children:u()})}const fe=(f,t,i,o="png",l)=>new Promise((x,g)=>{const d=document.createElement("canvas"),y=JSON.parse(f),a=crypto.randomUUID();d.width=i,d.height=t;const j=new _.fabric.StaticCanvas(d,{selection:!1,height:y.height,width:y.width});j.loadFromJSON(y,function(){j.renderAll();const u=(w,n)=>{const v=URL.createObjectURL(w),p=document.createElement("a");p.href=v,p.download=n,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(v)};if(o.toLowerCase()==="svg"){const w=j.toSVG(),n=new Blob([w],{type:"image/svg+xml"});l&&u(n,"mypixia.svg"),x(new File([n],`${a}.svg`,{type:"image/svg+xml"}))}else if(o.toLowerCase()==="pdf"){const w=j.toDataURL("image/jpeg",1);import("jspdf").then(n=>{const v=new n.jsPDF({orientation:"landscape",unit:"px",format:[d.width,d.height]});v.addImage(w,"JPEG",0,0,d.width,d.height);const b=v.output("datauristring").split(",")[1],s=ds(b,"application/pdf"),C=new File([s],`${a}.pdf`,{type:"application/pdf"}),L=`${a}.pdf`;l&&u(C,L),x(C)}).catch(n=>{console.error("Error loading jsPDF: ",n),g(n)})}else{let w,n="image/png",v="png";switch(o.toLowerCase()){case"jpeg":w=j.toDataURL("image/jpeg",1),n="image/jpeg",v="jpg";break;case"webp":w=j.toDataURL("image/webp",1),n="image/webp",v="webp";break;default:w=j.toDataURL("image/png",1);break}const p=atob(w.split(",")[1]),b=new Array(p.length);for(let I=0;I<p.length;I++)b[I]=p.charCodeAt(I);const s=new Uint8Array(b),C=new File([s],`${a}.${v}`,{type:n}),L=`${a}.${v}`;l&&u(C,L),x(C)}})});function ds(f,t){const i=atob(f),o=new Array(i.length);for(let x=0;x<i.length;x++)o[x]=i.charCodeAt(x);const l=new Uint8Array(o);return new Blob([l],{type:t})}const hs=({children:f})=>Lt.createPortal(f,document.getElementById("apc-mpx-editor-modal-root"));function at(f){const{isOpen:t,onClose:i,children:o}=f;return t?e.jsx(hs,{children:e.jsx("div",{className:"apc-mpx-widget-modal-overlay",children:e.jsxs("div",{className:"apc-mpx-widget-modal",children:[e.jsx("button",{style:{color:"red"},className:"apc-mpx-widget-modal-close-btn",onClick:i,children:"Close"}),e.jsx("div",{className:"apc-mpx-widget-modal-content",children:o})]})})}):null}const xe=(f,t)=>{f=f.startsWith("#")?f:`#${f}`;let i=parseInt(f.slice(1,3),16),o=parseInt(f.slice(3,5),16),l=parseInt(f.slice(5,7),16);return i=parseInt(i*(100-t)/100),o=parseInt(o*(100-t)/100),l=parseInt(l*(100-t)/100),i=i.toString(16).padStart(2,"0"),o=o.toString(16).padStart(2,"0"),l=l.toString(16).padStart(2,"0"),`#${i}${o}${l}`};function Pt(f){const[t,i]=h.useState(""),{apcCanvasJSON:o,height:l,width:x}=f;return h.useEffect(()=>{const g=document.createElement("canvas"),d=JSON.parse(o);g.width=x,g.height=l;const y=new _.fabric.StaticCanvas(g,{selection:!1,height:d.height,width:d.width});y.loadFromJSON(d,function(){y.renderAll();const a=y.toDataURL("image/png",1);i(a)})},[]),t?e.jsx("div",{children:e.jsx("div",{className:"apc-mpx-widget-responsive-image-container",style:{cursor:"pointer",maxHeight:"500px",maxWidth:"500px"},children:e.jsx("img",{src:t,alt:"mypixia cool design",className:"apc-mpx-widget-responsive-image"})})}):"...processing"}function ps(f){const{theme:t,apcCanvasInstance:i}=f,[o,l]=h.useState(!1),[x,g]=h.useState(),d=()=>{l(!0)},y=()=>{l(!1)},a=()=>{if(!i)return null;const j=JSON.stringify(i);return e.jsxs(at,{isOpen:o,onClose:y,children:[e.jsx(Pt,{apcCanvasJSON:j,height:i.height,width:i.width}),e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:e.jsx(ne.FacebookShareButton,{url:x,children:e.jsx(ne.FacebookIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.TwitterShareButton,{url:x,title:"Hello",children:e.jsx(ne.XIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.TelegramShareButton,{url:x,title:"Hello",children:e.jsx(ne.TelegramIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.WhatsappShareButton,{url:x,title:"Hello",separator:":: ",children:e.jsx(ne.WhatsappIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.LinkedinShareButton,{url:x,children:e.jsx(ne.LinkedinIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.PinterestShareButton,{url:"https://static.mypixia.com",media:x,children:e.jsx(ne.PinterestIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.RedditShareButton,{url:x,title:"Hello",windowWidth:660,windowHeight:460,children:e.jsx(ne.RedditIcon,{size:32,round:!0})})}),e.jsx("div",{children:e.jsx(ne.InstapaperShareButton,{url:x,title:"Hello",children:e.jsx(ne.InstapaperIcon,{size:32,round:!0})})})]})}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>y(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(h.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>d(),role:"dialog",style:{backgroundColor:xe(t.primaryColor,40),color:"#ffffff",float:"right"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:Br})}),"  Share"]}),a()]})}function us(f){const{theme:t,apiKey:i,apcCanvasInstance:o,updateSelectedSections:l,updateActiveSection:x,accesories:g,getDesignFormats:d}=f,[y,a]=h.useState(!1),[j,u]=h.useState(),w=()=>{a(!0)},n=()=>{a(!1)},v=()=>({getPDF:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"pdf",!0).then(s=>s)},getPNG:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"png",!0).then(s=>s)},getSVG:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"svg",!0).then(s=>s)},getJPEG:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"jpeg",!0).then(s=>s)},getWEBP:()=>{const b=JSON.stringify(o);return fe(b,o.height,o.width,"webp",!0).then(s=>s)}}),p=()=>{if(!o)return null;const b=JSON.stringify(o);return e.jsxs(at,{isOpen:y,onClose:n,children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("h3",{style:{float:"left"},children:"Download"}),e.jsx("div",{children:e.jsx(Pt,{apcCanvasJSON:b,height:o.height,width:o.width})}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>v().getPDF(),children:"PDF"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>v().getSVG(),children:"SVG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>v().getPNG(),children:"PNG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>v().getJPEG(),children:"JPEG"}),e.jsx("div",{style:{color:xe(t.primaryColor,50),fontWeight:"bold",textDecoration:"underline",cursor:"pointer"},onClick:()=>v().getWEBP(),children:"WEBP"})]})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("hr",{}),e.jsx("br",{}),e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>n(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})]})};return e.jsxs(h.Fragment,{children:[e.jsxs("button",{className:"apc-mpc-widget-btn",onClick:()=>w(),role:"dialog",style:{backgroundColor:xe(t.primaryColor,40),color:"#ffffff",float:"right"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#ffffff",d:Dr})}),"  Download"]}),p()]})}function fs(f){var Ae;const{theme:t,activeSection:i,selectedObjectType:o,renderQuickActions:l,renderActionItems:x,canvasEl:g,zoomIn:d,zoomOut:y,apcCanvasInstance:a,setActiveSection:j,saveActiveDesign:u,reloadTabs:w,initProductName:n,historyRef:v,currentState:p,setCurrentState:b,setHistory:s,activeTabName:C,isPlainColor:L,selectedProduct:I,isMobile:R,supportedProductColors:D}=f,[E,T]=h.useState(),[H,Y]=h.useState([]),[J,oe]=h.useState(0),[re,se]=h.useState(!1),he=h.useRef(null),[Ee,ye]=h.useState(!1),[Xe,Te]=h.useState(null),[ee,De]=h.useState(),[Pe,Fe]=h.useState(),[Me,He]=h.useState(),[we,ge]=h.useState(!0),[$,ze]=h.useState(),Ne=()=>{ye(!0),se(!1)},X=()=>{ye(!1)},Ve=()=>{se(k=>!k)};h.useEffect(()=>{const k=O=>{he.current&&he.current.contains(O.target)||se(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),h.useEffect(()=>{(async()=>{var O,G;if(E)try{const B=await Ke(E);He(B),(O=B==null?void 0:B.misc)!=null&&O.colorSettings&&De(B.misc.colorSettings),((G=B==null?void 0:B.misc)==null?void 0:G.type)!=="subsection"&&ze(B)}catch(B){console.error("Error fetching tab data: ",B)}})()},[E,w]),h.useEffect(()=>{(async()=>{const O=await Ie();let G=O?O.filter(B=>{var Q;return B.classification!=="cart"&&((Q=B.misc)==null?void 0:Q.type)!=="subsection"}).map(B=>B.id):[];G.length===0&&G.push("design"),J===0&&T(G[0]),Y(G)})()},[J,w]);const le=()=>{a&&(a.clear(),a.renderAll())},pe=k=>{if(!a)return;a.backgroundColor="transparent",a&&a.requestRenderAll();let O=a.backgroundImage;O&&(O.filters=[],O.filters.push(new _.fabric.Image.filters.BlendColor({color:k})),O.applyFilters(),a&&a.requestRenderAll(),Fe(k),u(a,Me))},Ce=()=>{if(!(!ee||(ee==null?void 0:ee.length)<=1))return ee.map((k,O)=>e.jsxs(h.Fragment,{children:[e.jsx("div",{role:"button",className:"apc-mpx-widget-circle",style:{backgroundColor:k,cursor:"pointer",border:"solid 1px #ffffff"},onClick:()=>pe(k)})," "]},O))},me=async(k,O)=>{var ue,ve;const G=(ve=(ue=a==null?void 0:a.backgroundImage)==null?void 0:ue.filters[0])==null?void 0:ve.color,B=await Ke(k);if(!B)return;const Q=B!=null&&B.content?JSON.parse(B.content):null;Q&&a?(a.clear(),a.setBackgroundImage(null),a.loadFromJSON(Q,()=>{var te;a.renderAll(),j(B),((te=B==null?void 0:B.misc)==null?void 0:te.type)!=="subsection"?(localStorage.setItem("apc_x_activeTab",k),ge(!0)):(ge(!1),G&&pe(G)),T(k)})):console.error("Failed to load JSON content for section:",k)},Ue=()=>H.map(k=>e.jsx("button",{className:`tablinks ${E===k?"active":null}`,onClick:()=>me(k),children:k},k)),Se=()=>{Ie().then(k=>{if(k&&k.length>0){const O=k[0],G=JSON.parse(O.content);a.loadFromJSON(G,function(){a.off("object:modified"),a.on({"object:modified":B=>{u(a,O)}}),T(O.id),localStorage.setItem("apc_x_activeTab",O.id),j(O),oe(J+1),a&&a.renderAll()})}else{let O="design";const G=JSON.stringify(a);Be(O,"general",G,null).then(B=>{Ke(O).then(Q=>{const ue=JSON.parse(Q.content);a.loadFromJSON(ue,function(){a.off("object:modified"),a.on({"object:modified":ve=>{u(a,Q)}}),T(O),localStorage.setItem("apc_x_activeTab",O),j(Q),oe(J+1),a&&a.renderAll()})})})}})},Oe=()=>{Jr(E).then(k=>{X(),Se()})},We=()=>a?e.jsxs(at,{isOpen:Ee,onClose:X,children:[e.jsx("div",{children:e.jsxs("h3",{style:{marginLeft:"30%",color:"green"},children:["Are you sure you want to delete ",e.jsx("u",{children:E})," ?"]})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("hr",{}),e.jsx("br",{}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:10},children:[e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>Oe(),style:{backgroundColor:"green",color:"#ffffff"},children:"Yes"})}),e.jsx("div",{children:e.jsx("button",{autoFocus:!0,type:"button",className:"apc-mpc-widget-btn",onClick:()=>X(),style:{backgroundColor:"red",color:"#ffffff",float:"right"},children:"Close"})})]})]}):null,Qe=()=>e.jsxs("div",{className:"apc-mpx-widget-button-group-container",children:[e.jsx("div",{className:"apc-mpx-widget-generic-icon",onClick:Ve,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:Rr})})}),re&&e.jsxs("div",{className:"apc-mpx-widget-popper-container",ref:he,children:[e.jsx("div",{className:"apc-mpx-widget-popper-arrow-up"}),e.jsxs("ul",{autoFocus:!0,style:{paddingInlineStart:"2px",marginBlockStart:"6px",marginBlockEnd:"2px",fontSize:"13px",padding:"3px",color:xe(t.primaryColor,80),width:"max-content"},children:[e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",borderBottom:"1px solid #d7d7d7"},onClick:()=>Ne(),role:"dialog",children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{d:_t,fill:xe(t.primaryColor,80)})}),"  Delete"]}),e.jsxs("li",{className:"apc-mpx-widget-popper-li",style:{height:"25px",cursor:"pointer",marginBlockStart:"5px"},onClick:()=>le(),role:"dialog",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",className:"apc-mpx-hover-div",width:"14",viewBox:"0 0 576 512",children:e.jsx("path",{d:Lr,fill:xe(t.primaryColor,80)})}),"  Clear"]})]})]})]}),Re=k=>{var ve,te,$e,Le;const O=a.width*5,G=a.height*5,B=JSON.parse($.content),Q=(te=(ve=B==null?void 0:B.backgroundImage)==null?void 0:ve.filters[0])==null?void 0:te.color,ue=(Le=($e=a==null?void 0:a.backgroundImage)==null?void 0:$e.filters[0])==null?void 0:Le.color;Ke(k.sectionName).then(async je=>{if(je){const c=je!=null&&je.content?JSON.parse(je.content):null;c&&a?(await a.loadFromJSON(c,()=>{a.renderAll(),j(je),T(k.sectionName);const A=JSON.stringify(a),M={};M.id=k.sectionName,M.classification=I==null?void 0:I.name,M.json=A,M.misc={sectionName:k.sectionName,sectionImage:k.sectionImage,type:k.type},a.off("object:modified"),a.on({"object:modified":N=>{u(a,M)}})}),pe(ue),we||ge(!0)):console.error("Failed to load JSON content for section:",k.sectionName)}else a&&a.clear(),k.type="subsection",_.fabric.Image.fromURL(k.sectionImage,function(c){c.width=O,c.height=G,c.scaleToWidth(O),c.scaleToHeight(G),a.setBackgroundImage(c),(Pe||Q)&&(c.filters=[],c.filters.push(new _.fabric.Image.filters.BlendColor({color:Pe||Q})),c.applyFilters());const A=JSON.stringify(a),M={};M.id=k.sectionName,M.classification=$.id,M.json=A,M.misc={sectionName:k.sectionName,sectionImage:k.sectionImage,type:k.type},a.off("object:modified"),a.on({"object:modified":N=>{u(a,M)}}),Be(k.sectionName,E,A,{...k}).then(N=>{a&&(a.renderAll(),we&&ge(!1),T(k.sectionName),oe(J+1))})},{crossOrigin:"anonymous"})})},Ze=()=>{if(!Me)return null;let k=[];if(I){const O=I.sections.map(G=>({...G,type:"subsection"}));k.push(...O),k.push({sectionName:I==null?void 0:I.name,sectionImage:I==null?void 0:I.mainImage,type:"main"})}return k=k==null?void 0:k.map(O=>({...O,active:O.sectionName===E})),(k==null?void 0:k.length)<1?null:k==null?void 0:k.map((O,G)=>{var B,Q;return e.jsxs("div",{onClick:()=>Re(O),style:{position:"relative",backgroundColor:"#ff000026",border:"solid 1px #ffffff",padding:"2px",borderRadius:"6px",cursor:"pointer",textAlign:"center"},children:[O.active&&e.jsx("div",{style:{position:"absolute",top:"5px",right:"5px",width:"12px",height:"12px",backgroundColor:"green",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("span",{style:{color:"white",fontSize:"8px",fontWeight:"bold"},children:"✓"})}),!R&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},children:e.jsx("img",{src:O==null?void 0:O.sectionImage,width:50,height:50,alt:(O==null?void 0:O.sectionName)||"section image",style:{borderRadius:"6px"}})}),e.jsx("div",{style:{fontSize:"12px",color:"#333"},children:((B=O==null?void 0:O.sectionName)==null?void 0:B.length)>5?`${(Q=O==null?void 0:O.sectionName)==null?void 0:Q.substring(0,5)}...`:(O==null?void 0:O.sectionName)||"view"})]},G)})},et=()=>{if(v.current.length>0){const k=v.current.pop();a.loadFromJSON(k,()=>{a.renderAll(),b(k)})}};return e.jsxs(h.Fragment,{children:[e.jsx("div",{className:"tab",children:Ue()}),e.jsxs("div",{style:{display:"flex",backgroundColor:t.primaryColor,flexDirection:"row",padding:"3px",color:"#ffffff",minHeight:"30px"},children:[e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:e.jsx("div",{style:{display:"flex",flexDirection:"row"},children:e.jsxs("div",{children:[e.jsx("button",{style:{border:"none",backgroundColor:"transparent",color:"#ffffff",fontWeight:"bold",cursor:"pointer",height:"12px"},onClick:()=>et(),title:"UNDO",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"25",className:"apc-mpx-hover-div",width:"25",viewBox:"0 0 16 16",children:e.jsx("path",{d:_r,fill:"#ffffff"})})})," "]})})}),e.jsx("div",{style:{flexBasis:"20%"},children:o?l():null}),e.jsx("div",{style:{flexBasis:"40%",marginTop:"8px"},children:o?x():null}),Qe()]}),e.jsxs("div",{id:"apc-mpx-editor-canvas-container",style:{minHeight:"90vh",padding:"3px",overflowX:"hidden",position:"relative"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.jsx("div",{children:e.jsx("div",{style:{zIndex:1e3,overflow:"hidden",position:"absolute",marginLeft:"1%",display:"flex",flexDirection:"row"},children:((Ae=I==null?void 0:I.sections)==null?void 0:Ae.length)>0?Ze():null})}),e.jsx("div",{children:e.jsx("canvas",{id:"apc-mpx-editor-canvas",ref:g,height:1e3})}),ee&&(L||(i==null?void 0:i.plainColor)==="Y")&&we&&(ee==null?void 0:ee.length)>1?e.jsxs("div",{style:{zIndex:1e3,overflow:"hidden",position:"absolute",marginLeft:"90%"},children:[e.jsx("br",{}),e.jsx("div",{style:{backgroundColor:"#ff000026",border:"solid 1px #ccc",padding:"3px",borderRadius:"6px"},children:ee&&(ee==null?void 0:ee.length)>1?Ce():null})]}):null]}),e.jsxs("div",{style:{marginLeft:"45%"},children:[e.jsx("br",{}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom in",onClick:()=>d(),children:"+"}),e.jsx("button",{style:{height:"35px",width:"65px",cursor:"pointer"},"aria-label":"zoom out",onClick:()=>y(),children:"-"})]})]}),We()]})}function xs({data:f,theme:t,apcCanvasInstance:i,closeMobileModalSecondaryPanel:o,isMobile:l}){const[x,g]=h.useState({}),d=u=>{g(w=>({...w,[u]:!w[u]}))},y=async u=>{const w=await Dt(u);w&&_.fabric.Image.fromURL(w,n=>{n.set({left:100,top:100,scaleX:.3,scaleY:.3}),i.add(n),i.renderAll(),l&&o(!0)})},a=(u,w="",n=0)=>e.jsx("ul",{style:{listStyleType:"none",paddingLeft:`${n*20}px`,margin:"0"},children:Object.keys(u).map(v=>{const p=`${w}/${v}`,b=x[p];return u[v].type==="image"?e.jsx("li",{children:e.jsx("div",{onClick:()=>y(u[v].url),style:{cursor:"pointer"},children:e.jsx("img",{src:u[v].url,alt:v,style:{width:"100px",height:"auto"}})})},p):e.jsxs("li",{children:[e.jsxs("div",{onClick:()=>d(p),style:{cursor:"pointer",display:"flex",alignItems:"center",fontWeight:"bold",color:t.primaryColorLight},children:[e.jsx("div",{style:{marginRight:"5px"},children:b?e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:15,width:15,children:e.jsx("path",{d:Vr,fill:t.primaryColorLight})}):e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:15,width:15,children:e.jsx("path",{d:Ur,fill:t.primaryColorLight})})}),v]}),b&&a(u[v],p,n+1)]},p)})}),j=gs(f);return e.jsx("div",{children:a(j)})}function gs(f){const t={};return f.forEach(i=>{const o=i.name.split("/");let l=t;o.forEach((x,g)=>{l[x]||(l[x]=g===o.length-1?i:{}),l=l[x]})}),t}function ms(f){const{apcCanvasInstance:t,theme:i,apiEndpoint:o,isMobile:l,closeMobileModalSecondaryPanel:x,apiKey:g}=f,d=`${o}/api/v1/designer`,[y,a]=h.useState([]),[j,u]=h.useState(!1),[w,n]=h.useState(!1),[v,p]=h.useState(!1),b=sessionStorage.getItem("apc_x_sub_status"),s=sessionStorage.getItem("apc_x_stickers");h.useEffect(()=>{u(!0),(async()=>{b==="active"?n(!0):await L(),s?(a(JSON.parse(s)),u(!1)):await C()})()},[]);const C=()=>{u(!0);const I=`${d}/get-stickers`;be.get(I).then(R=>{R.data.object&&(a(R.data.object.contents),sessionStorage.setItem("apc_x_stickers",JSON.stringify(R.data.object.contents)))}).catch(R=>{console.error("Error fetching data:",R)}).finally(()=>{u(!1)})},L=()=>{u(!0);const I=`${d}/get-subscription-status/${g}`;be.get(I).then(R=>{R.data.object&&R.data.object==="active"&&(sessionStorage.setItem("apc_x_sub_status","active"),n(!0))}).catch(R=>{sessionStorage.setItem("apc_x_sub_status","")}).finally(()=>{u(!1),p(!0)})};return!w&&!j&&v?e.jsx(ot,{}):w&&y.length>0&&!j?e.jsx(h.Fragment,{children:e.jsx("div",{style:{padding:"10px"},children:e.jsx(xs,{data:y,theme:i,apcCanvasInstance:t,isMobile:l,closeMobileModalSecondaryPanel:x})})}):e.jsx("div",{children:e.jsx(ct,{})})}function Ft(f){const{theme:t=pr,readOnly:i=!1,apiKey:o=null,handleSaveClick:l,handleCartClick:x,apiEndpoint:g,enabledModules:d=["TXT","STICKERS","SHAPES","ICONS","IMAGE","QUOTE","BACKGROUND","QRCODE","BARCODE"],actionButtons:y={share:!0,download:!0,submit:!0,addToCart:!0},initInstance:a=null,initCategory:j=null,additionalActionButton:u=null,initProductName:w,isPlainColor:n,product:v={name:"Premium Crew Neck T-Shirt",category:"Tshirts",description:"Men's crew neck t-shirts",plainColor:"Y",mainImage:"https://static.mypixia.com/prod/products/96ca4acb-c426-4619-a2c4-7acd95b78451.png",colorSettings:["#FF0000","#0000FF","#008000","#000000","#FFFFFF","#808080","#FFFF00"],sections:[{sectionName:"Sleeve-left",sectionImage:"https://static.mypixia.com/prod/products/27b8c138-af4e-4ea0-833d-88b10fbd3cf7.png"},{sectionName:"Back",sectionImage:"https://static.mypixia.com/prod/products/d4c53776-7b7d-41c5-a6b5-2bf5876cd26e.png"}]}}=f,[p,b]=h.useState(d[0]),[s,C]=h.useState(),L=h.useRef(null),[I,R]=h.useState(),[D,E]=h.useState(!1),[T,H]=h.useState(1),Y=.1,[J,oe]=h.useState(1),[re,se]=h.useState([]),[he,Ee]=h.useState(null),[ye,Xe]=h.useState(null),[Te,ee]=h.useState(0),[De,Pe]=h.useState(),[Fe,Me]=h.useState(null),He=h.useRef([]),[we,ge]=h.useState(null),[$,ze]=h.useState(!1),[Ne,X]=h.useState(!1);h.useEffect(()=>{const c=()=>ze(window.innerWidth<600);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),h.useEffect(()=>{const c=document.getElementById("apc-mpx-editor-canvas-container"),A=document.getElementById("apc-mpx-editor-canvas-container");if(!L.current||!c||!A){console.error("Canvas element is not mounted yet!");return}const M={isDrawingMode:!1,selection:!0,selectionBorderColor:"#008000",height:A.offsetHeight,width:c.offsetWidth,enableRetinaScaling:!0};let N,ae;if(i)N=new _.fabric.StaticCanvas(L.current,M);else if(N=new _.fabric.Canvas(L.current,M),ye)ae=JSON.parse(ye),N.loadFromJSON(ae,function(){});else if(a){let V;try{V=JSON.parse(a)}catch(K){console.error("Failed to parse initInstance",K)}N&&V?N.loadFromJSON(V,function(){}):console.error("Canvas or InitInstance is not properly initialized")}else{const V=new _.fabric.Textbox("Something cool!",{width:300,left:250,top:300,fontFamily:"aclonica",fill:"#6a45d2",rotate:20});V.shadow={color:"rgba(0,0,0,0.5)",blur:10,offsetX:5,offsetY:5},N.add(V),v!=null&&v.mainImage&&_.fabric.Image.fromURL(v.mainImage,function(K){K.height=A.offsetHeight,K.width=c.offsetWidth,K.scaleToWidth(A.offsetHeight),K.scaleToHeight(c.offsetWidth),N.setBackgroundImage(K),N.setActiveObject(V),pe(V),N.renderAll(),k(N)},{crossOrigin:"anonymous"})}return N.on({"selection:updated":V=>{const K=N.getActiveObject();pe(K)},"selection:created":V=>{const K=N.getActiveObject();pe(K)},"selection:cleared":V=>{Ce()},"object:modified":V=>{k(N),le(N)},"object:added":V=>{le(N)},"object:removed":V=>{le(N)},"object:created":V=>{le(N)}}),C(N),oe(c.offsetWidth),()=>{C(null),N.off({"selection:updated":V=>{const K=N.getActiveObject();pe(K)},"selection:created":V=>{const K=N.getActiveObject();pe(K)},"selection:cleared":V=>{Ce()},"object:modified":V=>{k(N),le(N)},"object:added":V=>{le(N)},"object:removed":V=>{le(N)},"object:created":V=>{le(N)}}),N.dispose()}},[ye]),h.useEffect(()=>(Ve(),document.addEventListener("keydown",c=>Ae(c)),()=>{document.removeEventListener("keydown",c=>Ae(c))}),[s]),h.useEffect(()=>{if(s){const c=document.getElementById("apc-mpx-editor-canvas-container"),A=()=>{const M=c.offsetWidth/J;s.setZoom(M)};return window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}}},[s,T]),h.useEffect(()=>{const c=()=>{if(s&&L.current){const A=s.getWidth(),M=s.getHeight(),N=window.innerWidth,ae=window.innerHeight,V=N/A,K=ae/M,tt=Math.min(V,K);s.setZoom(tt/1.4),s.renderAll()}};return $&&(c(),window.addEventListener("resize",c)),()=>window.removeEventListener("resize",c)},[s,$]);const Ve=()=>{Ie().then(c=>{if(c&&c.length>0){const A=c[0].content;w===c[0].id&&Xe(A)}})},le=c=>{if(c){const A=c.toJSON();Me(M=>(He.current.push(M),A))}},pe=c=>{R(c.type)},Ce=()=>{R(null)},me=()=>{s.getActiveObject()&&s.remove(s.getActiveObject())},Ue=()=>{const c=s.getActiveObject(),A=_.fabric.util.object.clone(c);A.set({left:c.left+20,top:c.top+20}),s.add(A)},Se=c=>{Ee(c)},Oe=c=>{let A=re;A.push(c),se(A)},We=c=>{c==="lock"?s.getActiveObject().set({lockMovementX:!0,lockMovementY:!0}):s.getActiveObject().set({lockMovementX:!1,lockMovementY:!1})},Qe=()=>{s&&(s.getActiveObject().bringForward(),s.renderAll())},Re=()=>{s&&(s.getActiveObject().sendBackwards(),s.renderAll())},Ze=()=>{const c=T+Y;H(c),s.setZoom(c)},et=()=>{const c=Math.max(T-Y,Y);H(c),s.setZoom(c)},Ae=c=>{s&&s.getActiveObject()&&s.getActiveObject().type!=="textbox"&&c.keyCode===8&&me()},k=c=>{const A=localStorage.getItem("apc_x_activeTab");if(A)Ke(A).then(M=>{if(M){const N=JSON.stringify(c);Be(M.id,M.classification,N,M.misc).then(ae=>{})}else{const N=JSON.stringify(c);Be(v.name??"design","general",N,v).then(ae=>{})}});else{const M=JSON.stringify(c);Be(v.name??"design","general",M,v).then(N=>{})}},O=(c,A)=>{const M=JSON.stringify(c);Be(A.id,A.classification,M,A.misc).then(N=>{})},G=()=>({getPDF:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"pdf").then(N=>{A.push(N)});return A}),getPNG:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"png").then(N=>{A.push(N)});return A}),getSVG:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"svg").then(N=>{A.push(N)});return A}),getJPEG:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"jpeg").then(N=>{A.push(N)});return A}),getWEBP:()=>Ie().then(c=>{let A=[];for(let M in c)fe(c[M].content,s.height,s.width,"webp").then(N=>{A.push(N)});return A}),getImageActiveTab:()=>{const c=localStorage.getItem("apc_x_activeTab");return Ke(c).then(A=>fe(A.content,s.height,s.width,"png").then(M=>{let N={};return N.file=M,N.height=s.height,N.width=s.width,N}))}}),B=()=>e.jsxs("div",{style:{marginTop:"6px",fontWeight:"bold"},children:["Replace Image: ",e.jsx("input",{type:"file",accept:"image/*",onChange:c=>Q(c)}),e.jsx("br",{})]}),Q=(c,A)=>{{const M=s.getActiveObject(),N=c.target.files[0],ae=new FileReader;ae.onload=function(V){const K=V.target.result;M.setSrc(K,function(tt){tt.set({angle:30}),s&&s.renderAll()})},ae.readAsDataURL(N)}s&&s.renderAll()},ue=()=>{switch(p){case"ICONS":return e.jsx(ns,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"TEMPLATES":return e.jsx(Yr,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:g,reloadTabs:c=>ee(c),updateActiveSection:c=>Se(c),initCategory:j,currentTabNo:Te,initInstance:a,setActiveTab:c=>ge(c),isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"TXT":return e.jsx(ts,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"IMAGE":return e.jsx(ss,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:g,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"STICKERS":return e.jsx(ms,{apcCanvasInstance:s,theme:t,apiEndpoint:g,isMobile:$,apiKey:o,closeMobileModalSecondaryPanel:c=>X(!c)});case"SHAPES":return e.jsx(zt,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"QUOTE":return e.jsx(is,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:g,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"BACKGROUND":return e.jsx(os,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:g,updateActiveSection:c=>Se(c),reloadTabs:c=>ee(c),currentTabNo:Te,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"QRCODE":return e.jsx(cs,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:g,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"BARCODE":return e.jsx(as,{apcCanvasInstance:s,theme:t,apiKey:o,apiEndpoint:g,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});case"SIZE":return e.jsx(ls,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)});default:return e.jsx(zt,{apcCanvasInstance:s,theme:t,apiKey:o,isMobile:$,closeMobileModalSecondaryPanel:c=>X(!c)})}},ve=()=>{if(!I)return null;switch(I){case"text":return e.jsx(Rt,{apcCanvasInstance:s,theme:t,apiKey:o});case"textbox":return e.jsx(Rt,{apcCanvasInstance:s,theme:t,apiKey:o});case"rect":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:o});case"circle":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:o});case"triangle":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:o});case"line":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:o});case"path":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:o});case"polygon":return e.jsx(Ye,{apcCanvasInstance:s,theme:t,apiKey:o});case"image":return B();default:return null}},te=c=>{b(c),$&&X(!0)},$e=()=>e.jsx("div",{id:"selectionRectangle",style:{marginLeft:"auto",position:"relative"},children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:10,marginTop:"8px"},children:[e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>me(),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{d:_t,fill:"#d8d4d4"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Delete"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Re(),style:{cursor:"pointer"},children:[e.jsxs("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",fill:"#d8d4d4",width:"20px",height:"20px",viewBox:"0 0 32 32",children:[e.jsx("path",{d:"M28,10H22V4a2,2,0,0,0-2-2H4A2,2,0,0,0,2,4V20a2,2,0,0,0,2,2h6v6a2.0023,2.0023,0,0,0,2,2H28a2.0023,2.0023,0,0,0,2-2V12A2.0023,2.0023,0,0,0,28,10ZM12,28V12H28l.0015,16Z"}),e.jsx("rect",{style:{fill:"none"},width:"32",height:"32"})]}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Send to back"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",role:"button",onClick:()=>Qe(),style:{cursor:"pointer"},children:[e.jsxs("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",fill:"#d8d4d4",width:"20px",height:"20px",viewBox:"0 0 32 32",children:[e.jsx("path",{d:"M28,10H22V4a2.0023,2.0023,0,0,0-2-2H4A2.0023,2.0023,0,0,0,2,4V20a2.0023,2.0023,0,0,0,2,2h6v6a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V12A2,2,0,0,0,28,10ZM4,20,3.9985,4H20v6H12a2,2,0,0,0-2,2v8Z"}),e.jsx("rect",{style:{fill:"none"},height:"32",width:"32"})]}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Bring to front"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>We("lock"),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Lock"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>We("unlock"),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 576 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M423.5 0C339.5 .3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Unlock"})]}),e.jsxs("div",{className:"apc-mpx-tooltip-container",onClick:()=>Ue(),style:{cursor:"pointer"},children:[e.jsx("svg",{className:"apc-mpx-hover-div",xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",children:e.jsx("path",{fill:"#d8d4d4",d:"M464 0c26.5 0 48 21.5 48 48v288c0 26.5-21.5 48-48 48H176c-26.5 0-48-21.5-48-48V48c0-26.5 21.5-48 48-48h288M176 416c-44.1 0-80-35.9-80-80V128H48c-26.5 0-48 21.5-48 48v288c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-48H176z"})}),e.jsx("div",{className:"apc-mpx-tooltip-text",children:"Duplicate"})]})]})}),Le=()=>s?e.jsx("div",{style:{height:"10vh",overflow:"auto"},children:e.jsx(at,{isOpen:Ne,onClose:()=>X(!1),children:ue()})}):null,je=()=>s?$?Le():ue():null;return e.jsxs("div",{className:"apc-mpc-widget-wrapper",children:[e.jsxs("div",{style:{display:"flex",backgroundColor:xe(t.primaryColor,70),flexDirection:"row",padding:"3px",color:"#ffffff",minHeight:"30px"},children:[e.jsx("div",{style:{flexBasis:"40%"},children:e.jsx("div",{style:{float:"left"},children:e.jsxs("button",{onClick:()=>window.history.back(),style:{backgroundColor:"transparent",color:"#ffffff",border:"solid #ffffff 1px",padding:"4px",width:"auto",borderRadius:"4px",fontWeight:"bold"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 448 512",children:e.jsx("path",{fill:"#ffffff",d:Wr})})," Back"]})})}),e.jsx("div",{style:{flexBasis:"20%"}}),e.jsx("div",{style:{flexBasis:"40%"},children:e.jsx("div",{style:{display:"flex",flexDirection:"row",gap:10},children:e.jsx("div",{children:e.jsxs("div",{style:{display:"flex",flexDirection:"row",gap:5},children:[e.jsx("div",{children:s&&y.share?e.jsx("div",{children:e.jsx(ps,{apcCanvasInstance:s,theme:t})}):null}),e.jsx("div",{children:s&&y.download?e.jsx("div",{children:e.jsx(us,{apcCanvasInstance:s,theme:t,apiKey:o,updateSelectedSections:c=>Oe(c),updateActiveSection:c=>Se(c),accesories,getDesignFormats:G()})}):null}),e.jsx("div",{children:s&&u?e.jsx("div",{children:e.jsx("button",{className:"apc-mpc-widget-btn",onClick:()=>l(G()),style:{backgroundColor:u.btnColor??t.primaryColorLight,color:"#ffffff",border:"solid #ffffff 1px"},children:u.btnLabel})}):null})]})})})})]}),e.jsxs("div",{className:"apc-mpc-widget-colums",children:[e.jsx("div",{className:"apc-mpc-widget-colum-modules-container",children:e.jsxs("div",{className:"apc-mypixia-widget-primary-nav-container",children:[d.indexOf("TXT")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("TXT"),style:{padding:"10px",backgroundColor:p==="TXT"?t.primaryColorLight:"inherit",color:p==="TXT"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",style:{fill:p==="TXT"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ar})}),e.jsx("div",{children:"Text"})]}):null,d.indexOf("STICKERS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("STICKERS"),style:{padding:"10px",backgroundColor:p==="STICKERS"?t.primaryColorLight:"inherit",color:p==="STICKERS"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:p==="STICKERS"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Hr})}),e.jsx("div",{children:"Stickers"})]}):null,d.indexOf("SHAPES")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SHAPES"),style:{padding:"10px",backgroundColor:p==="SHAPES"?t.primaryColorLight:"inherit",color:p==="SHAPES"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:p==="SHAPES"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Nr})}),e.jsx("div",{children:"Shapes"})]}):null,d.indexOf("ICONS")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("ICONS"),style:{padding:"10px",backgroundColor:p==="ICONS"?t.primaryColorLight:"inherit",color:p==="ICONS"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:p==="ICONS"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Or})}),e.jsx("div",{children:"Icons"})]}):null,d.indexOf("IMAGE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("IMAGE"),style:{padding:"10px",backgroundColor:p==="IMAGE"?t.primaryColorLight:"inherit",color:p==="IMAGE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"18",viewBox:"0 0 512 512",style:{fill:p==="IMAGE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Bt})}),e.jsx("div",{children:"Upload"})]}):null,d.indexOf("QUOTE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QUOTE"),style:{padding:"10px",backgroundColor:p==="QUOTE"?t.primaryColorLight:"inherit",color:p==="QUOTE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:p==="QUOTE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Ir})}),e.jsx("div",{children:"Quote"})]}):null,d.indexOf("BACKGROUND")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BACKGROUND"),style:{padding:"10px",backgroundColor:p==="BACKGROUND"?t.primaryColorLight:"inherit",color:p==="BACKGROUND"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:p==="BACKGROUND"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Er})}),e.jsx("div",{children:"Background"})]}):null,d.indexOf("QRCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("QRCODE"),style:{padding:"10px",backgroundColor:p==="QRCODE"?t.primaryColorLight:"inherit",color:p==="QRCODE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"20",viewBox:"0 0 640 512",style:{fill:p==="QRCODE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Tr})}),e.jsx("div",{children:"QR Code"})]}):null,d.indexOf("BARCODE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("BARCODE"),style:{padding:"10px",backgroundColor:p==="BARCODE"?t.primaryColorLight:"inherit",color:p==="BARCODE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"16",viewBox:"0 0 512 512",style:{fill:p==="BARCODE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:Mr})}),e.jsx("div",{children:"Barcode"})]}):null,d.indexOf("SIZE")>-1?e.jsxs("div",{tabIndex:"0",role:"button",onClick:()=>te("SIZE"),style:{padding:"10px",backgroundColor:p==="SIZE"?t.primaryColorLight:"inherit",color:p==="SIZE"?"#ffffff":"inherit"},children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512",style:{fill:p==="SIZE"?"#ffffff":t.primaryColor},className:"apc-mypixia-widget-primary-nav-svg",children:e.jsx("path",{d:zr})}),e.jsx("div",{children:"Size"})]}):null]})}),e.jsx("div",{className:"apc-mpc-widget-colum-features-container",children:je()}),e.jsx("div",{className:"apc-mpc-widget-colum-editor-container",children:e.jsx(fs,{theme:t,activeSection:he,selectedObjectType:I,renderQuickActions:$e,renderActionItems:ve,canvasEl:L,zoomIn:()=>Ze(),zoomOut:()=>et(),apcCanvasInstance:s,setActiveSection:c=>Ee(c),updateActiveDesignSection:c=>Se(c),saveActiveDesign:(c,A)=>O(c,A),reloadTabs:Te,activeTabName:we,supportedColors:De,initProductName:w,historyRef:He,currentState:Fe,setCurrentState:c=>Me(c),isPlainColor:n,selectedProduct:v,isMobile:$})})]}),e.jsx("div",{id:"apc-mpx-editor-modal-root"}),$?Le():null]})}function vs(f,t={}){hr.createRoot(f).render(e.jsx(Ft,{...t}))}exports.Mypixia=Ft;exports.render=vs;
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ .apc-mpc-widget-colums{display:flex;flex-direction:row}.apc-mpc-widget-colum-modules-container{border:1px solid #ccc;flex-basis:8%;cursor:pointer;width:10%}.apc-mpc-widget-colum-features-container{border:1px solid #ccc;flex-basis:20%;text-align:center;overflow:auto;width:20%;height:140vh}.apc-mpc-widget-colum-editor-container{border:1px solid #ccc;flex-basis:72%;min-height:60vh;background-color:#ccc;width:70%}.apc-mpx-tooltip-container{position:relative;display:inline-block;z-index:3000}.apc-mpx-hover-div{color:#fff;text-align:center;width:auto}.apc-mpx-tooltip-text{position:absolute;top:100%;left:50%;transform:translate(-50%);background-color:#333;color:#fff;padding:5px;border-radius:4px;opacity:0;visibility:hidden;transition:opacity .3s ease-in-out;font-size:10px}.apc-mpx-tooltip-container:hover .apc-mpx-tooltip-text{opacity:1;visibility:visible}.apc-mpx-widget-secondary-icon{font-size:30px;cursor:pointer}.apc-mpx-widget-button-group-container{position:relative}.apc-mpx-widget-effects-button{text-transform:none;color:#fff}.apc-mpx-widget-popper-container{position:absolute;z-index:10000;background-color:#fff;color:#000;width:auto;border:solid 1px #d3d3d3;margin-left:-120px;padding:.8em}.apc-mpx-widget-popper-li{list-style:none}.apc-mpc-widget-input{height:35px;border-radius:3px;width:80%;font-size:18px;font-weight:500;padding:5px}.apc-mpc-widget-btn{height:25px;border:none;cursor:pointer;font-weight:600;padding-right:3px;padding-left:3px;border-radius:4px}.apc-mpx-widget-custom-chip{border-radius:16px;cursor:pointer;padding:5px;font-weight:700;font-size:11px}.canvas-container{background-color:#e5e7eb}.apc-mpx-widget-accordion{width:100%}.apc-mpx-widget-accordion-item{border:1px solid #ccc;margin-bottom:5px}.apc-mpx-widget-accordion-title{display:flex;justify-content:space-between;padding:10px;cursor:pointer;background-color:#f0f0f0}.apc-mpx-widget-accordion-content{padding:10px}.apc-mpx-widget-modal{display:flex;flex-direction:column;max-height:80vh;width:80%;overflow:hidden}.apc-mpx-widget-modal-close-btn{position:absolute;top:10px;right:10px;background:none;border:none;cursor:pointer;padding:5px 10px;border-radius:4px;font-size:14px;color:#333}.apc-mpx-widget-responsive-image-container{max-width:100%;height:auto;position:relative;overflow:hidden;cursor:pointer}.apc-mpx-widget-responsive-image{width:100%;height:auto;display:block;cursor:pointer}.apc-mpx-widget-circle{width:25px;height:25px;border-radius:50%}.tab{overflow:hidden;border:1px solid #ccc;background-color:#f1f1f1}.tab button{background-color:inherit;float:left;border:none;outline:none;cursor:pointer;padding:14px 16px;transition:.3s}.tab button:hover{background-color:#ddd}.tab button.active{background-color:#ccc}.tabcontent{display:none;padding:6px 12px;border:1px solid #ccc;border-top:none}#info-div{display:none;position:absolute;background:#f0f0f0;border:1px solid #ccc;padding:10px}.apc-mpx-widget-generic-icon{font-size:20px;cursor:pointer}.apc-mpx-widget-secondary-icons{display:flex;flex-wrap:wrap;gap:10px}.apc-mpx-widget-secondary-icon{flex:0 0 23%;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:10px}.apc-mpx-widget-secondary-icons-mobile{display:flex;flex-wrap:wrap;gap:6px}.apc-mpx-widget-secondary-icons-mobile .apc-mpx-widget-secondary-icon{flex:0 0 22%}.apc-mpx-widget-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;overflow:auto;background:#00000080;z-index:4000}.apc-mpx-widget-modal{position:relative;width:90%;max-width:600px;max-height:75vh;background-color:#fff;display:flex;flex-direction:column;border-radius:8px;box-shadow:0 2px 6px #0000004d}.apc-mpx-widget-modal-close-btn{padding:8px 12px;background-color:transparent;border:none;outline:none;cursor:pointer;font-size:16px;position:sticky;top:0;z-index:500;align-self:flex-end;border-bottom:1px solid #eee}.apc-mpx-widget-modal-content{padding:10px;overflow-y:Scroll;flex:1}.apc-mypixia-widget-primary-nav-container{display:flex;gap:2px;flex-direction:column;text-align:center}@media screen and (max-width: 600px){.apc-mpc-widget-colum-features-container{display:none}.apc-mpc-widget-colum-modules-container{flex-basis:8%;width:10%}.apc-mpc-widget-colum-features-container{flex-basis:0;width:auto}.apc-mpc-widget-colum-editor-container{flex-basis:100%;width:100%}.apc-mpc-widget-colum-modules-container{flex-basis:0;width:auto}.apc-mypixia-widget-primary-nav-container{position:fixed;bottom:0;left:0;right:0;width:100%;height:60px;flex-direction:row;justify-content:space-around;align-items:center;z-index:2000;box-shadow:0 -2px 4px #0000001a;overflow:auto}.apc-mypixia-widget-primary-nav-container>div{padding:5px!important;font-size:10px!important;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;cursor:pointer;min-width:50px}.apc-mypixia-widget-primary-nav-container .apc-mypixia-widget-primary-nav-svg{width:20px!important;height:20px!important}.apc-mypixia-widget-primary-nav-container div div{margin-top:2px}}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;height:100%;min-height:200px}.spinner{position:relative;width:60px;height:60px}.spinner-circle{position:absolute;border:4px solid rgba(0,0,0,.1);border-top:4px solid #000000;border-radius:50%;width:100%;height:100%;animation:spin 1.2s cubic-bezier(.5,.1,.5,.9) infinite}.spinner-circle-inner{position:absolute;border:4px solid transparent;border-right:4px solid #f39c12;border-radius:50%;width:70%;height:70%;top:15%;left:15%;animation:spin-reverse .8s linear infinite}.loading-text{margin-top:15px;font-size:14px;color:#555;font-weight:500}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-reverse{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}@media (prefers-color-scheme: dark){.loading-text{color:#b0b0b0}.spinner-circle{border-color:#ffffff1a;border-top-color:#000}}