operp-print-designer 1.0.7 → 1.0.8

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.
@@ -1,4 +1,4 @@
1
- (function(Y,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-to-print"),require("zustand"),require("react-grid-layout")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-to-print","zustand","react-grid-layout"],w):(Y=typeof globalThis<"u"?globalThis:Y||self,w(Y.PrintDesigner={},Y.React,Y.antd,Y.icons,Y.ReactToPrint,Y.zustand,Y.GridLayout))})(this,(function(Y,w,o,B,De,ft,pt){"use strict";var ue={exports:{}},se={};/**
1
+ (function(Ne,oe){typeof exports=="object"&&typeof module<"u"?oe(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-to-print"),require("zustand"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-to-print","zustand","react-dom"],oe):(Ne=typeof globalThis<"u"?globalThis:Ne||self,oe(Ne.PrintDesigner={},Ne.React,Ne.antd,Ne.icons,Ne.ReactToPrint,Ne.zustand,Ne.ReactDOM))})(this,(function(Ne,oe,k,Te,tr,ln,Mt){"use strict";function cn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function un(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var n=r.default;if(typeof n=="function"){var a=function o(){return this instanceof o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};a.prototype=n.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(r).forEach(function(o){var h=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(a,o,h.get?h:{enumerable:!0,get:function(){return r[o]}})}),a}var vt={exports:{}},ot={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Re;function gt(){if(Re)return se;Re=1;var s=w,d=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function v(m,u,j){var b,P={},g=null,z=null;j!==void 0&&(g=""+j),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(z=u.ref);for(b in u)n.call(u,b)&&!i.hasOwnProperty(b)&&(P[b]=u[b]);if(m&&m.defaultProps)for(b in u=m.defaultProps,u)P[b]===void 0&&(P[b]=u[b]);return{$$typeof:d,type:m,key:g,ref:z,props:P,_owner:l.current}}return se.Fragment=a,se.jsx=v,se.jsxs=v,se}var le={},Ae;function mt(){if(Ae)return le;Ae=1;var s={};/**
9
+ */var rr;function dn(){if(rr)return ot;rr=1;var r=oe,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function x(O,y,R){var C,E={},_=null,A=null;R!==void 0&&(_=""+R),y.key!==void 0&&(_=""+y.key),y.ref!==void 0&&(A=y.ref);for(C in y)o.call(y,C)&&!u.hasOwnProperty(C)&&(E[C]=y[C]);if(O&&O.defaultProps)for(C in y=O.defaultProps,y)E[C]===void 0&&(E[C]=y[C]);return{$$typeof:n,type:O,key:_,ref:A,props:E,_owner:h.current}}return ot.Fragment=a,ot.jsx=x,ot.jsxs=x,ot}var it={},nr;function fn(){if(nr)return it;nr=1;var r={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,33 +14,54 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */return s.NODE_ENV!=="production"&&(function(){var d=w,a=Symbol.for("react.element"),n=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),u=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),y=Symbol.iterator,O="@@iterator";function r(t){if(t===null||typeof t!="object")return null;var c=y&&t[y]||t[O];return typeof c=="function"?c:null}var f=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(t){{for(var c=arguments.length,p=new Array(c>1?c-1:0),C=1;C<c;C++)p[C-1]=arguments[C];_("error",t,p)}}function _(t,c,p){{var C=f.ReactDebugCurrentFrame,D=C.getStackAddendum();D!==""&&(c+="%s",p=p.concat([D]));var $=p.map(function(I){return String(I)});$.unshift("Warning: "+c),Function.prototype.apply.call(console[t],console,$)}}var h=!1,S=!1,F=!1,V=!1,H=!1,q;q=Symbol.for("react.module.reference");function W(t){return!!(typeof t=="string"||typeof t=="function"||t===l||t===v||H||t===i||t===b||t===P||V||t===N||h||S||F||typeof t=="object"&&t!==null&&(t.$$typeof===z||t.$$typeof===g||t.$$typeof===m||t.$$typeof===u||t.$$typeof===j||t.$$typeof===q||t.getModuleId!==void 0))}function re(t,c,p){var C=t.displayName;if(C)return C;var D=c.displayName||c.name||"";return D!==""?p+"("+D+")":p}function ne(t){return t.displayName||"Context"}function U(t){if(t==null)return null;if(typeof t.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case l:return"Fragment";case n:return"Portal";case v:return"Profiler";case i:return"StrictMode";case b:return"Suspense";case P:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case u:var c=t;return ne(c)+".Consumer";case m:var p=t;return ne(p._context)+".Provider";case j:return re(t,t.render,"ForwardRef");case g:var C=t.displayName||null;return C!==null?C:U(t.type)||"Memo";case z:{var D=t,$=D._payload,I=D._init;try{return U(I($))}catch{return null}}}return null}var k=Object.assign,R=0,G,Z,He,Ue,qe,Ge,Ke;function Xe(){}Xe.__reactDisabledLog=!0;function Rt(){{if(R===0){G=console.log,Z=console.info,He=console.warn,Ue=console.error,qe=console.group,Ge=console.groupCollapsed,Ke=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Xe,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}R++}}function At(){{if(R--,R===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},t,{value:G}),info:k({},t,{value:Z}),warn:k({},t,{value:He}),error:k({},t,{value:Ue}),group:k({},t,{value:qe}),groupCollapsed:k({},t,{value:Ge}),groupEnd:k({},t,{value:Ke})})}R<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Te=f.ReactCurrentDispatcher,ke;function ye(t,c,p){{if(ke===void 0)try{throw Error()}catch(D){var C=D.stack.trim().match(/\n( *(at )?)/);ke=C&&C[1]||""}return`
18
- `+ke+t}}var Pe=!1,ve;{var Nt=typeof WeakMap=="function"?WeakMap:Map;ve=new Nt}function Ze(t,c){if(!t||Pe)return"";{var p=ve.get(t);if(p!==void 0)return p}var C;Pe=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $;$=Te.current,Te.current=null,Rt();try{if(c){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(X){C=X}Reflect.construct(t,[],I)}else{try{I.call()}catch(X){C=X}t.call(I.prototype)}}else{try{throw Error()}catch(X){C=X}t()}}catch(X){if(X&&C&&typeof X.stack=="string"){for(var E=X.stack.split(`
19
- `),K=C.stack.split(`
20
- `),L=E.length-1,J=K.length-1;L>=1&&J>=0&&E[L]!==K[J];)J--;for(;L>=1&&J>=0;L--,J--)if(E[L]!==K[J]){if(L!==1||J!==1)do if(L--,J--,J<0||E[L]!==K[J]){var Q=`
21
- `+E[L].replace(" at new "," at ");return t.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",t.displayName)),typeof t=="function"&&ve.set(t,Q),Q}while(L>=1&&J>=0);break}}}finally{Pe=!1,Te.current=$,At(),Error.prepareStackTrace=D}var oe=t?t.displayName||t.name:"",te=oe?ye(oe):"";return typeof t=="function"&&ve.set(t,te),te}function Ft(t,c,p){return Ze(t,!1)}function $t(t){var c=t.prototype;return!!(c&&c.isReactComponent)}function be(t,c,p){if(t==null)return"";if(typeof t=="function")return Ze(t,$t(t));if(typeof t=="string")return ye(t);switch(t){case b:return ye("Suspense");case P:return ye("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case j:return Ft(t.render);case g:return be(t.type,c,p);case z:{var C=t,D=C._payload,$=C._init;try{return be($(D),c,p)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,Qe={},et=f.ReactDebugCurrentFrame;function je(t){if(t){var c=t._owner,p=be(t.type,t._source,c?c.type:null);et.setExtraStackFrame(p)}else et.setExtraStackFrame(null)}function Bt(t,c,p,C,D){{var $=Function.call.bind(de);for(var I in t)if($(t,I)){var E=void 0;try{if(typeof t[I]!="function"){var K=Error((C||"React class")+": "+p+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw K.name="Invariant Violation",K}E=t[I](c,I,C,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(L){E=L}E&&!(E instanceof Error)&&(je(D),x("%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).",C||"React class",p,I,typeof E),je(null)),E instanceof Error&&!(E.message in Qe)&&(Qe[E.message]=!0,je(D),x("Failed %s type: %s",p,E.message),je(null))}}}var Vt=Array.isArray;function Ee(t){return Vt(t)}function Wt(t){{var c=typeof Symbol=="function"&&Symbol.toStringTag,p=c&&t[Symbol.toStringTag]||t.constructor.name||"Object";return p}}function Lt(t){try{return tt(t),!1}catch{return!0}}function tt(t){return""+t}function rt(t){if(Lt(t))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Wt(t)),tt(t)}var nt=f.ReactCurrentOwner,Mt={key:!0,ref:!0,__self:!0,__source:!0},it,ot;function Jt(t){if(de.call(t,"ref")){var c=Object.getOwnPropertyDescriptor(t,"ref").get;if(c&&c.isReactWarning)return!1}return t.ref!==void 0}function Yt(t){if(de.call(t,"key")){var c=Object.getOwnPropertyDescriptor(t,"key").get;if(c&&c.isReactWarning)return!1}return t.key!==void 0}function Ht(t,c){typeof t.ref=="string"&&nt.current}function Ut(t,c){{var p=function(){it||(it=!0,x("%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)",c))};p.isReactWarning=!0,Object.defineProperty(t,"key",{get:p,configurable:!0})}}function qt(t,c){{var p=function(){ot||(ot=!0,x("%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)",c))};p.isReactWarning=!0,Object.defineProperty(t,"ref",{get:p,configurable:!0})}}var Gt=function(t,c,p,C,D,$,I){var E={$$typeof:a,type:t,key:c,ref:p,props:I,_owner:$};return E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(E,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(E,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E};function Kt(t,c,p,C,D){{var $,I={},E=null,K=null;p!==void 0&&(rt(p),E=""+p),Yt(c)&&(rt(c.key),E=""+c.key),Jt(c)&&(K=c.ref,Ht(c,D));for($ in c)de.call(c,$)&&!Mt.hasOwnProperty($)&&(I[$]=c[$]);if(t&&t.defaultProps){var L=t.defaultProps;for($ in L)I[$]===void 0&&(I[$]=L[$])}if(E||K){var J=typeof t=="function"?t.displayName||t.name||"Unknown":t;E&&Ut(I,J),K&&qt(I,J)}return Gt(t,E,K,D,C,nt.current,I)}}var _e=f.ReactCurrentOwner,st=f.ReactDebugCurrentFrame;function ie(t){if(t){var c=t._owner,p=be(t.type,t._source,c?c.type:null);st.setExtraStackFrame(p)}else st.setExtraStackFrame(null)}var Oe;Oe=!1;function Ie(t){return typeof t=="object"&&t!==null&&t.$$typeof===a}function lt(){{if(_e.current){var t=U(_e.current.type);if(t)return`
17
+ */return r.NODE_ENV!=="production"&&(function(){var n=oe,a=Symbol.for("react.element"),o=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),y=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),p=Symbol.iterator,l="@@iterator";function e(g){if(g===null||typeof g!="object")return null;var B=p&&g[p]||g[l];return typeof B=="function"?B:null}var t=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(g){{for(var B=arguments.length,te=new Array(B>1?B-1:0),de=1;de<B;de++)te[de-1]=arguments[de];f("error",g,te)}}function f(g,B,te){{var de=t.ReactDebugCurrentFrame,_e=de.getStackAddendum();_e!==""&&(B+="%s",te=te.concat([_e]));var De=te.map(function(we){return String(we)});De.unshift("Warning: "+B),Function.prototype.apply.call(console[g],console,De)}}var i=!1,b=!1,j=!1,P=!1,z=!1,N;N=Symbol.for("react.module.reference");function F(g){return!!(typeof g=="string"||typeof g=="function"||g===h||g===x||z||g===u||g===C||g===E||P||g===T||i||b||j||typeof g=="object"&&g!==null&&(g.$$typeof===A||g.$$typeof===_||g.$$typeof===O||g.$$typeof===y||g.$$typeof===R||g.$$typeof===N||g.getModuleId!==void 0))}function Z(g,B,te){var de=g.displayName;if(de)return de;var _e=B.displayName||B.name||"";return _e!==""?te+"("+_e+")":te}function K(g){return g.displayName||"Context"}function Q(g){if(g==null)return null;if(typeof g.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case h:return"Fragment";case o:return"Portal";case x:return"Profiler";case u:return"StrictMode";case C:return"Suspense";case E:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case y:var B=g;return K(B)+".Consumer";case O:var te=g;return K(te._context)+".Provider";case R:return Z(g,g.render,"ForwardRef");case _:var de=g.displayName||null;return de!==null?de:Q(g.type)||"Memo";case A:{var _e=g,De=_e._payload,we=_e._init;try{return Q(we(De))}catch{return null}}}return null}var V=Object.assign,X=0,J,ne,Se,ve,M,L,le;function ie(){}ie.__reactDisabledLog=!0;function ce(){{if(X===0){J=console.log,ne=console.info,Se=console.warn,ve=console.error,M=console.group,L=console.groupCollapsed,le=console.groupEnd;var g={configurable:!0,enumerable:!0,value:ie,writable:!0};Object.defineProperties(console,{info:g,log:g,warn:g,error:g,group:g,groupCollapsed:g,groupEnd:g})}X++}}function pe(){{if(X--,X===0){var g={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},g,{value:J}),info:V({},g,{value:ne}),warn:V({},g,{value:Se}),error:V({},g,{value:ve}),group:V({},g,{value:M}),groupCollapsed:V({},g,{value:L}),groupEnd:V({},g,{value:le})})}X<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=t.ReactCurrentDispatcher,I;function G(g,B,te){{if(I===void 0)try{throw Error()}catch(_e){var de=_e.stack.trim().match(/\n( *(at )?)/);I=de&&de[1]||""}return`
18
+ `+I+g}}var ee=!1,$;{var ae=typeof WeakMap=="function"?WeakMap:Map;$=new ae}function W(g,B){if(!g||ee)return"";{var te=$.get(g);if(te!==void 0)return te}var de;ee=!0;var _e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var De;De=ue.current,ue.current=null,ce();try{if(B){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(He){de=He}Reflect.construct(g,[],we)}else{try{we.call()}catch(He){de=He}g.call(we.prototype)}}else{try{throw Error()}catch(He){de=He}g()}}catch(He){if(He&&de&&typeof He.stack=="string"){for(var ye=He.stack.split(`
19
+ `),We=de.stack.split(`
20
+ `),Me=ye.length-1,Le=We.length-1;Me>=1&&Le>=0&&ye[Me]!==We[Le];)Le--;for(;Me>=1&&Le>=0;Me--,Le--)if(ye[Me]!==We[Le]){if(Me!==1||Le!==1)do if(Me--,Le--,Le<0||ye[Me]!==We[Le]){var Be=`
21
+ `+ye[Me].replace(" at new "," at ");return g.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",g.displayName)),typeof g=="function"&&$.set(g,Be),Be}while(Me>=1&&Le>=0);break}}}finally{ee=!1,ue.current=De,pe(),Error.prepareStackTrace=_e}var nt=g?g.displayName||g.name:"",Je=nt?G(nt):"";return typeof g=="function"&&$.set(g,Je),Je}function he(g,B,te){return W(g,!1)}function ze(g){var B=g.prototype;return!!(B&&B.isReactComponent)}function xe(g,B,te){if(g==null)return"";if(typeof g=="function")return W(g,ze(g));if(typeof g=="string")return G(g);switch(g){case C:return G("Suspense");case E:return G("SuspenseList")}if(typeof g=="object")switch(g.$$typeof){case R:return he(g.render);case _:return xe(g.type,B,te);case A:{var de=g,_e=de._payload,De=de._init;try{return xe(De(_e),B,te)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,m={},v=t.ReactDebugCurrentFrame;function S(g){if(g){var B=g._owner,te=xe(g.type,g._source,B?B.type:null);v.setExtraStackFrame(te)}else v.setExtraStackFrame(null)}function H(g,B,te,de,_e){{var De=Function.call.bind(Ae);for(var we in g)if(De(g,we)){var ye=void 0;try{if(typeof g[we]!="function"){var We=Error((de||"React class")+": "+te+" type `"+we+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof g[we]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw We.name="Invariant Violation",We}ye=g[we](B,we,de,te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Me){ye=Me}ye&&!(ye instanceof Error)&&(S(_e),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).",de||"React class",te,we,typeof ye),S(null)),ye instanceof Error&&!(ye.message in m)&&(m[ye.message]=!0,S(_e),c("Failed %s type: %s",te,ye.message),S(null))}}}var re=Array.isArray;function U(g){return re(g)}function se(g){{var B=typeof Symbol=="function"&&Symbol.toStringTag,te=B&&g[Symbol.toStringTag]||g.constructor.name||"Object";return te}}function ge(g){try{return je(g),!1}catch{return!0}}function je(g){return""+g}function d(g){if(ge(g))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",se(g)),je(g)}var w=t.ReactCurrentOwner,D={key:!0,ref:!0,__self:!0,__source:!0},q,Y;function Ce(g){if(Ae.call(g,"ref")){var B=Object.getOwnPropertyDescriptor(g,"ref").get;if(B&&B.isReactWarning)return!1}return g.ref!==void 0}function me(g){if(Ae.call(g,"key")){var B=Object.getOwnPropertyDescriptor(g,"key").get;if(B&&B.isReactWarning)return!1}return g.key!==void 0}function Pe(g,B){typeof g.ref=="string"&&w.current}function ke(g,B){{var te=function(){q||(q=!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)",B))};te.isReactWarning=!0,Object.defineProperty(g,"key",{get:te,configurable:!0})}}function Ye(g,B){{var te=function(){Y||(Y=!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)",B))};te.isReactWarning=!0,Object.defineProperty(g,"ref",{get:te,configurable:!0})}}var $e=function(g,B,te,de,_e,De,we){var ye={$$typeof:a,type:g,key:B,ref:te,props:we,_owner:De};return ye._store={},Object.defineProperty(ye._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ye,"_self",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.defineProperty(ye,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_e}),Object.freeze&&(Object.freeze(ye.props),Object.freeze(ye)),ye};function yt(g,B,te,de,_e){{var De,we={},ye=null,We=null;te!==void 0&&(d(te),ye=""+te),me(B)&&(d(B.key),ye=""+B.key),Ce(B)&&(We=B.ref,Pe(B,_e));for(De in B)Ae.call(B,De)&&!D.hasOwnProperty(De)&&(we[De]=B[De]);if(g&&g.defaultProps){var Me=g.defaultProps;for(De in Me)we[De]===void 0&&(we[De]=Me[De])}if(ye||We){var Le=typeof g=="function"?g.displayName||g.name||"Unknown":g;ye&&ke(we,Le),We&&Ye(we,Le)}return $e(g,ye,We,_e,de,w.current,we)}}var Qe=t.ReactCurrentOwner,Zt=t.ReactDebugCurrentFrame;function Ve(g){if(g){var B=g._owner,te=xe(g.type,g._source,B?B.type:null);Zt.setExtraStackFrame(te)}else Zt.setExtraStackFrame(null)}var et;et=!1;function tt(g){return typeof g=="object"&&g!==null&&g.$$typeof===a}function rt(){{if(Qe.current){var g=Q(Qe.current.type);if(g)return`
22
22
 
23
- Check the render method of \``+t+"`."}return""}}function Xt(t){return""}var at={};function Zt(t){{var c=lt();if(!c){var p=typeof t=="string"?t:t.displayName||t.name;p&&(c=`
23
+ Check the render method of \``+g+"`."}return""}}function Qt(g){return""}var rn={};function ho(g){{var B=rt();if(!B){var te=typeof g=="string"?g:g.displayName||g.name;te&&(B=`
24
24
 
25
- Check the top-level render call using <`+p+">.")}return c}}function ct(t,c){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var p=Zt(c);if(at[p])return;at[p]=!0;var C="";t&&t._owner&&t._owner!==_e.current&&(C=" It was passed a child from "+U(t._owner.type)+"."),ie(t),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,C),ie(null)}}function dt(t,c){{if(typeof t!="object")return;if(Ee(t))for(var p=0;p<t.length;p++){var C=t[p];Ie(C)&&ct(C,c)}else if(Ie(t))t._store&&(t._store.validated=!0);else if(t){var D=r(t);if(typeof D=="function"&&D!==t.entries)for(var $=D.call(t),I;!(I=$.next()).done;)Ie(I.value)&&ct(I.value,c)}}}function Qt(t){{var c=t.type;if(c==null||typeof c=="string")return;var p;if(typeof c=="function")p=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===j||c.$$typeof===g))p=c.propTypes;else return;if(p){var C=U(c);Bt(p,t.props,"prop",C,t)}else if(c.PropTypes!==void 0&&!Oe){Oe=!0;var D=U(c);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function er(t){{for(var c=Object.keys(t.props),p=0;p<c.length;p++){var C=c[p];if(C!=="children"&&C!=="key"){ie(t),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),ie(null);break}}t.ref!==null&&(ie(t),x("Invalid attribute `ref` supplied to `React.Fragment`."),ie(null))}}var ut={};function ht(t,c,p,C,D,$){{var I=W(t);if(!I){var E="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(E+=" 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 K=Xt();K?E+=K:E+=lt();var L;t===null?L="null":Ee(t)?L="array":t!==void 0&&t.$$typeof===a?(L="<"+(U(t.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):L=typeof t,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",L,E)}var J=Kt(t,c,p,D,$);if(J==null)return J;if(I){var Q=c.children;if(Q!==void 0)if(C)if(Ee(Q)){for(var oe=0;oe<Q.length;oe++)dt(Q[oe],t);Object.freeze&&Object.freeze(Q)}else x("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 dt(Q,t)}if(de.call(c,"key")){var te=U(t),X=Object.keys(c).filter(function(sr){return sr!=="key"}),ze=X.length>0?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}";if(!ut[te+ze]){var or=X.length>0?"{"+X.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+te+">.")}return B}}function nn(g,B){{if(!g._store||g._store.validated||g.key!=null)return;g._store.validated=!0;var te=ho(B);if(rn[te])return;rn[te]=!0;var de="";g&&g._owner&&g._owner!==Qe.current&&(de=" It was passed a child from "+Q(g._owner.type)+"."),Ve(g),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',te,de),Ve(null)}}function on(g,B){{if(typeof g!="object")return;if(U(g))for(var te=0;te<g.length;te++){var de=g[te];tt(de)&&nn(de,B)}else if(tt(g))g._store&&(g._store.validated=!0);else if(g){var _e=e(g);if(typeof _e=="function"&&_e!==g.entries)for(var De=_e.call(g),we;!(we=De.next()).done;)tt(we.value)&&nn(we.value,B)}}}function go(g){{var B=g.type;if(B==null||typeof B=="string")return;var te;if(typeof B=="function")te=B.propTypes;else if(typeof B=="object"&&(B.$$typeof===R||B.$$typeof===_))te=B.propTypes;else return;if(te){var de=Q(B);H(te,g.props,"prop",de,g)}else if(B.PropTypes!==void 0&&!et){et=!0;var _e=Q(B);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_e||"Unknown")}typeof B.getDefaultProps=="function"&&!B.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mo(g){{for(var B=Object.keys(g.props),te=0;te<B.length;te++){var de=B[te];if(de!=="children"&&de!=="key"){Ve(g),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",de),Ve(null);break}}g.ref!==null&&(Ve(g),c("Invalid attribute `ref` supplied to `React.Fragment`."),Ve(null))}}var sn={};function an(g,B,te,de,_e,De){{var we=F(g);if(!we){var ye="";(g===void 0||typeof g=="object"&&g!==null&&Object.keys(g).length===0)&&(ye+=" 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 We=Qt();We?ye+=We:ye+=rt();var Me;g===null?Me="null":U(g)?Me="array":g!==void 0&&g.$$typeof===a?(Me="<"+(Q(g.type)||"Unknown")+" />",ye=" Did you accidentally export a JSX literal instead of a component?"):Me=typeof g,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Me,ye)}var Le=yt(g,B,te,_e,De);if(Le==null)return Le;if(we){var Be=B.children;if(Be!==void 0)if(de)if(U(Be)){for(var nt=0;nt<Be.length;nt++)on(Be[nt],g);Object.freeze&&Object.freeze(Be)}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 on(Be,g)}if(Ae.call(B,"key")){var Je=Q(g),He=Object.keys(B).filter(function(So){return So!=="key"}),er=He.length>0?"{key: someKey, "+He.join(": ..., ")+": ...}":"{key: someKey}";if(!sn[Je+er]){var wo=He.length>0?"{"+He.join(": ..., ")+": ...}":"{}";c(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,ze,te,or,te),ut[te+ze]=!0}}return t===l?er(J):Qt(J),J}}function tr(t,c,p){return ht(t,c,p,!0)}function rr(t,c,p){return ht(t,c,p,!1)}var nr=rr,ir=tr;le.Fragment=l,le.jsx=nr,le.jsxs=ir})(),le}var Ne;function xt(){if(Ne)return ue.exports;Ne=1;var s={};return s.NODE_ENV==="production"?ue.exports=gt():ue.exports=mt(),ue.exports}var e=xt();const he={A4:{width:210,height:297},A3:{width:297,height:420},A5:{width:148,height:210},Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6}},Fe={paperSize:"A4",customWidth:210,customHeight:297,orientation:"portrait",marginTop:10,marginRight:10,marginBottom:10,marginLeft:10,showHeader:!1,headerContent:"页眉文字",showFooter:!1,footerContent:"页脚文字",showPageNumber:!0,pageNumberFormat:"第 {page} 页"},A=3,fe={cellSize:1,cols:100},$e={text:"文本",image:"图片",table:"表格",barcode:"条形码",line:"分割线"},yt={text:{content:"双击编辑文字",fontSize:14,fontWeight:"normal",fontStyle:"normal",textAlign:"left",color:"#000000",backgroundColor:"transparent"},image:{src:"",fit:"contain",content:""},table:{rows:3,cols:3,borderWidth:1,borderColor:"#000000",content:""},barcode:{value:"1234567890",format:"CODE128",content:""},line:{color:"#000000",thickness:1,style:"solid",content:""}};let Se=0,Ce=0;function Be(){return`comp_${++Se}`}function Ve(){return`ds_${++Ce}`}const T=ft.create((s,d)=>({components:[],selectedId:null,pageSettings:{...Fe},gridSettings:{...fe},previewVisible:!1,templateName:"未命名模板",headerFooterVisible:!1,dataSources:[],activeDataSourceId:null,addComponent:(a,n,l)=>{const i=Be(),v=$e[a]||a,m={...yt[a]||{}};a==="text"&&(m.content=v);const u={id:i,type:a,x:n??0,y:l??0,w:a==="line"?20:15,h:a==="line"?1:8,props:m,...a==="table"?{tableColumns:[{title:"列1"},{title:"列2"},{title:"列3"}]}:{}};s(j=>({components:[...j.components,u],selectedId:i}))},updateComponent:(a,n)=>{s(l=>({components:l.components.map(i=>i.id===a?{...i,...n}:i)}))},selectComponent:a=>{s({selectedId:a})},removeComponent:a=>{s(n=>({components:n.components.filter(l=>l.id!==a),selectedId:n.selectedId===a?null:n.selectedId}))},setComponents:a=>{s({components:a})},setPageSettings:a=>{s(n=>({pageSettings:{...n.pageSettings,...a}}))},setPreviewVisible:a=>{s({previewVisible:a})},setTemplateName:a=>{s({templateName:a})},setHeaderFooterVisible:a=>{s({headerFooterVisible:a})},addDataSource:(a,n,l)=>{const v={id:Ve(),name:a,type:n,data:l,createdAt:Date.now()};s(m=>({dataSources:[...m.dataSources,v]}))},updateDataSource:(a,n)=>{s(l=>({dataSources:l.dataSources.map(i=>i.id===a?{...i,...n}:i)}))},removeDataSource:a=>{s(n=>({dataSources:n.dataSources.filter(l=>l.id!==a),activeDataSourceId:n.activeDataSourceId===a?null:n.activeDataSourceId}))},setActiveDataSourceId:a=>{s({activeDataSourceId:a})},updateComponentTableColumns:(a,n)=>{s(l=>({components:l.components.map(i=>i.id===a?{...i,tableColumns:n}:i)}))},exportJSON:()=>{const a=d(),n={version:"1.0",templateName:a.templateName,pageSettings:a.pageSettings,components:a.components.map(({id:l,...i})=>i),dataSources:a.dataSources.map(({id:l,...i})=>i)};return JSON.stringify(n,null,2)},importJSON:a=>{try{const n=JSON.parse(a);if(!n.version||!n.pageSettings||!Array.isArray(n.components))return"JSON 格式不正确,缺少必要字段";Se=0,Ce=0;const l=n.components.map(v=>({...v,id:Be()})),i=(n.dataSources||[]).map(v=>({...v,id:Ve()}));return s({components:l,dataSources:i,pageSettings:n.pageSettings,templateName:n.templateName||"导入的模板",selectedId:null,activeDataSourceId:null}),null}catch{return"JSON 解析失败,请检查文件内容"}},reset:()=>{Se=0,Ce=0,s({components:[],selectedId:null,pageSettings:{...Fe},gridSettings:{...fe},templateName:"未命名模板",headerFooterVisible:!1,previewVisible:!1,dataSources:[],activeDataSourceId:null})}})),{Text:lr}=o.Typography,vt=({onCustomSave:s,onCustomPrint:d})=>{const a=T(f=>f.templateName),n=T(f=>f.setTemplateName),l=T(f=>f.setPreviewVisible),i=T(f=>f.setHeaderFooterVisible),v=T(f=>f.selectedId),m=T(f=>f.removeComponent),u=T(f=>f.exportJSON),j=T(f=>f.importJSON),b=T(f=>f.reset),P=w.useRef(null),{message:g}=o.App.useApp(),z=w.useCallback(()=>{v&&m(v)},[v,m]),N=w.useCallback(()=>{const f=u(),x=new Blob([f],{type:"application/json"}),_=URL.createObjectURL(x),h=document.createElement("a");h.href=_,h.download=`${a||"模板"}.json`,h.click(),URL.revokeObjectURL(_),g.success("模板已导出")},[u,a,g]),y=w.useCallback(()=>{var f;(f=P.current)==null||f.click()},[]),O=w.useCallback(f=>{var h;const x=(h=f.target.files)==null?void 0:h[0];if(!x)return;const _=new FileReader;_.onload=()=>{const S=j(_.result);S?g.error(S):g.success("模板已导入")},_.readAsText(x),f.target.value=""},[j,g]),r=w.useCallback(()=>{b(),g.info("已新建空白模板")},[b,g]);return e.jsxs("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:[e.jsx(o.Space,{children:e.jsx(o.Input,{value:a,onChange:f=>n(f.target.value),variant:"borderless",style:{width:200,fontSize:16,fontWeight:600},placeholder:"模板名称"})}),e.jsxs(o.Space,{children:[e.jsx(o.Button,{icon:e.jsx(B.PlusOutlined,{}),onClick:r,children:"新建"}),e.jsx("input",{ref:P,type:"file",accept:".json",style:{display:"none"},onChange:O}),s?e.jsx(o.Button,{icon:e.jsx(B.SaveOutlined,{}),onClick:s,type:"primary",children:"保存"}):e.jsx(o.Button,{icon:e.jsx(B.DownloadOutlined,{}),onClick:N,children:"导出"}),e.jsx(o.Button,{icon:e.jsx(B.UploadOutlined,{}),onClick:y,children:"导入"}),e.jsx(o.Button,{icon:e.jsx(B.SettingOutlined,{}),onClick:()=>i(!0),children:"页眉页脚"}),e.jsx(o.Button,{danger:!0,icon:e.jsx(B.DeleteOutlined,{}),disabled:!v,onClick:z,children:"删除"}),d?e.jsx(o.Button,{type:"primary",icon:e.jsx(B.PrinterOutlined,{}),onClick:d,children:"打印"}):e.jsx(o.Button,{type:"primary",icon:e.jsx(B.EyeOutlined,{}),onClick:()=>l(!0),children:"预览"})]})]})},{Text:ee}=o.Typography,bt=()=>{const s=T(i=>i.pageSettings),d=T(i=>i.setPageSettings),a=s.paperSize==="custom",n=w.useCallback(i=>{d({paperSize:i})},[d]),l=w.useCallback(i=>{d({orientation:i})},[d]);return e.jsx(o.Card,{title:"页面设置",size:"small",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:12},children:"纸张大小"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:s.paperSize,onChange:n,options:[...Object.keys(he).map(i=>({value:i,label:i})),{value:"custom",label:"自定义"}]})]}),a&&e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(ee,{style:{fontSize:12},children:"宽度 (mm)"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:s.customWidth,min:10,max:2e3,onChange:i=>d({customWidth:i??210})})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(ee,{style:{fontSize:12},children:"高度 (mm)"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:s.customHeight,min:10,max:2e3,onChange:i=>d({customHeight:i??297})})]})]}),e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:12},children:"方向"}),e.jsxs(o.Radio.Group,{value:s.orientation,onChange:i=>l(i.target.value),size:"small",style:{width:"100%",display:"flex"},children:[e.jsx(o.Radio.Button,{value:"portrait",style:{flex:1,textAlign:"center"},children:"纵向"}),e.jsx(o.Radio.Button,{value:"landscape",style:{flex:1,textAlign:"center"},children:"横向"})]})]}),e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:12},children:"页边距 (mm)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:11},children:"上"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:s.marginTop,min:0,max:100,onChange:i=>d({marginTop:i??10})})]}),e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:11},children:"右"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:s.marginRight,min:0,max:100,onChange:i=>d({marginRight:i??10})})]}),e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:11},children:"下"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:s.marginBottom,min:0,max:100,onChange:i=>d({marginBottom:i??10})})]}),e.jsxs("div",{children:[e.jsx(ee,{style:{fontSize:11},children:"左"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:s.marginLeft,min:0,max:100,onChange:i=>d({marginLeft:i??10})})]})]})]})]})})},{Text:jt}=o.Typography,St=[{type:"text",icon:e.jsx(B.FontSizeOutlined,{}),label:"文本"},{type:"image",icon:e.jsx(B.PictureOutlined,{}),label:"图片"},{type:"table",icon:e.jsx(B.TableOutlined,{}),label:"表格"},{type:"barcode",icon:e.jsx(B.BarcodeOutlined,{}),label:"条形码"},{type:"line",icon:e.jsx(B.MinusOutlined,{}),label:"分割线"}],Ct=()=>{const s=T(n=>n.addComponent),d=w.useCallback((n,l)=>{n.dataTransfer.setData("componentType",l),n.dataTransfer.effectAllowed="copy"},[]),a=w.useCallback(n=>{s(n)},[s]);return e.jsx(o.Card,{title:"组件面板",size:"small",children:e.jsx(o.Space,{direction:"vertical",style:{width:"100%"},size:4,children:St.map(n=>e.jsxs("div",{draggable:!0,onDragStart:l=>d(l,n.type),onClick:()=>a(n.type),style:{cursor:"grab",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:6,display:"flex",alignItems:"center",gap:8,background:"#fafafa",userSelect:"none",transition:"all 0.2s"},onMouseEnter:l=>{l.currentTarget.style.background="#e6f4ff",l.currentTarget.style.borderColor="#1677ff"},onMouseLeave:l=>{l.currentTarget.style.background="#fafafa",l.currentTarget.style.borderColor="#d9d9d9"},children:[n.icon,e.jsx(jt,{children:n.label})]},n.type))})})};function ae(s){try{return JSON.parse(s)}catch{return null}}function ce(s,d,a){const n=`${d}Binding`,l=s.props[n];if(l&&l.dataSourceId&&l.fieldPath){const v=a.find(m=>m.id===l.dataSourceId);if(v){const m=ge(v);if(m){const u=pe(m,l.fieldPath);if(u)return u}}}return s.props[d]||(l==null?void 0:l.staticValue)||""}function pe(s,d){if(!s||!d)return"";try{const a=d.split(".");let n=s;for(const l of a){if(typeof n!="object"||n===null)return"";n=n[l]}return n!=null?String(n):""}catch{return""}}function ge(s){const d=ae(s.data);return s.type==="object"&&d&&typeof d=="object"&&!Array.isArray(d)?d:null}function me(s){const d=ae(s.data);return s.type==="array"&&Array.isArray(d)?d:null}const{TextArea:wt}=o.Input,{Text:xe,Title:ar}=o.Typography,We=JSON.stringify({name:"张三",age:28,department:"技术部",email:"zhangsan@example.com"},null,2),Tt=JSON.stringify([{id:1,product:"商品A",quantity:2,price:100},{id:2,product:"商品B",quantity:5,price:80},{id:3,product:"商品C",quantity:1,price:200}],null,2),kt=()=>{const s=T(g=>g.dataSources),d=T(g=>g.addDataSource),a=T(g=>g.updateDataSource),n=T(g=>g.removeDataSource),[l,i]=w.useState(!1),[v,m]=w.useState(null),[u,j]=w.useState({name:"",type:"object",data:""}),b=g=>{g?(m(g.id),j({name:g.name,type:g.type,data:g.data})):(m(null),j({name:"新数据源",type:"object",data:We})),i(!0)},P=()=>{const g=ae(u.data);if(g===null){o.message.error("JSON 格式不正确");return}if(u.type==="object"&&(Array.isArray(g)||typeof g!="object")){o.message.error("对象类型数据源必须为对象格式");return}if(u.type==="array"&&!Array.isArray(g)){o.message.error("数组类型数据源必须为数组格式");return}v?(a(v,u),o.message.success("数据源已更新")):(d(u.name,u.type,u.data),o.message.success("数据源已添加")),i(!1)};return e.jsxs(o.Card,{title:"数据源",size:"small",extra:e.jsx(o.Button,{type:"link",size:"small",icon:e.jsx(B.PlusOutlined,{}),onClick:()=>b(),children:"添加"}),children:[e.jsx(o.List,{size:"small",dataSource:s,locale:{emptyText:"暂无数据源"},renderItem:g=>e.jsx(o.List.Item,{actions:[e.jsx(o.Dropdown,{menu:{items:[{key:"edit",label:"编辑",icon:e.jsx(B.EditOutlined,{}),onClick:()=>b(g)},{type:"divider"},{key:"delete",label:e.jsx(o.Popconfirm,{title:"确定要删除这个数据源吗?",onConfirm:z=>{z==null||z.stopPropagation(),n(g.id),o.message.success("已删除")},okText:"确定",cancelText:"取消",onCancel:z=>z==null?void 0:z.stopPropagation(),children:e.jsx("span",{style:{color:"#ff4d4f",cursor:"pointer"},children:"删除"})}),icon:e.jsx(B.DeleteOutlined,{style:{color:"#ff4d4f"}})}]},placement:"bottomRight",children:e.jsx(o.Button,{type:"text",size:"small",icon:e.jsx(B.MoreOutlined,{})})})],children:e.jsx(o.List.Item.Meta,{avatar:e.jsx(B.DatabaseOutlined,{}),title:e.jsx(xe,{strong:!0,children:g.name}),description:e.jsx(o.Space,{size:4,children:e.jsx(o.Tag,{color:g.type==="object"?"blue":"green",children:g.type==="object"?"对象":"数组"})})})})}),e.jsx(o.Modal,{title:v?"编辑数据源":"添加数据源",open:l,onOk:P,onCancel:()=>i(!1),okText:"保存",cancelText:"取消",children:e.jsxs(o.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[e.jsxs("div",{children:[e.jsx(xe,{strong:!0,style:{display:"block",marginBottom:4},children:"名称"}),e.jsx(o.Input,{placeholder:"请输入数据源名称",value:u.name,onChange:g=>j({...u,name:g.target.value})})]}),e.jsxs("div",{children:[e.jsx(xe,{strong:!0,style:{display:"block",marginBottom:4},children:"类型"}),e.jsx(o.Select,{options:[{label:"对象",value:"object"},{label:"数组",value:"array"}],style:{width:"100%"},value:u.type,onChange:g=>{j({...u,type:g,data:g==="object"?We:Tt})}})]}),e.jsx(o.Divider,{style:{margin:"8px 0"}}),e.jsxs("div",{children:[e.jsx(xe,{strong:!0,style:{display:"block",marginBottom:4},children:"JSON 数据"}),e.jsx(wt,{rows:12,placeholder:"请输入 JSON 数据",value:u.data,onChange:g=>j({...u,data:g.target.value})})]})]})})]})},Pt=()=>e.jsx(o.Collapse,{bordered:!1,defaultActiveKey:["1","2"],expandIcon:({isActive:s})=>e.jsx(B.CaretRightOutlined,{rotate:s?90:0}),style:{height:"100%",overflowY:"auto"},items:[{key:"1",label:"页面设置",children:e.jsx(bt,{})},{key:"2",label:"组件",children:e.jsx(Ct,{})},{key:"3",label:"数据源",children:e.jsx(kt,{})}]});function Le(s){const d=[];d.push(1,1,0,1,1,0,1,1);for(let a=0;a<s.length;a++){const l=(s.charCodeAt(a)%103).toString(2).padStart(7,"0");for(const i of l)d.push(i==="1"?1:0)}return d.push(1,1,0,0,0,1,1,0,0,0,1,1),d}const we=({value:s,format:d})=>{const a=w.useMemo(()=>Le(s),[s,d]);if(!s)return e.jsx("div",{style:{fontSize:11,color:"#999"},children:"请设置条形码值"});const n=2,l=44,i=a.length*n;return e.jsxs("div",{style:{textAlign:"center",overflow:"hidden",maxWidth:"100%"},children:[e.jsx("canvas",{ref:v=>{if(!v)return;const m=v.getContext("2d");m&&(v.width=i,v.height=l,m.clearRect(0,0,i,l),a.forEach((u,j)=>{m.fillStyle=u===1?"#000":"#fff",m.fillRect(j*n,0,n,l)}))},style:{width:"100%",maxWidth:i,height:l}}),e.jsx("div",{style:{fontSize:10,marginTop:1,letterSpacing:1},children:s})]})},Et=pt,Me=w.memo(({comp:s,selected:d,isPreview:a=!1,dataSources:n=[]})=>{const l={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",outline:a?"none":d?"2px solid #1677ff":"1px dashed #d9d9d9",outlineOffset:-1},i=v=>ce(s,v,n);switch(s.type){case"text":return e.jsx("div",{style:{...l,fontSize:s.props.fontSize||14,fontWeight:s.props.fontWeight||"normal",fontStyle:s.props.fontStyle||"normal",textAlign:s.props.textAlign||"left",color:s.props.color||"#000",backgroundColor:s.props.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i("content")||""});case"image":const v=i("src")||s.props.src;return e.jsx("div",{style:l,children:v?e.jsx("img",{src:v,style:{width:"100%",height:"100%",objectFit:s.props.fit||"contain"},alt:""}):e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#bbb",fontSize:12},children:"请在属性中设置图片地址"})});case"table":return e.jsx(_t,{comp:s,style:l,dataSources:n});case"barcode":const m=i("value")||s.props.value||"123456";return e.jsx("div",{style:{...l,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(we,{value:m,format:s.props.format||"CODE128"})});case"line":return e.jsx("div",{style:{...l,display:"flex",alignItems:"center",border:"none",outline:d?"2px solid #1677ff":"1px dashed transparent"},children:e.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${s.props.thickness||1}px ${s.props.style||"solid"} ${s.props.color||"#000"}`,margin:0}})});default:return e.jsx("div",{style:l,children:s.type})}}),_t=({comp:s,style:d,dataSources:a=[]})=>{const n=s.props.borderWidth||1,l=s.props.borderColor||"#000",i=s.tableColumns||[],v=s.props.tableDataSourceId,m=v?a.find(P=>P.id===v):null,u=m?me(m):null;if(u&&u.length>0)return e.jsxs("table",{style:{...d,borderCollapse:"collapse",width:"100%",height:"100%"},children:[i.length>0&&e.jsx("thead",{children:e.jsx("tr",{style:{backgroundColor:"#f5f5f5"},children:i.map((P,g)=>e.jsx("th",{style:{border:`${n}px solid ${l}`,padding:4,fontSize:12,fontWeight:"bold",textAlign:"center"},children:P.title},g))})}),e.jsx("tbody",{children:u.map((P,g)=>e.jsx("tr",{children:i.map((z,N)=>e.jsx("td",{style:{border:`${n}px solid ${l}`,padding:4,fontSize:12,textAlign:"center"},children:z.fieldPath?P[z.fieldPath]:""},N))},g))})]});const j=s.props.rows||3,b=Math.max(s.props.cols||3,i.length||3);return e.jsx("table",{style:{...d,borderCollapse:"collapse",width:"100%",height:"100%"},children:e.jsx("tbody",{children:Array.from({length:j}).map((P,g)=>e.jsx("tr",{children:Array.from({length:b}).map((z,N)=>e.jsx("td",{style:{border:`${n}px solid ${l}`,padding:2,fontSize:12,textAlign:"center"},children:" "},N))},g))})})},Je=({isPreview:s=!1})=>{const d=T(r=>r.components),a=T(r=>r.selectedId),n=T(r=>r.pageSettings),l=T(r=>r.selectComponent);T(r=>r.updateComponent);const i=T(r=>r.setComponents),v=T(r=>r.addComponent),m=T(r=>r.gridSettings),u=T(r=>r.dataSources),j=w.useMemo(()=>{const r=he[n.paperSize];if(!r)return{width:n.customWidth*A,height:n.customHeight*A};const f=r.width*A,x=r.height*A;return n.orientation==="landscape"?{width:x,height:f}:{width:f,height:x}},[n]),b=w.useMemo(()=>({top:n.marginTop*A,right:n.marginRight*A,bottom:n.marginBottom*A,left:n.marginLeft*A}),[n]),P=j.width-b.left-b.right,g=j.height-b.top-b.bottom,z=w.useMemo(()=>d.map(r=>({i:r.id,x:r.x,y:r.y,w:r.w,h:r.h})),[d]),N=w.useCallback(r=>{const f=d.map((x,_)=>{const h=r[_];return h?{...x,x:h.x,y:h.y,w:h.w,h:h.h}:x});i(f)},[d,i]),y=w.useCallback((r,f,x)=>{var F,V;const _=x,h=(F=_.dataTransfer)==null?void 0:F.getData("componentType");if(!h)return;const S=(V=x.target.closest(".react-grid-layout"))==null?void 0:V.getBoundingClientRect();if(S){const H=Math.floor((_.clientX-S.left)/(P/m.cols)),q=Math.floor((_.clientY-S.top)/(P/m.cols));v(h,Math.max(0,H),Math.max(0,q))}else v(h)},[v,P,m.cols]),O=w.useCallback(r=>{l(r===a?null:r)},[l,a]);return e.jsx("div",{style:{flex:1,overflow:"auto",background:"#e8e8e8",display:"flex",justifyContent:"center",padding:"24px 0"},children:e.jsxs("div",{id:"print-paper",style:{width:j.width,height:j.height,background:"#fff",boxShadow:"0 2px 12px rgba(0,0,0,0.15)",position:"relative",flexShrink:0},children:[n.showHeader&&e.jsx("div",{style:{position:"absolute",top:0,left:b.left,right:b.right,height:b.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#999",borderBottom:"1px dashed #ddd",overflow:"hidden"},children:n.headerContent}),n.showFooter&&e.jsxs("div",{style:{position:"absolute",bottom:0,left:b.left,right:b.right,height:b.bottom,display:"flex",alignItems:"center",justifyContent:n.showPageNumber?"space-between":"center",fontSize:12,color:"#999",borderTop:"1px dashed #ddd",overflow:"hidden",padding:"0 8px"},children:[e.jsx("span",{children:n.footerContent}),n.showPageNumber&&e.jsx("span",{children:n.pageNumberFormat.replace("{page}","1")})]}),e.jsx("div",{style:{position:"absolute",top:b.top,left:b.left,width:P,height:g},children:s?e.jsx("div",{style:{width:"100%",height:"100%",position:"relative"},children:d.map(r=>{const f=P/m.cols,x=P/m.cols,_={position:"absolute",left:r.x*f,top:r.y*x,width:r.w*f,height:r.h*x};return e.jsx("div",{style:_,children:e.jsx(Me,{comp:r,selected:!1,isPreview:!0,dataSources:u})},r.id)})}):e.jsx(Et,{className:"canvas-grid",layout:z,cols:m.cols,rowHeight:P/m.cols,width:P,margin:[0,0],containerPadding:[0,0],onLayoutChange:N,onDrop:y,isDroppable:!0,isResizable:!0,isDraggable:!0,compactType:null,preventCollision:!0,draggableHandle:".grid-item-drag-handle",style:{minHeight:g},children:d.map(r=>e.jsx("div",{className:"grid-item-drag-handle",onClick:()=>O(r.id),style:{cursor:"move"},children:e.jsx(Me,{comp:r,selected:r.id===a,dataSources:u})},r.id))})})]})})},{Text:M,Title:cr}=o.Typography,{TextArea:Ot}=o.Input,It=()=>{const s=T(r=>r.components),d=T(r=>r.selectedId),a=T(r=>r.dataSources),n=T(r=>r.updateComponent),l=T(r=>r.updateComponentTableColumns),i=w.useMemo(()=>s.find(r=>r.id===d)||null,[s,d]),[v,m]=w.useState([]),u=w.useMemo(()=>[{label:"无(使用静态值)",value:""},...a.map(r=>({label:r.name,value:r.id,type:r.type}))],[a]),j=w.useCallback((r,f)=>{d&&n(d,{props:{...i==null?void 0:i.props,[r]:f}})},[d,i,n]),b=w.useCallback((r,f,x,_)=>{if(!d)return;let h=_;f&&x&&(h=_);const S=`${r}Binding`;n(d,{props:{...i==null?void 0:i.props,[r]:h,[S]:{dataSourceId:f,fieldPath:x,staticValue:_}}})},[d,i,n]),P=w.useCallback(r=>{const f=i==null?void 0:i.props[`${r}Binding`],x=String((i==null?void 0:i.props[r])||"");return f?{field:r,dataSourceId:f.dataSourceId||null,fieldPath:f.fieldPath||"",staticValue:f.staticValue??x}:{field:r,dataSourceId:null,fieldPath:"",staticValue:x}},[i]);if(!i)return e.jsx(o.Card,{title:"属性面板",size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16}},children:e.jsx(o.Empty,{description:"请选择画布中的组件",image:o.Empty.PRESENTED_IMAGE_SIMPLE})});const g=$e[i.type]||i.type,z=e.jsxs(e.Fragment,{children:[e.jsx(M,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"位置和大小"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12},children:"X"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:i.x,onChange:r=>n(d,{x:r??0})})]}),e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12},children:"Y"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:i.y,onChange:r=>n(d,{y:r??0})})]}),e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12},children:"宽度"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:i.w,min:1,onChange:r=>n(d,{w:r??1})})]}),e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12},children:"高度"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:i.h,min:1,onChange:r=>n(d,{h:r??1})})]})]})]}),N=({field:r,label:f,placeholder:x,isTextarea:_=!1})=>{const h=P(r),S=a.find(W=>W.id===h.dataSourceId),F=S?ge(S):null,V=F?Object.keys(F):[],[H,q]=w.useState(h.staticValue);return w.useEffect(()=>{q(h.staticValue)},[h.staticValue,h.dataSourceId]),e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12,display:"block",marginBottom:4},children:f}),e.jsx("div",{style:{marginBottom:4},children:e.jsx(o.Select,{size:"small",style:{width:"100%"},placeholder:"选择数据源",value:h.dataSourceId||"",onChange:W=>{b(r,W||null,W&&h.fieldPath||"",h.staticValue)},options:u})}),h.dataSourceId&&e.jsx("div",{style:{marginBottom:4},children:e.jsx(o.Select,{size:"small",style:{width:"100%"},placeholder:"选择字段",value:h.fieldPath,onChange:W=>{b(r,h.dataSourceId,W||"",h.staticValue)},options:[{label:"请选择字段",value:""},...V.map(W=>({label:W,value:W}))]})}),h.dataSourceId?e.jsxs("div",{style:{padding:6,background:"#f0f5ff",border:"1px solid #adc6ff",borderRadius:4,fontSize:12},children:[e.jsx(B.DatabaseOutlined,{style:{marginRight:4,color:"#1890ff"}}),e.jsx("span",{style:{fontWeight:500},children:"数据绑定已启用"}),S&&h.fieldPath&&e.jsxs("span",{style:{marginLeft:8},children:[e.jsx(o.Tag,{color:"blue",children:S.name}),e.jsx(o.Tag,{color:"green",children:h.fieldPath})]})]}):_?e.jsx(Ot,{rows:3,placeholder:x,value:H,onChange:W=>q(W.target.value),onBlur:()=>{b(r,null,"",H)}}):e.jsx(o.Input,{placeholder:x,value:H,onChange:W=>q(W.target.value),onBlur:()=>{b(r,null,"",H)}})]})},y=()=>{const r=i.tableColumns||[],f=a.filter(k=>k.type==="array"),x=i.props.tableDataSourceId||"",_=f.find(k=>k.id===x),h=v.length>0?v:r,[S,F]=w.useState({}),V=()=>{l(d,h)},H=()=>{const k=[...h,{title:`列${h.length+1}`}];m(k)},q=k=>{const R=h.filter((G,Z)=>Z!==k);m(R)},W=(k,R,G)=>{const Z=[...h];Z[k]={...Z[k],[R]:G},m(Z)};let re=[];if(_){const k=ae(_.data);Array.isArray(k)&&k.length>0&&typeof k[0]=="object"&&(re=Object.keys(k[0]))}const ne=[{title:"列标题",dataIndex:"title",width:100,render:(k,R)=>{const G=R.key in S?S[R.key]:R.title;return e.jsx(o.Input,{size:"small",value:G,placeholder:"列标题",onChange:Z=>{F({...S,[R.key]:Z.target.value})},onBlur:()=>{if(R.key in S){W(Number(R.key),"title",S[R.key]);const Z={...S};delete Z[R.key],F(Z),V()}}})}},{title:"绑定字段",dataIndex:"fieldPath",width:120,render:(k,R)=>e.jsx(o.Select,{size:"small",style:{width:"100%"},value:R.fieldPath||"",placeholder:_?"绑定字段":"选择数据源先",disabled:!_,onChange:G=>{W(Number(R.key),"fieldPath",G||""),V()},options:[{label:"无绑定",value:""},...re.map(G=>({label:G,value:G}))]})},{title:"操作",width:60,render:(k,R)=>e.jsx(o.Popconfirm,{title:"确定要删除吗?",onConfirm:()=>{q(Number(R.key)),V()},okText:"确定",cancelText:"取消",children:e.jsx(o.Button,{type:"text",danger:!0,size:"small",icon:e.jsx(B.DeleteOutlined,{})})})}],U=h.map((k,R)=>({...k,key:String(R)}));return e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:e.jsx(M,{style:{fontSize:12},children:"表格数据源"})}),e.jsx(o.Select,{size:"small",style:{width:"100%",marginBottom:8},placeholder:"选择数组类型数据源",value:x,onChange:k=>j("tableDataSourceId",k||""),options:[{label:"无(仅静态展示)",value:""},...f.map(k=>({label:k.name,value:k.id}))]}),e.jsx(o.Divider,{}),e.jsxs(o.Space,{style:{marginBottom:8},children:[e.jsx(M,{style:{fontSize:12},children:"列配置"}),e.jsx(o.Button,{size:"small",type:"dashed",icon:e.jsx(B.PlusOutlined,{}),onClick:H}),e.jsx(o.Button,{size:"small",type:"primary",onClick:V,icon:e.jsx(B.SaveOutlined,{})})]}),e.jsx(o.Table,{dataSource:U,columns:ne,pagination:!1,size:"small",bordered:!0,rowKey:"key"})]})},O=()=>{switch(i.type){case"text":return e.jsxs(e.Fragment,{children:[e.jsx(N,{field:"content",label:"内容",placeholder:"请输入文本内容",isTextarea:!0}),e.jsx(o.Divider,{style:{margin:"4px 0"}}),e.jsx(M,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"文字样式"}),e.jsxs(o.Space,{style:{width:"100%"},direction:"vertical",size:4,children:[e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(M,{style:{fontSize:12},children:"字号"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:i.props.fontSize||14,min:6,max:200,onChange:r=>j("fontSize",r??14)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(M,{style:{fontSize:12},children:"对齐"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:i.props.textAlign||"left",onChange:r=>j("textAlign",r),options:[{value:"left",label:"左"},{value:"center",label:"中"},{value:"right",label:"右"}]})]})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(M,{style:{fontSize:12},children:"字重"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:i.props.fontWeight||"normal",onChange:r=>j("fontWeight",r),options:[{value:"normal",label:"常规"},{value:"bold",label:"加粗"}]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(M,{style:{fontSize:12},children:"样式"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:i.props.fontStyle||"normal",onChange:r=>j("fontStyle",r),options:[{value:"normal",label:"常规"},{value:"italic",label:"斜体"}]})]})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12},children:"字体颜色"}),e.jsx(o.ColorPicker,{size:"small",value:i.props.color||"#000000",onChange:(r,f)=>j("color",f)})]}),e.jsxs("div",{children:[e.jsx(M,{style:{fontSize:12},children:"背景色"}),e.jsx(o.ColorPicker,{size:"small",value:i.props.backgroundColor||"transparent",onChange:(r,f)=>j("backgroundColor",f)})]})]})]})]});case"image":return e.jsxs(e.Fragment,{children:[e.jsx(N,{field:"src",label:"图片地址",placeholder:"输入图片 URL"}),e.jsx(o.Divider,{style:{margin:"4px 0"}}),e.jsx(M,{style:{fontSize:12,marginTop:8,display:"block"},children:"适应方式"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:i.props.fit||"contain",onChange:r=>j("fit",r),options:[{value:"contain",label:"适应"},{value:"cover",label:"填充"},{value:"fill",label:"拉伸"}]})]});case"table":return e.jsx(y,{});case"barcode":return e.jsxs(e.Fragment,{children:[e.jsx(N,{field:"value",label:"条码值",placeholder:"输入条码内容"}),e.jsx(o.Divider,{style:{margin:"4px 0"}}),e.jsx(M,{style:{fontSize:12,marginTop:8,display:"block"},children:"格式"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:i.props.format||"CODE128",onChange:r=>j("format",r),options:[{value:"CODE128",label:"CODE128"}]})]});case"line":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(M,{style:{fontSize:12},children:"粗细"}),e.jsx(o.InputNumber,{size:"small",style:{width:"100%"},value:i.props.thickness||1,min:1,max:20,onChange:r=>j("thickness",r??1)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(M,{style:{fontSize:12},children:"样式"}),e.jsx(o.Select,{size:"small",style:{width:"100%"},value:i.props.style||"solid",onChange:r=>j("style",r),options:[{value:"solid",label:"实线"},{value:"dashed",label:"虚线"},{value:"dotted",label:"点线"}]})]})]}),e.jsxs("div",{style:{marginTop:8},children:[e.jsx(M,{style:{fontSize:12},children:"颜色"}),e.jsx(o.ColorPicker,{size:"small",value:i.props.color||"#000000",onChange:(r,f)=>j("color",f)})]})]});default:return null}};return e.jsx(o.Card,{title:`属性 - ${g}`,size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16,overflowY:"auto"}},children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[z,e.jsx(o.Divider,{style:{margin:"4px 0"}}),O()]})})},{Text:dr}=o.Typography,zt=()=>{const s=T(y=>y.previewVisible),d=T(y=>y.setPreviewVisible),a=T(y=>y.components),n=T(y=>y.pageSettings),l=T(y=>y.gridSettings)||fe,i=T(y=>y.dataSources),v=w.useRef(null),m=w.useMemo(()=>{const y=he[n.paperSize];if(!y)return{width:n.customWidth*A,height:n.customHeight*A};const O=y.width*A,r=y.height*A;return n.orientation==="landscape"?{width:r,height:O}:{width:O,height:r}},[n]),u=w.useMemo(()=>({top:n.marginTop*A,right:n.marginRight*A,bottom:n.marginBottom*A,left:n.marginLeft*A}),[n]),j=m.width-u.left-u.right,b=j/l.cols,P=De.useReactToPrint({contentRef:v,documentTitle:"打印模板",pageStyle:`
30
+ <%s key={someKey} {...props} />`,er,Je,wo,Je),sn[Je+er]=!0}}return g===h?mo(Le):go(Le),Le}}function yo(g,B,te){return an(g,B,te,!0)}function vo(g,B,te){return an(g,B,te,!1)}var bo=vo,xo=yo;it.Fragment=h,it.jsx=bo,it.jsxs=xo})(),it}var or;function pn(){if(or)return vt.exports;or=1;var r={};return r.NODE_ENV==="production"?vt.exports=dn():vt.exports=fn(),vt.exports}var s=pn();const bt={A4:{width:210,height:297},A3:{width:297,height:420},A5:{width:148,height:210},Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6}},ir={paperSize:"A4",customWidth:210,customHeight:297,orientation:"portrait",marginTop:10,marginRight:10,marginBottom:10,marginLeft:10,showHeader:!1,headerContent:"页眉文字",showFooter:!1,footerContent:"页脚文字",showPageNumber:!0,pageNumberFormat:"第 {page} 页"},Ee=3,xt={cellSize:1,cols:100},sr={text:"文本",image:"图片",table:"表格",barcode:"条形码",line:"分割线"},hn={text:{content:"双击编辑文字",fontSize:14,fontWeight:"normal",fontStyle:"normal",textAlign:"left",color:"#000000",backgroundColor:"transparent"},image:{src:"",fit:"contain",content:""},table:{rows:3,cols:3,borderWidth:1,borderColor:"#000000",content:""},barcode:{value:"1234567890",format:"CODE128",content:""},line:{color:"#000000",thickness:1,style:"solid",content:""}};let It=0,At=0;function ar(){return`comp_${++It}`}function lr(){return`ds_${++At}`}const fe=ln.create((r,n)=>({components:[],selectedId:null,pageSettings:{...ir},gridSettings:{...xt},previewVisible:!1,templateName:"未命名模板",headerFooterVisible:!1,dataSources:[],activeDataSourceId:null,addComponent:(a,o,h)=>{const u=ar(),x=sr[a]||a,O={...hn[a]||{}};a==="text"&&(O.content=x);const y={id:u,type:a,x:o??0,y:h??0,w:a==="line"?20:15,h:a==="line"?1:8,props:O,...a==="table"?{tableColumns:[{title:"列1"},{title:"列2"},{title:"列3"}]}:{}};r(R=>({components:[...R.components,y],selectedId:u}))},updateComponent:(a,o)=>{r(h=>({components:h.components.map(u=>u.id===a?{...u,...o}:u)}))},selectComponent:a=>{r({selectedId:a})},removeComponent:a=>{r(o=>({components:o.components.filter(h=>h.id!==a),selectedId:o.selectedId===a?null:o.selectedId}))},setComponents:a=>{r({components:a})},setPageSettings:a=>{r(o=>({pageSettings:{...o.pageSettings,...a}}))},setPreviewVisible:a=>{r({previewVisible:a})},setTemplateName:a=>{r({templateName:a})},setHeaderFooterVisible:a=>{r({headerFooterVisible:a})},addDataSource:(a,o,h)=>{const x={id:lr(),name:a,type:o,data:h,createdAt:Date.now()};r(O=>({dataSources:[...O.dataSources,x]}))},updateDataSource:(a,o)=>{r(h=>({dataSources:h.dataSources.map(u=>u.id===a?{...u,...o}:u)}))},removeDataSource:a=>{r(o=>({dataSources:o.dataSources.filter(h=>h.id!==a),activeDataSourceId:o.activeDataSourceId===a?null:o.activeDataSourceId}))},setActiveDataSourceId:a=>{r({activeDataSourceId:a})},updateComponentTableColumns:(a,o)=>{r(h=>({components:h.components.map(u=>u.id===a?{...u,tableColumns:o}:u)}))},exportJSON:()=>{const a=n(),o={version:"1.0",templateName:a.templateName,pageSettings:a.pageSettings,components:a.components.map(({id:h,...u})=>u),dataSources:a.dataSources.map(({id:h,...u})=>u)};return JSON.stringify(o,null,2)},importJSON:a=>{try{const o=JSON.parse(a);if(!o.version||!o.pageSettings||!Array.isArray(o.components))return"JSON 格式不正确,缺少必要字段";It=0,At=0;const h=o.components.map(x=>({...x,id:ar()})),u=(o.dataSources||[]).map(x=>({...x,id:lr()}));return r({components:h,dataSources:u,pageSettings:o.pageSettings,templateName:o.templateName||"导入的模板",selectedId:null,activeDataSourceId:null}),null}catch{return"JSON 解析失败,请检查文件内容"}},reset:()=>{It=0,At=0,r({components:[],selectedId:null,pageSettings:{...ir},gridSettings:{...xt},templateName:"未命名模板",headerFooterVisible:!1,previewVisible:!1,dataSources:[],activeDataSourceId:null})}})),{Text:jo}=k.Typography,gn=({onCustomSave:r,onCustomPrint:n})=>{const a=fe(t=>t.templateName),o=fe(t=>t.setTemplateName),h=fe(t=>t.setPreviewVisible),u=fe(t=>t.setHeaderFooterVisible),x=fe(t=>t.selectedId),O=fe(t=>t.removeComponent),y=fe(t=>t.exportJSON),R=fe(t=>t.importJSON),C=fe(t=>t.reset),E=oe.useRef(null),{message:_}=k.App.useApp(),A=oe.useCallback(()=>{x&&O(x)},[x,O]),T=oe.useCallback(()=>{const t=y(),c=new Blob([t],{type:"application/json"}),f=URL.createObjectURL(c),i=document.createElement("a");i.href=f,i.download=`${a||"模板"}.json`,i.click(),URL.revokeObjectURL(f),_.success("模板已导出")},[y,a,_]),p=oe.useCallback(()=>{var t;(t=E.current)==null||t.click()},[]),l=oe.useCallback(t=>{var i;const c=(i=t.target.files)==null?void 0:i[0];if(!c)return;const f=new FileReader;f.onload=()=>{const b=R(f.result);b?_.error(b):_.success("模板已导入")},f.readAsText(c),t.target.value=""},[R,_]),e=oe.useCallback(()=>{C(),_.info("已新建空白模板")},[C,_]);return s.jsxs("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:[s.jsx(k.Space,{children:s.jsx(k.Input,{value:a,onChange:t=>o(t.target.value),variant:"borderless",style:{width:200,fontSize:16,fontWeight:600},placeholder:"模板名称"})}),s.jsxs(k.Space,{children:[s.jsx(k.Button,{icon:s.jsx(Te.PlusOutlined,{}),onClick:e,children:"新建"}),s.jsx("input",{ref:E,type:"file",accept:".json",style:{display:"none"},onChange:l}),r?s.jsx(k.Button,{icon:s.jsx(Te.SaveOutlined,{}),onClick:r,type:"primary",children:"保存"}):s.jsx(k.Button,{icon:s.jsx(Te.DownloadOutlined,{}),onClick:T,children:"导出"}),s.jsx(k.Button,{icon:s.jsx(Te.UploadOutlined,{}),onClick:p,children:"导入"}),s.jsx(k.Button,{icon:s.jsx(Te.SettingOutlined,{}),onClick:()=>u(!0),children:"页眉页脚"}),s.jsx(k.Button,{danger:!0,icon:s.jsx(Te.DeleteOutlined,{}),disabled:!x,onClick:A,children:"删除"}),n?s.jsx(k.Button,{type:"primary",icon:s.jsx(Te.PrinterOutlined,{}),onClick:n,children:"打印"}):s.jsx(k.Button,{type:"primary",icon:s.jsx(Te.EyeOutlined,{}),onClick:()=>h(!0),children:"预览"})]})]})},{Text:qe}=k.Typography,mn=()=>{const r=fe(u=>u.pageSettings),n=fe(u=>u.setPageSettings),a=r.paperSize==="custom",o=oe.useCallback(u=>{n({paperSize:u})},[n]),h=oe.useCallback(u=>{n({orientation:u})},[n]);return s.jsx(k.Card,{title:"页面设置",size:"small",children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:12},children:"纸张大小"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:r.paperSize,onChange:o,options:[...Object.keys(bt).map(u=>({value:u,label:u})),{value:"custom",label:"自定义"}]})]}),a&&s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsxs("div",{style:{flex:1},children:[s.jsx(qe,{style:{fontSize:12},children:"宽度 (mm)"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:r.customWidth,min:10,max:2e3,onChange:u=>n({customWidth:u??210})})]}),s.jsxs("div",{style:{flex:1},children:[s.jsx(qe,{style:{fontSize:12},children:"高度 (mm)"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:r.customHeight,min:10,max:2e3,onChange:u=>n({customHeight:u??297})})]})]}),s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:12},children:"方向"}),s.jsxs(k.Radio.Group,{value:r.orientation,onChange:u=>h(u.target.value),size:"small",style:{width:"100%",display:"flex"},children:[s.jsx(k.Radio.Button,{value:"portrait",style:{flex:1,textAlign:"center"},children:"纵向"}),s.jsx(k.Radio.Button,{value:"landscape",style:{flex:1,textAlign:"center"},children:"横向"})]})]}),s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:12},children:"页边距 (mm)"}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:11},children:"上"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:r.marginTop,min:0,max:100,onChange:u=>n({marginTop:u??10})})]}),s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:11},children:"右"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:r.marginRight,min:0,max:100,onChange:u=>n({marginRight:u??10})})]}),s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:11},children:"下"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:r.marginBottom,min:0,max:100,onChange:u=>n({marginBottom:u??10})})]}),s.jsxs("div",{children:[s.jsx(qe,{style:{fontSize:11},children:"左"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:r.marginLeft,min:0,max:100,onChange:u=>n({marginLeft:u??10})})]})]})]})]})})},{Text:yn}=k.Typography,vn=[{type:"text",icon:s.jsx(Te.FontSizeOutlined,{}),label:"文本"},{type:"image",icon:s.jsx(Te.PictureOutlined,{}),label:"图片"},{type:"table",icon:s.jsx(Te.TableOutlined,{}),label:"表格"},{type:"barcode",icon:s.jsx(Te.BarcodeOutlined,{}),label:"条形码"},{type:"line",icon:s.jsx(Te.MinusOutlined,{}),label:"分割线"}],bn=()=>{const r=fe(o=>o.addComponent),n=oe.useCallback((o,h)=>{o.dataTransfer.setData("componentType",h),o.dataTransfer.effectAllowed="copy"},[]),a=oe.useCallback(o=>{r(o)},[r]);return s.jsx(k.Card,{title:"组件面板",size:"small",children:s.jsx(k.Space,{direction:"vertical",style:{width:"100%"},size:4,children:vn.map(o=>s.jsxs("div",{draggable:!0,onDragStart:h=>n(h,o.type),onClick:()=>a(o.type),style:{cursor:"grab",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:6,display:"flex",alignItems:"center",gap:8,background:"#fafafa",userSelect:"none",transition:"all 0.2s"},onMouseEnter:h=>{h.currentTarget.style.background="#e6f4ff",h.currentTarget.style.borderColor="#1677ff"},onMouseLeave:h=>{h.currentTarget.style.background="#fafafa",h.currentTarget.style.borderColor="#d9d9d9"},children:[o.icon,s.jsx(yn,{children:o.label})]},o.type))})})};function st(r){try{return JSON.parse(r)}catch{return null}}function at(r,n,a){const o=`${n}Binding`,h=r.props[o];if(h&&h.dataSourceId&&h.fieldPath){const x=a.find(O=>O.id===h.dataSourceId);if(x){const O=St(x);if(O){const y=wt(O,h.fieldPath);if(y)return y}}}return r.props[n]||(h==null?void 0:h.staticValue)||""}function wt(r,n){if(!r||!n)return"";try{const a=n.split(".");let o=r;for(const h of a){if(typeof o!="object"||o===null)return"";o=o[h]}return o!=null?String(o):""}catch{return""}}function St(r){const n=st(r.data);return r.type==="object"&&n&&typeof n=="object"&&!Array.isArray(n)?n:null}function jt(r){const n=st(r.data);return r.type==="array"&&Array.isArray(n)?n:null}const{TextArea:xn}=k.Input,{Text:Rt,Title:Ro}=k.Typography,cr=JSON.stringify({name:"张三",age:28,department:"技术部",email:"zhangsan@example.com"},null,2),wn=JSON.stringify([{id:1,product:"商品A",quantity:2,price:100},{id:2,product:"商品B",quantity:5,price:80},{id:3,product:"商品C",quantity:1,price:200}],null,2),Sn=()=>{const r=fe(_=>_.dataSources),n=fe(_=>_.addDataSource),a=fe(_=>_.updateDataSource),o=fe(_=>_.removeDataSource),[h,u]=oe.useState(!1),[x,O]=oe.useState(null),[y,R]=oe.useState({name:"",type:"object",data:""}),C=_=>{_?(O(_.id),R({name:_.name,type:_.type,data:_.data})):(O(null),R({name:"新数据源",type:"object",data:cr})),u(!0)},E=()=>{const _=st(y.data);if(_===null){k.message.error("JSON 格式不正确");return}if(y.type==="object"&&(Array.isArray(_)||typeof _!="object")){k.message.error("对象类型数据源必须为对象格式");return}if(y.type==="array"&&!Array.isArray(_)){k.message.error("数组类型数据源必须为数组格式");return}x?(a(x,y),k.message.success("数据源已更新")):(n(y.name,y.type,y.data),k.message.success("数据源已添加")),u(!1)};return s.jsxs(k.Card,{title:"数据源",size:"small",extra:s.jsx(k.Button,{type:"link",size:"small",icon:s.jsx(Te.PlusOutlined,{}),onClick:()=>C(),children:"添加"}),children:[s.jsx(k.List,{size:"small",dataSource:r,locale:{emptyText:"暂无数据源"},renderItem:_=>s.jsx(k.List.Item,{actions:[s.jsx(k.Dropdown,{menu:{items:[{key:"edit",label:"编辑",icon:s.jsx(Te.EditOutlined,{}),onClick:()=>C(_)},{type:"divider"},{key:"delete",label:s.jsx(k.Popconfirm,{title:"确定要删除这个数据源吗?",onConfirm:A=>{A==null||A.stopPropagation(),o(_.id),k.message.success("已删除")},okText:"确定",cancelText:"取消",onCancel:A=>A==null?void 0:A.stopPropagation(),children:s.jsx("span",{style:{color:"#ff4d4f",cursor:"pointer"},children:"删除"})}),icon:s.jsx(Te.DeleteOutlined,{style:{color:"#ff4d4f"}})}]},placement:"bottomRight",children:s.jsx(k.Button,{type:"text",size:"small",icon:s.jsx(Te.MoreOutlined,{})})})],children:s.jsx(k.List.Item.Meta,{avatar:s.jsx(Te.DatabaseOutlined,{}),title:s.jsx(Rt,{strong:!0,children:_.name}),description:s.jsx(k.Space,{size:4,children:s.jsx(k.Tag,{color:_.type==="object"?"blue":"green",children:_.type==="object"?"对象":"数组"})})})})}),s.jsx(k.Modal,{title:x?"编辑数据源":"添加数据源",open:h,onOk:E,onCancel:()=>u(!1),okText:"保存",cancelText:"取消",children:s.jsxs(k.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[s.jsxs("div",{children:[s.jsx(Rt,{strong:!0,style:{display:"block",marginBottom:4},children:"名称"}),s.jsx(k.Input,{placeholder:"请输入数据源名称",value:y.name,onChange:_=>R({...y,name:_.target.value})})]}),s.jsxs("div",{children:[s.jsx(Rt,{strong:!0,style:{display:"block",marginBottom:4},children:"类型"}),s.jsx(k.Select,{options:[{label:"对象",value:"object"},{label:"数组",value:"array"}],style:{width:"100%"},value:y.type,onChange:_=>{R({...y,type:_,data:_==="object"?cr:wn})}})]}),s.jsx(k.Divider,{style:{margin:"8px 0"}}),s.jsxs("div",{children:[s.jsx(Rt,{strong:!0,style:{display:"block",marginBottom:4},children:"JSON 数据"}),s.jsx(xn,{rows:12,placeholder:"请输入 JSON 数据",value:y.data,onChange:_=>R({...y,data:_.target.value})})]})]})})]})},jn=()=>s.jsx(k.Collapse,{bordered:!1,defaultActiveKey:["1","2"],expandIcon:({isActive:r})=>s.jsx(Te.CaretRightOutlined,{rotate:r?90:0}),style:{height:"100%",overflowY:"auto"},items:[{key:"1",label:"页面设置",children:s.jsx(mn,{})},{key:"2",label:"组件",children:s.jsx(bn,{})},{key:"3",label:"数据源",children:s.jsx(Sn,{})}]});var Lt={exports:{}},lt={},ct={exports:{}},Rn=ct.exports,ur;function Nt(){return ur||(ur=1,(function(r,n){(function(a,o){o(n)})(Rn,(function(a){function o(I){return function(ee,$,ae,W,he,ze,xe){return I(ee,$,xe)}}function h(I){return function(ee,$,ae,W){if(!ee||!$||typeof ee!="object"||typeof $!="object")return I(ee,$,ae,W);var he=W.get(ee),ze=W.get($);if(he&&ze)return he===$&&ze===ee;W.set(ee,$),W.set($,ee);var xe=I(ee,$,ae,W);return W.delete(ee),W.delete($),xe}}function u(I,G){var ee={};for(var $ in I)ee[$]=I[$];for(var $ in G)ee[$]=G[$];return ee}function x(I){return I.constructor===Object||I.constructor==null}function O(I){return typeof I.then=="function"}function y(I,G){return I===G||I!==I&&G!==G}var R="[object Arguments]",C="[object Boolean]",E="[object Date]",_="[object RegExp]",A="[object Map]",T="[object Number]",p="[object Object]",l="[object Set]",e="[object String]",t=Object.prototype.toString;function c(I){var G=I.areArraysEqual,ee=I.areDatesEqual,$=I.areMapsEqual,ae=I.areObjectsEqual,W=I.areRegExpsEqual,he=I.areSetsEqual,ze=I.createIsNestedEqual,xe=ze(Ae);function Ae(m,v,S){if(m===v)return!0;if(!m||!v||typeof m!="object"||typeof v!="object")return m!==m&&v!==v;if(x(m)&&x(v))return ae(m,v,xe,S);var H=Array.isArray(m),re=Array.isArray(v);if(H||re)return H===re&&G(m,v,xe,S);var U=t.call(m);return U!==t.call(v)?!1:U===E?ee(m,v,xe,S):U===_?W(m,v,xe,S):U===A?$(m,v,xe,S):U===l?he(m,v,xe,S):U===p||U===R?O(m)||O(v)?!1:ae(m,v,xe,S):U===C||U===T||U===e?y(m.valueOf(),v.valueOf()):!1}return Ae}function f(I,G,ee,$){var ae=I.length;if(G.length!==ae)return!1;for(;ae-- >0;)if(!ee(I[ae],G[ae],ae,ae,I,G,$))return!1;return!0}var i=h(f);function b(I,G){return y(I.valueOf(),G.valueOf())}function j(I,G,ee,$){var ae=I.size===G.size;if(!ae)return!1;if(!I.size)return!0;var W={},he=0;return I.forEach(function(ze,xe){if(ae){var Ae=!1,m=0;G.forEach(function(v,S){!Ae&&!W[m]&&(Ae=ee(xe,S,he,m,I,G,$)&&ee(ze,v,xe,S,I,G,$))&&(W[m]=!0),m++}),he++,ae=Ae}}),ae}var P=h(j),z="_owner",N=Object.prototype.hasOwnProperty;function F(I,G,ee,$){var ae=Object.keys(I),W=ae.length;if(Object.keys(G).length!==W)return!1;for(var he;W-- >0;){if(he=ae[W],he===z){var ze=!!I.$$typeof,xe=!!G.$$typeof;if((ze||xe)&&ze!==xe)return!1}if(!N.call(G,he)||!ee(I[he],G[he],he,he,I,G,$))return!1}return!0}var Z=h(F);function K(I,G){return I.source===G.source&&I.flags===G.flags}function Q(I,G,ee,$){var ae=I.size===G.size;if(!ae)return!1;if(!I.size)return!0;var W={};return I.forEach(function(he,ze){if(ae){var xe=!1,Ae=0;G.forEach(function(m,v){!xe&&!W[Ae]&&(xe=ee(he,m,ze,v,I,G,$))&&(W[Ae]=!0),Ae++}),ae=xe}}),ae}var V=h(Q),X=Object.freeze({areArraysEqual:f,areDatesEqual:b,areMapsEqual:j,areObjectsEqual:F,areRegExpsEqual:K,areSetsEqual:Q,createIsNestedEqual:o}),J=Object.freeze({areArraysEqual:i,areDatesEqual:b,areMapsEqual:P,areObjectsEqual:Z,areRegExpsEqual:K,areSetsEqual:V,createIsNestedEqual:o}),ne=c(X);function Se(I,G){return ne(I,G,void 0)}var ve=c(u(X,{createIsNestedEqual:function(){return y}}));function M(I,G){return ve(I,G,void 0)}var L=c(J);function le(I,G){return L(I,G,new WeakMap)}var ie=c(u(J,{createIsNestedEqual:function(){return y}}));function ce(I,G){return ie(I,G,new WeakMap)}function pe(I){return c(u(X,I(X)))}function ue(I){var G=c(u(J,I(J)));return(function(ee,$,ae){return ae===void 0&&(ae=new WeakMap),G(ee,$,ae)})}a.circularDeepEqual=le,a.circularShallowEqual=ce,a.createCustomCircularEqual=ue,a.createCustomEqual=pe,a.deepEqual=Se,a.sameValueZeroEqual=y,a.shallowEqual=M,Object.defineProperty(a,"__esModule",{value:!0})}))})(ct,ct.exports)),ct.exports}var Ot={exports:{}},dr;function Ct(){if(dr)return Ot.exports;dr=1;function r(a){var o,h,u="";if(typeof a=="string"||typeof a=="number")u+=a;else if(typeof a=="object")if(Array.isArray(a)){var x=a.length;for(o=0;o<x;o++)a[o]&&(h=r(a[o]))&&(u&&(u+=" "),u+=h)}else for(h in a)a[h]&&(u&&(u+=" "),u+=h);return u}function n(){for(var a,o,h=0,u="",x=arguments.length;h<x;h++)(a=arguments[h])&&(o=r(a))&&(u&&(u+=" "),u+=o);return u}return Ot.exports=n,Ot.exports.clsx=n,Ot.exports}var be={},Wt,fr;function On(){return fr||(fr=1,Wt=function(n,a,o){return n===a?!0:n.className===a.className&&o(n.style,a.style)&&n.width===a.width&&n.autoSize===a.autoSize&&n.cols===a.cols&&n.draggableCancel===a.draggableCancel&&n.draggableHandle===a.draggableHandle&&o(n.verticalCompact,a.verticalCompact)&&o(n.compactType,a.compactType)&&o(n.layout,a.layout)&&o(n.margin,a.margin)&&o(n.containerPadding,a.containerPadding)&&n.rowHeight===a.rowHeight&&n.maxRows===a.maxRows&&n.isBounded===a.isBounded&&n.isDraggable===a.isDraggable&&n.isResizable===a.isResizable&&n.allowOverlap===a.allowOverlap&&n.preventCollision===a.preventCollision&&n.useCSSTransforms===a.useCSSTransforms&&n.transformScale===a.transformScale&&n.isDroppable===a.isDroppable&&o(n.resizeHandles,a.resizeHandles)&&o(n.resizeHandle,a.resizeHandle)&&n.onLayoutChange===a.onLayoutChange&&n.onDragStart===a.onDragStart&&n.onDrag===a.onDrag&&n.onDragStop===a.onDragStop&&n.onResizeStart===a.onResizeStart&&n.onResize===a.onResize&&n.onResizeStop===a.onResizeStop&&n.onDrop===a.onDrop&&o(n.droppingItem,a.droppingItem)&&o(n.innerRef,a.innerRef)}),Wt}var pr;function Ke(){if(pr)return be;pr=1;var r={};Object.defineProperty(be,"__esModule",{value:!0}),be.bottom=C,be.childrenEqual=p,be.cloneLayout=E,be.cloneLayoutItem=T,be.collides=e,be.compact=t,be.compactItem=i,be.compactType=ze,be.correctBounds=b,be.fastPositionEqual=l,be.fastRGLPropsEqual=void 0,be.getAllCollisions=z,be.getFirstCollision=P,be.getLayoutItem=j,be.getStatics=N,be.modifyLayout=_,be.moveElement=F,be.moveElementAwayFromCollision=Z,be.noop=void 0,be.perc=K,be.resizeItemInDirection=ue,be.setTopLeft=G,be.setTransform=I,be.sortLayoutItems=ee,be.sortLayoutItemsByColRow=ae,be.sortLayoutItemsByRowCol=$,be.synchronizeLayoutWithChildren=W,be.validateLayout=he,be.withLayoutItem=A;var n=Nt(),a=o(oe);function o(m){return m&&m.__esModule?m:{default:m}}function h(m,v){var S=Object.keys(m);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(m);v&&(H=H.filter(function(re){return Object.getOwnPropertyDescriptor(m,re).enumerable})),S.push.apply(S,H)}return S}function u(m){for(var v=1;v<arguments.length;v++){var S=arguments[v]!=null?arguments[v]:{};v%2?h(Object(S),!0).forEach(function(H){x(m,H,S[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(S)):h(Object(S)).forEach(function(H){Object.defineProperty(m,H,Object.getOwnPropertyDescriptor(S,H))})}return m}function x(m,v,S){return(v=O(v))in m?Object.defineProperty(m,v,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[v]=S,m}function O(m){var v=y(m,"string");return typeof v=="symbol"?v:v+""}function y(m,v){if(typeof m!="object"||!m)return m;var S=m[Symbol.toPrimitive];if(S!==void 0){var H=S.call(m,v);if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(m)}const R=r.NODE_ENV==="production";function C(m){let v=0,S;for(let H=0,re=m.length;H<re;H++)S=m[H].y+m[H].h,S>v&&(v=S);return v}function E(m){const v=Array(m.length);for(let S=0,H=m.length;S<H;S++)v[S]=T(m[S]);return v}function _(m,v){const S=Array(m.length);for(let H=0,re=m.length;H<re;H++)v.i===m[H].i?S[H]=v:S[H]=m[H];return S}function A(m,v,S){let H=j(m,v);return H?(H=S(T(H)),m=_(m,H),[m,H]):[m,null]}function T(m){return{w:m.w,h:m.h,x:m.x,y:m.y,i:m.i,minW:m.minW,maxW:m.maxW,minH:m.minH,maxH:m.maxH,moved:!!m.moved,static:!!m.static,isDraggable:m.isDraggable,isResizable:m.isResizable,resizeHandles:m.resizeHandles,isBounded:m.isBounded}}function p(m,v){return(0,n.deepEqual)(a.default.Children.map(m,S=>S==null?void 0:S.key),a.default.Children.map(v,S=>S==null?void 0:S.key))&&(0,n.deepEqual)(a.default.Children.map(m,S=>S==null?void 0:S.props["data-grid"]),a.default.Children.map(v,S=>S==null?void 0:S.props["data-grid"]))}be.fastRGLPropsEqual=On();function l(m,v){return m.left===v.left&&m.top===v.top&&m.width===v.width&&m.height===v.height}function e(m,v){return!(m.i===v.i||m.x+m.w<=v.x||m.x>=v.x+v.w||m.y+m.h<=v.y||m.y>=v.y+v.h)}function t(m,v,S,H){const re=N(m);let U=C(re);const se=ee(m,v),ge=Array(m.length);for(let je=0,d=se.length;je<d;je++){let w=T(se[je]);w.static||(w=i(re,w,v,S,se,H,U),U=Math.max(U,w.y+w.h),re.push(w)),ge[m.indexOf(se[je])]=w,w.moved=!1}return ge}const c={x:"w",y:"h"};function f(m,v,S,H){const re=c[H];v[H]+=1;const U=m.map(se=>se.i).indexOf(v.i);for(let se=U+1;se<m.length;se++){const ge=m[se];if(!ge.static){if(ge.y>v.y+v.h)break;e(v,ge)&&f(m,ge,S+v[re],H)}}v[H]=S}function i(m,v,S,H,re,U,se){const ge=S==="vertical",je=S==="horizontal";if(ge)for(typeof se=="number"?v.y=Math.min(se,v.y):v.y=Math.min(C(m),v.y);v.y>0&&!P(m,v);)v.y--;else if(je)for(;v.x>0&&!P(m,v);)v.x--;let d;for(;(d=P(m,v))&&!(S===null&&U);)if(je?f(re,v,d.x+d.w,"x"):f(re,v,d.y+d.h,"y"),je&&v.x+v.w>H)for(v.x=H-v.w,v.y++;v.x>0&&!P(m,v);)v.x--;return v.y=Math.max(v.y,0),v.x=Math.max(v.x,0),v}function b(m,v){const S=N(m);for(let H=0,re=m.length;H<re;H++){const U=m[H];if(U.x+U.w>v.cols&&(U.x=v.cols-U.w),U.x<0&&(U.x=0,U.w=v.cols),!U.static)S.push(U);else for(;P(S,U);)U.y++}return m}function j(m,v){for(let S=0,H=m.length;S<H;S++)if(m[S].i===v)return m[S]}function P(m,v){for(let S=0,H=m.length;S<H;S++)if(e(m[S],v))return m[S]}function z(m,v){return m.filter(S=>e(S,v))}function N(m){return m.filter(v=>v.static)}function F(m,v,S,H,re,U,se,ge,je){if(v.static&&v.isDraggable!==!0||v.y===H&&v.x===S)return m;"Moving element ".concat(v.i," to [").concat(String(S),",").concat(String(H),"] from [").concat(v.x,",").concat(v.y,"]");const d=v.x,w=v.y;typeof S=="number"&&(v.x=S),typeof H=="number"&&(v.y=H),v.moved=!0;let D=ee(m,se);(se==="vertical"&&typeof H=="number"?w>=H:se==="horizontal"&&typeof S=="number"?d>=S:!1)&&(D=D.reverse());const Y=z(D,v),Ce=Y.length>0;if(Ce&&je)return E(m);if(Ce&&U)return"Collision prevented on ".concat(v.i,", reverting."),v.x=d,v.y=w,v.moved=!1,m;for(let me=0,Pe=Y.length;me<Pe;me++){const ke=Y[me];"Resolving collision between ".concat(v.i," at [").concat(v.x,",").concat(v.y,"] and ").concat(ke.i," at [").concat(ke.x,",").concat(ke.y,"]"),!ke.moved&&(ke.static?m=Z(m,ke,v,re,se):m=Z(m,v,ke,re,se))}return m}function Z(m,v,S,H,re,U){const se=re==="horizontal",ge=re==="vertical",je=v.static;if(H){H=!1;const D={x:se?Math.max(v.x-S.w,0):S.x,y:ge?Math.max(v.y-S.h,0):S.y,w:S.w,h:S.h,i:"-1"},q=P(m,D),Y=q&&q.y+q.h>v.y,Ce=q&&v.x+v.w>q.x;if(q){if(Y&&ge)return F(m,S,void 0,S.y+1,H,je,re);if(Y&&re==null)return v.y=S.y,S.y=S.y+S.h,m;if(Ce&&se)return F(m,v,S.x,void 0,H,je,re)}else return"Doing reverse collision on ".concat(S.i," up to [").concat(D.x,",").concat(D.y,"]."),F(m,S,se?D.x:void 0,ge?D.y:void 0,H,je,re)}const d=se?S.x+1:void 0,w=ge?S.y+1:void 0;return d==null&&w==null?m:F(m,S,se?S.x+1:void 0,ge?S.y+1:void 0,H,je,re)}function K(m){return m*100+"%"}const Q=(m,v,S,H)=>m+S>H?v:S,V=(m,v,S)=>m<0?v:S,X=m=>Math.max(0,m),J=m=>Math.max(0,m),ne=(m,v,S)=>{let{left:H,height:re,width:U}=v;const se=m.top-(re-m.height);return{left:H,width:U,height:V(se,m.height,re),top:J(se)}},Se=(m,v,S)=>{let{top:H,left:re,height:U,width:se}=v;return{top:H,height:U,width:Q(m.left,m.width,se,S),left:X(re)}},ve=(m,v,S)=>{let{top:H,height:re,width:U}=v;const se=m.left-(U-m.width);return{height:re,width:se<0?m.width:Q(m.left,m.width,U,S),top:J(H),left:X(se)}},M=(m,v,S)=>{let{top:H,left:re,height:U,width:se}=v;return{width:se,left:re,height:V(H,m.height,U),top:J(H)}},pe={n:ne,ne:function(){return ne(arguments.length<=0?void 0:arguments[0],Se(...arguments))},e:Se,se:function(){return M(arguments.length<=0?void 0:arguments[0],Se(...arguments))},s:M,sw:function(){return M(arguments.length<=0?void 0:arguments[0],ve(...arguments))},w:ve,nw:function(){return ne(arguments.length<=0?void 0:arguments[0],ve(...arguments))}};function ue(m,v,S,H){const re=pe[m];return re?re(v,u(u({},v),S),H):S}function I(m){let{top:v,left:S,width:H,height:re}=m;const U="translate(".concat(S,"px,").concat(v,"px)");return{transform:U,WebkitTransform:U,MozTransform:U,msTransform:U,OTransform:U,width:"".concat(H,"px"),height:"".concat(re,"px"),position:"absolute"}}function G(m){let{top:v,left:S,width:H,height:re}=m;return{top:"".concat(v,"px"),left:"".concat(S,"px"),width:"".concat(H,"px"),height:"".concat(re,"px"),position:"absolute"}}function ee(m,v){return v==="horizontal"?ae(m):v==="vertical"?$(m):m}function $(m){return m.slice(0).sort(function(v,S){return v.y>S.y||v.y===S.y&&v.x>S.x?1:v.y===S.y&&v.x===S.x?0:-1})}function ae(m){return m.slice(0).sort(function(v,S){return v.x>S.x||v.x===S.x&&v.y>S.y?1:-1})}function W(m,v,S,H,re){m=m||[];const U=[];a.default.Children.forEach(v,ge=>{if((ge==null?void 0:ge.key)==null)return;const je=j(m,String(ge.key)),d=ge.props["data-grid"];je&&d==null?U.push(T(je)):d?(R||he([d],"ReactGridLayout.children"),U.push(T(u(u({},d),{},{i:ge.key})))):U.push(T({w:1,h:1,x:0,y:C(U),i:String(ge.key)}))});const se=b(U,{cols:S});return re?se:t(se,H,S)}function he(m){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const S=["x","y","w","h"];if(!Array.isArray(m))throw new Error(v+" must be an array!");for(let H=0,re=m.length;H<re;H++){const U=m[H];for(let se=0;se<S.length;se++){const ge=S[se],je=U[ge];if(typeof je!="number"||Number.isNaN(je))throw new Error("ReactGridLayout: ".concat(v,"[").concat(H,"].").concat(ge," must be a number! Received: ").concat(je," (").concat(typeof je,")"))}if(typeof U.i<"u"&&typeof U.i!="string")throw new Error("ReactGridLayout: ".concat(v,"[").concat(H,"].i must be a string! Received: ").concat(U.i," (").concat(typeof U.i,")"))}}function ze(m){const{verticalCompact:v,compactType:S}=m||{};return v===!1?null:S}function xe(){}const Ae=()=>{};return be.noop=Ae,be}var Fe={},hr;function Ht(){if(hr)return Fe;hr=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.calcGridColWidth=r,Fe.calcGridItemPosition=a,Fe.calcGridItemWHPx=n,Fe.calcWH=h,Fe.calcXY=o,Fe.clamp=u;function r(x){const{margin:O,containerPadding:y,containerWidth:R,cols:C}=x;return(R-O[0]*(C-1)-y[0]*2)/C}function n(x,O,y){return Number.isFinite(x)?Math.round(O*x+Math.max(0,x-1)*y):x}function a(x,O,y,R,C,E){const{margin:_,containerPadding:A,rowHeight:T}=x,p=r(x),l={};return E&&E.resizing?(l.width=Math.round(E.resizing.width),l.height=Math.round(E.resizing.height)):(l.width=n(R,p,_[0]),l.height=n(C,T,_[1])),E&&E.dragging?(l.top=Math.round(E.dragging.top),l.left=Math.round(E.dragging.left)):E&&E.resizing&&typeof E.resizing.top=="number"&&typeof E.resizing.left=="number"?(l.top=Math.round(E.resizing.top),l.left=Math.round(E.resizing.left)):(l.top=Math.round((T+_[1])*y+A[1]),l.left=Math.round((p+_[0])*O+A[0])),l}function o(x,O,y,R,C){const{margin:E,containerPadding:_,cols:A,rowHeight:T,maxRows:p}=x,l=r(x);let e=Math.round((y-_[0])/(l+E[0])),t=Math.round((O-_[1])/(T+E[1]));return e=u(e,0,A-R),t=u(t,0,p-C),{x:e,y:t}}function h(x,O,y,R,C,E){const{margin:_,maxRows:A,cols:T,rowHeight:p}=x,l=r(x);let e=Math.round((O+_[0])/(l+_[0])),t=Math.round((y+_[1])/(p+_[1])),c=u(e,0,T-R),f=u(t,0,A-C);return["sw","w","nw"].indexOf(E)!==-1&&(c=u(e,0,T)),["nw","n","ne"].indexOf(E)!==-1&&(f=u(t,0,A)),{w:c,h:f}}function u(x,O,y){return Math.max(Math.min(x,y),O)}return Fe}var ut={},_t={exports:{}},Et={exports:{}},Re={};/** @license React v16.13.1
31
+ * react-is.production.min.js
32
+ *
33
+ * Copyright (c) Facebook, Inc. and its affiliates.
34
+ *
35
+ * This source code is licensed under the MIT license found in the
36
+ * LICENSE file in the root directory of this source tree.
37
+ */var gr;function Cn(){if(gr)return Re;gr=1;var r=typeof Symbol=="function"&&Symbol.for,n=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,h=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,x=r?Symbol.for("react.provider"):60109,O=r?Symbol.for("react.context"):60110,y=r?Symbol.for("react.async_mode"):60111,R=r?Symbol.for("react.concurrent_mode"):60111,C=r?Symbol.for("react.forward_ref"):60112,E=r?Symbol.for("react.suspense"):60113,_=r?Symbol.for("react.suspense_list"):60120,A=r?Symbol.for("react.memo"):60115,T=r?Symbol.for("react.lazy"):60116,p=r?Symbol.for("react.block"):60121,l=r?Symbol.for("react.fundamental"):60117,e=r?Symbol.for("react.responder"):60118,t=r?Symbol.for("react.scope"):60119;function c(i){if(typeof i=="object"&&i!==null){var b=i.$$typeof;switch(b){case n:switch(i=i.type,i){case y:case R:case o:case u:case h:case E:return i;default:switch(i=i&&i.$$typeof,i){case O:case C:case T:case A:case x:return i;default:return b}}case a:return b}}}function f(i){return c(i)===R}return Re.AsyncMode=y,Re.ConcurrentMode=R,Re.ContextConsumer=O,Re.ContextProvider=x,Re.Element=n,Re.ForwardRef=C,Re.Fragment=o,Re.Lazy=T,Re.Memo=A,Re.Portal=a,Re.Profiler=u,Re.StrictMode=h,Re.Suspense=E,Re.isAsyncMode=function(i){return f(i)||c(i)===y},Re.isConcurrentMode=f,Re.isContextConsumer=function(i){return c(i)===O},Re.isContextProvider=function(i){return c(i)===x},Re.isElement=function(i){return typeof i=="object"&&i!==null&&i.$$typeof===n},Re.isForwardRef=function(i){return c(i)===C},Re.isFragment=function(i){return c(i)===o},Re.isLazy=function(i){return c(i)===T},Re.isMemo=function(i){return c(i)===A},Re.isPortal=function(i){return c(i)===a},Re.isProfiler=function(i){return c(i)===u},Re.isStrictMode=function(i){return c(i)===h},Re.isSuspense=function(i){return c(i)===E},Re.isValidElementType=function(i){return typeof i=="string"||typeof i=="function"||i===o||i===R||i===u||i===h||i===E||i===_||typeof i=="object"&&i!==null&&(i.$$typeof===T||i.$$typeof===A||i.$$typeof===x||i.$$typeof===O||i.$$typeof===C||i.$$typeof===l||i.$$typeof===e||i.$$typeof===t||i.$$typeof===p)},Re.typeOf=c,Re}var Oe={},mr;function _n(){if(mr)return Oe;mr=1;var r={};/** @license React v16.13.1
38
+ * react-is.development.js
39
+ *
40
+ * Copyright (c) Facebook, Inc. and its affiliates.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ */return r.NODE_ENV!=="production"&&(function(){var n=typeof Symbol=="function"&&Symbol.for,a=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,h=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,x=n?Symbol.for("react.profiler"):60114,O=n?Symbol.for("react.provider"):60109,y=n?Symbol.for("react.context"):60110,R=n?Symbol.for("react.async_mode"):60111,C=n?Symbol.for("react.concurrent_mode"):60111,E=n?Symbol.for("react.forward_ref"):60112,_=n?Symbol.for("react.suspense"):60113,A=n?Symbol.for("react.suspense_list"):60120,T=n?Symbol.for("react.memo"):60115,p=n?Symbol.for("react.lazy"):60116,l=n?Symbol.for("react.block"):60121,e=n?Symbol.for("react.fundamental"):60117,t=n?Symbol.for("react.responder"):60118,c=n?Symbol.for("react.scope"):60119;function f(W){return typeof W=="string"||typeof W=="function"||W===h||W===C||W===x||W===u||W===_||W===A||typeof W=="object"&&W!==null&&(W.$$typeof===p||W.$$typeof===T||W.$$typeof===O||W.$$typeof===y||W.$$typeof===E||W.$$typeof===e||W.$$typeof===t||W.$$typeof===c||W.$$typeof===l)}function i(W){if(typeof W=="object"&&W!==null){var he=W.$$typeof;switch(he){case a:var ze=W.type;switch(ze){case R:case C:case h:case x:case u:case _:return ze;default:var xe=ze&&ze.$$typeof;switch(xe){case y:case E:case p:case T:case O:return xe;default:return he}}case o:return he}}}var b=R,j=C,P=y,z=O,N=a,F=E,Z=h,K=p,Q=T,V=o,X=x,J=u,ne=_,Se=!1;function ve(W){return Se||(Se=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(W)||i(W)===R}function M(W){return i(W)===C}function L(W){return i(W)===y}function le(W){return i(W)===O}function ie(W){return typeof W=="object"&&W!==null&&W.$$typeof===a}function ce(W){return i(W)===E}function pe(W){return i(W)===h}function ue(W){return i(W)===p}function I(W){return i(W)===T}function G(W){return i(W)===o}function ee(W){return i(W)===x}function $(W){return i(W)===u}function ae(W){return i(W)===_}Oe.AsyncMode=b,Oe.ConcurrentMode=j,Oe.ContextConsumer=P,Oe.ContextProvider=z,Oe.Element=N,Oe.ForwardRef=F,Oe.Fragment=Z,Oe.Lazy=K,Oe.Memo=Q,Oe.Portal=V,Oe.Profiler=X,Oe.StrictMode=J,Oe.Suspense=ne,Oe.isAsyncMode=ve,Oe.isConcurrentMode=M,Oe.isContextConsumer=L,Oe.isContextProvider=le,Oe.isElement=ie,Oe.isForwardRef=ce,Oe.isFragment=pe,Oe.isLazy=ue,Oe.isMemo=I,Oe.isPortal=G,Oe.isProfiler=ee,Oe.isStrictMode=$,Oe.isSuspense=ae,Oe.isValidElementType=f,Oe.typeOf=i})(),Oe}var yr;function vr(){if(yr)return Et.exports;yr=1;var r={};return r.NODE_ENV==="production"?Et.exports=Cn():Et.exports=_n(),Et.exports}/*
45
+ object-assign
46
+ (c) Sindre Sorhus
47
+ @license MIT
48
+ */var Bt,br;function En(){if(br)return Bt;br=1;var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function h(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var x={},O=0;O<10;O++)x["_"+String.fromCharCode(O)]=O;var y=Object.getOwnPropertyNames(x).map(function(C){return x[C]});if(y.join("")!=="0123456789")return!1;var R={};return"abcdefghijklmnopqrst".split("").forEach(function(C){R[C]=C}),Object.keys(Object.assign({},R)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Bt=h()?Object.assign:function(u,x){for(var O,y=o(u),R,C=1;C<arguments.length;C++){O=Object(arguments[C]);for(var E in O)n.call(O,E)&&(y[E]=O[E]);if(r){R=r(O);for(var _=0;_<R.length;_++)a.call(O,R[_])&&(y[R[_]]=O[R[_]])}}return y},Bt}var qt,xr;function Ft(){if(xr)return qt;xr=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return qt=r,qt}var Gt,wr;function Sr(){return wr||(wr=1,Gt=Function.call.bind(Object.prototype.hasOwnProperty)),Gt}var Yt,jr;function Pn(){if(jr)return Yt;jr=1;var r={},n=function(){};if(r.NODE_ENV!=="production"){var a=Ft(),o={},h=Sr();n=function(x){var O="Warning: "+x;typeof console<"u"&&console.error(O);try{throw new Error(O)}catch{}}}function u(x,O,y,R,C){if(r.NODE_ENV!=="production"){for(var E in x)if(h(x,E)){var _;try{if(typeof x[E]!="function"){var A=Error((R||"React class")+": "+y+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof x[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}_=x[E](O,E,R,y,null,a)}catch(p){_=p}if(_&&!(_ instanceof Error)&&n((R||"React class")+": type specification of "+y+" `"+E+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof _+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),_ instanceof Error&&!(_.message in o)){o[_.message]=!0;var T=C?C():"";n("Failed "+y+" type: "+_.message+(T??""))}}}}return u.resetWarningCache=function(){r.NODE_ENV!=="production"&&(o={})},Yt=u,Yt}var Vt,Rr;function Dn(){if(Rr)return Vt;Rr=1;var r={},n=vr(),a=En(),o=Ft(),h=Sr(),u=Pn(),x=function(){};r.NODE_ENV!=="production"&&(x=function(y){var R="Warning: "+y;typeof console<"u"&&console.error(R);try{throw new Error(R)}catch{}});function O(){return null}return Vt=function(y,R){var C=typeof Symbol=="function"&&Symbol.iterator,E="@@iterator";function _(M){var L=M&&(C&&M[C]||M[E]);if(typeof L=="function")return L}var A="<<anonymous>>",T={array:t("array"),bigint:t("bigint"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:c(),arrayOf:f,element:i(),elementType:b(),instanceOf:j,node:F(),objectOf:z,oneOf:P,oneOfType:N,shape:K,exact:Q};function p(M,L){return M===L?M!==0||1/M===1/L:M!==M&&L!==L}function l(M,L){this.message=M,this.data=L&&typeof L=="object"?L:{},this.stack=""}l.prototype=Error.prototype;function e(M){if(r.NODE_ENV!=="production")var L={},le=0;function ie(pe,ue,I,G,ee,$,ae){if(G=G||A,$=$||I,ae!==o){if(R){var W=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw W.name="Invariant Violation",W}else if(r.NODE_ENV!=="production"&&typeof console<"u"){var he=G+":"+I;!L[he]&&le<3&&(x("You are manually calling a React.PropTypes validation function for the `"+$+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),L[he]=!0,le++)}}return ue[I]==null?pe?ue[I]===null?new l("The "+ee+" `"+$+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new l("The "+ee+" `"+$+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:M(ue,I,G,ee,$)}var ce=ie.bind(null,!1);return ce.isRequired=ie.bind(null,!0),ce}function t(M){function L(le,ie,ce,pe,ue,I){var G=le[ie],ee=J(G);if(ee!==M){var $=ne(G);return new l("Invalid "+pe+" `"+ue+"` of type "+("`"+$+"` supplied to `"+ce+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return e(L)}function c(){return e(O)}function f(M){function L(le,ie,ce,pe,ue){if(typeof M!="function")return new l("Property `"+ue+"` of component `"+ce+"` has invalid PropType notation inside arrayOf.");var I=le[ie];if(!Array.isArray(I)){var G=J(I);return new l("Invalid "+pe+" `"+ue+"` of type "+("`"+G+"` supplied to `"+ce+"`, expected an array."))}for(var ee=0;ee<I.length;ee++){var $=M(I,ee,ce,pe,ue+"["+ee+"]",o);if($ instanceof Error)return $}return null}return e(L)}function i(){function M(L,le,ie,ce,pe){var ue=L[le];if(!y(ue)){var I=J(ue);return new l("Invalid "+ce+" `"+pe+"` of type "+("`"+I+"` supplied to `"+ie+"`, expected a single ReactElement."))}return null}return e(M)}function b(){function M(L,le,ie,ce,pe){var ue=L[le];if(!n.isValidElementType(ue)){var I=J(ue);return new l("Invalid "+ce+" `"+pe+"` of type "+("`"+I+"` supplied to `"+ie+"`, expected a single ReactElement type."))}return null}return e(M)}function j(M){function L(le,ie,ce,pe,ue){if(!(le[ie]instanceof M)){var I=M.name||A,G=ve(le[ie]);return new l("Invalid "+pe+" `"+ue+"` of type "+("`"+G+"` supplied to `"+ce+"`, expected ")+("instance of `"+I+"`."))}return null}return e(L)}function P(M){if(!Array.isArray(M))return r.NODE_ENV!=="production"&&(arguments.length>1?x("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):x("Invalid argument supplied to oneOf, expected an array.")),O;function L(le,ie,ce,pe,ue){for(var I=le[ie],G=0;G<M.length;G++)if(p(I,M[G]))return null;var ee=JSON.stringify(M,function(ae,W){var he=ne(W);return he==="symbol"?String(W):W});return new l("Invalid "+pe+" `"+ue+"` of value `"+String(I)+"` "+("supplied to `"+ce+"`, expected one of "+ee+"."))}return e(L)}function z(M){function L(le,ie,ce,pe,ue){if(typeof M!="function")return new l("Property `"+ue+"` of component `"+ce+"` has invalid PropType notation inside objectOf.");var I=le[ie],G=J(I);if(G!=="object")return new l("Invalid "+pe+" `"+ue+"` of type "+("`"+G+"` supplied to `"+ce+"`, expected an object."));for(var ee in I)if(h(I,ee)){var $=M(I,ee,ce,pe,ue+"."+ee,o);if($ instanceof Error)return $}return null}return e(L)}function N(M){if(!Array.isArray(M))return r.NODE_ENV!=="production"&&x("Invalid argument supplied to oneOfType, expected an instance of array."),O;for(var L=0;L<M.length;L++){var le=M[L];if(typeof le!="function")return x("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Se(le)+" at index "+L+"."),O}function ie(ce,pe,ue,I,G){for(var ee=[],$=0;$<M.length;$++){var ae=M[$],W=ae(ce,pe,ue,I,G,o);if(W==null)return null;W.data&&h(W.data,"expectedType")&&ee.push(W.data.expectedType)}var he=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new l("Invalid "+I+" `"+G+"` supplied to "+("`"+ue+"`"+he+"."))}return e(ie)}function F(){function M(L,le,ie,ce,pe){return V(L[le])?null:new l("Invalid "+ce+" `"+pe+"` supplied to "+("`"+ie+"`, expected a ReactNode."))}return e(M)}function Z(M,L,le,ie,ce){return new l((M||"React class")+": "+L+" type `"+le+"."+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ce+"`.")}function K(M){function L(le,ie,ce,pe,ue){var I=le[ie],G=J(I);if(G!=="object")return new l("Invalid "+pe+" `"+ue+"` of type `"+G+"` "+("supplied to `"+ce+"`, expected `object`."));for(var ee in M){var $=M[ee];if(typeof $!="function")return Z(ce,pe,ue,ee,ne($));var ae=$(I,ee,ce,pe,ue+"."+ee,o);if(ae)return ae}return null}return e(L)}function Q(M){function L(le,ie,ce,pe,ue){var I=le[ie],G=J(I);if(G!=="object")return new l("Invalid "+pe+" `"+ue+"` of type `"+G+"` "+("supplied to `"+ce+"`, expected `object`."));var ee=a({},le[ie],M);for(var $ in ee){var ae=M[$];if(h(M,$)&&typeof ae!="function")return Z(ce,pe,ue,$,ne(ae));if(!ae)return new l("Invalid "+pe+" `"+ue+"` key `"+$+"` supplied to `"+ce+"`.\nBad object: "+JSON.stringify(le[ie],null," ")+`
49
+ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var W=ae(I,$,ce,pe,ue+"."+$,o);if(W)return W}return null}return e(L)}function V(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(V);if(M===null||y(M))return!0;var L=_(M);if(L){var le=L.call(M),ie;if(L!==M.entries){for(;!(ie=le.next()).done;)if(!V(ie.value))return!1}else for(;!(ie=le.next()).done;){var ce=ie.value;if(ce&&!V(ce[1]))return!1}}else return!1;return!0;default:return!1}}function X(M,L){return M==="symbol"?!0:L?L["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&L instanceof Symbol:!1}function J(M){var L=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":X(L,M)?"symbol":L}function ne(M){if(typeof M>"u"||M===null)return""+M;var L=J(M);if(L==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return L}function Se(M){var L=ne(M);switch(L){case"array":case"object":return"an "+L;case"boolean":case"date":case"regexp":return"a "+L;default:return L}}function ve(M){return!M.constructor||!M.constructor.name?A:M.constructor.name}return T.checkPropTypes=u,T.resetWarningCache=u.resetWarningCache,T.PropTypes=T,T},Vt}var Ut,Or;function Tn(){if(Or)return Ut;Or=1;var r=Ft();function n(){}function a(){}return a.resetWarningCache=n,Ut=function(){function o(x,O,y,R,C,E){if(E!==r){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}o.isRequired=o;function h(){return o}var u={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:h,element:o,elementType:o,instanceOf:h,node:o,objectOf:h,oneOf:h,oneOfType:h,shape:h,exact:h,checkPropTypes:a,resetWarningCache:n};return u.PropTypes=u,u},Ut}var Cr;function Ue(){if(Cr)return _t.exports;Cr=1;var r={};if(r.NODE_ENV!=="production"){var n=vr(),a=!0;_t.exports=Dn()(n.isElement,a)}else _t.exports=Tn()();return _t.exports}var dt={exports:{}},$t,_r;function zn(){if(_r)return $t;_r=1;var r={},n=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,u=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,O=(d,w)=>{for(var D in w)a(d,D,{get:w[D],enumerable:!0})},y=(d,w,D,q)=>{if(w&&typeof w=="object"||typeof w=="function")for(let Y of h(w))!x.call(d,Y)&&Y!==D&&a(d,Y,{get:()=>w[Y],enumerable:!(q=o(w,Y))||q.enumerable});return d},R=(d,w,D)=>(D=d!=null?n(u(d)):{},y(!d||!d.__esModule?a(D,"default",{value:d,enumerable:!0}):D,d)),C=d=>y(a({},"__esModule",{value:!0}),d),E={};O(E,{DraggableCore:()=>ge,default:()=>je}),$t=C(E);var _=R(oe),A=R(Ue()),T=R(Mt),p=Ct();function l(d,w){for(let D=0,q=d.length;D<q;D++)if(w.apply(w,[d[D],D,d]))return d[D]}function e(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Function]"}function t(d){return typeof d=="number"&&!isNaN(d)}function c(d){return parseInt(d,10)}function f(d,w,D){if(d[w])return new Error(`Invalid prop ${w} passed to ${D} - do not set this, set it on the child.`)}var i=["Moz","Webkit","O","ms"];function b(d="transform"){var w,D;if(typeof window>"u")return"";const q=(D=(w=window.document)==null?void 0:w.documentElement)==null?void 0:D.style;if(!q||d in q)return"";for(let Y=0;Y<i.length;Y++)if(j(d,i[Y])in q)return i[Y];return""}function j(d,w){return w?`${w}${P(d)}`:d}function P(d){let w="",D=!0;for(let q=0;q<d.length;q++)D?(w+=d[q].toUpperCase(),D=!1):d[q]==="-"?D=!0:w+=d[q];return w}var z=b(),N="";function F(d,w){var D;N||(N=(D=l(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(Y){return e(d[Y])}))!=null?D:"");const q=d[N];return e(q)?!!q.call(d,w):!1}function Z(d,w,D){let q=d;do{if(F(q,w))return!0;if(q===D)return!1;q=q.parentNode}while(q);return!1}function K(d,w,D,q){if(!d)return;const Y={capture:!0,...q},Ce=D;d.addEventListener?d.addEventListener(w,Ce,Y):d.attachEvent?d.attachEvent("on"+w,Ce):d["on"+w]=Ce}function Q(d,w,D,q){if(!d)return;const Y={capture:!0,...q},Ce=D;d.removeEventListener?d.removeEventListener(w,Ce,Y):d.detachEvent?d.detachEvent("on"+w,Ce):d["on"+w]=null}function V(d){let w=d.clientHeight;const D=d.ownerDocument.defaultView.getComputedStyle(d);return w+=c(D.borderTopWidth),w+=c(D.borderBottomWidth),w}function X(d){let w=d.clientWidth;const D=d.ownerDocument.defaultView.getComputedStyle(d);return w+=c(D.borderLeftWidth),w+=c(D.borderRightWidth),w}function J(d){let w=d.clientHeight;const D=d.ownerDocument.defaultView.getComputedStyle(d);return w-=c(D.paddingTop),w-=c(D.paddingBottom),w}function ne(d){let w=d.clientWidth;const D=d.ownerDocument.defaultView.getComputedStyle(d);return w-=c(D.paddingLeft),w-=c(D.paddingRight),w}function Se(d,w,D){const Y=w===w.ownerDocument.body?{left:0,top:0}:w.getBoundingClientRect(),Ce=(d.clientX+w.scrollLeft-Y.left)/D,me=(d.clientY+w.scrollTop-Y.top)/D;return{x:Ce,y:me}}function ve(d,w){const D=L(d,w,"px");return{[j("transform",z)]:D}}function M(d,w){return L(d,w,"")}function L({x:d,y:w},D,q){let Y=`translate(${d}${q},${w}${q})`;if(D){const Ce=`${typeof D.x=="string"?D.x:D.x+q}`,me=`${typeof D.y=="string"?D.y:D.y+q}`;Y=`translate(${Ce}, ${me})`+Y}return Y}function le(d,w){return d.targetTouches&&l(d.targetTouches,D=>w===D.identifier)||d.changedTouches&&l(d.changedTouches,D=>w===D.identifier)}function ie(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function ce(d){if(!d)return;let w=d.getElementById("react-draggable-style-el");w||(w=d.createElement("style"),w.type="text/css",w.id="react-draggable-style-el",w.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
50
+ `,w.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
51
+ `,d.getElementsByTagName("head")[0].appendChild(w)),d.body&&I(d.body,"react-draggable-transparent-selection")}function pe(d){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ue(d)}):ue(d)}function ue(d){if(d)try{d.body&&G(d.body,"react-draggable-transparent-selection");const w=d.selection;if(w)w.empty();else{const D=(d.defaultView||window).getSelection();D&&D.type!=="Caret"&&D.removeAllRanges()}}catch{}}function I(d,w){d.classList?d.classList.add(w):d.className.match(new RegExp(`(?:^|\\s)${w}(?!\\S)`))||(d.className+=` ${w}`)}function G(d,w){d.classList?d.classList.remove(w):d.className=d.className.replace(new RegExp(`(?:^|\\s)${w}(?!\\S)`,"g"),"")}function ee(d,w,D){if(!d.props.bounds)return[w,D];let{bounds:q}=d.props;q=typeof q=="string"?q:Ae(q);const Y=m(d);if(typeof q=="string"){const{ownerDocument:Ce}=Y,me=Ce.defaultView;if(!me)throw new Error("Cannot resolve the owner window of the draggable node.");let Pe;if(q==="parent"?Pe=Y.parentNode:Pe=Y.getRootNode().querySelector(q),!(Pe instanceof me.HTMLElement))throw new Error('Bounds selector "'+q+'" could not find an element.');const ke=Pe,Ye=me.getComputedStyle(Y),$e=me.getComputedStyle(ke);q={left:-Y.offsetLeft+c($e.paddingLeft)+c(Ye.marginLeft),top:-Y.offsetTop+c($e.paddingTop)+c(Ye.marginTop),right:ne(ke)-X(Y)-Y.offsetLeft+c($e.paddingRight)-c(Ye.marginRight),bottom:J(ke)-V(Y)-Y.offsetTop+c($e.paddingBottom)-c(Ye.marginBottom)}}return t(q.right)&&(w=Math.min(w,q.right)),t(q.bottom)&&(D=Math.min(D,q.bottom)),t(q.left)&&(w=Math.max(w,q.left)),t(q.top)&&(D=Math.max(D,q.top)),[w,D]}function $(d,w,D){const q=Math.round(w/d[0])*d[0],Y=Math.round(D/d[1])*d[1];return[q,Y]}function ae(d){return d.props.axis==="both"||d.props.axis==="x"}function W(d){return d.props.axis==="both"||d.props.axis==="y"}function he(d,w,D){const q=typeof w=="number"?le(d,w):null;if(typeof w=="number"&&!q)return null;const Y=m(D),Ce=D.props.offsetParent||Y.offsetParent||Y.ownerDocument.body;return Se(q||d,Ce,D.props.scale)}function ze(d,w,D){const q=!t(d.lastX),Y=m(d);return q?{node:Y,deltaX:0,deltaY:0,lastX:w,lastY:D,x:w,y:D}:{node:Y,deltaX:w-d.lastX,deltaY:D-d.lastY,lastX:d.lastX,lastY:d.lastY,x:w,y:D}}function xe(d,w){const D=d.props.scale;return{node:w.node,x:d.state.x+w.deltaX/D,y:d.state.y+w.deltaY/D,deltaX:w.deltaX/D,deltaY:w.deltaY/D,lastX:d.state.x,lastY:d.state.y}}function Ae(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function m(d){const w=d.findDOMNode();if(!w)throw new Error("<DraggableCore>: Unmounted during event!");return w}var v=R(oe),S=R(Ue()),H=R(Mt);function re(...d){r.DRAGGABLE_DEBUG&&console.log(...d)}var U={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},se=U.mouse,ge=class extends v.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=d=>{if(this.props.onMouseDown(d),!this.props.allowAnyClick&&(typeof d.button=="number"&&d.button!==0||d.ctrlKey))return!1;const w=this.findDOMNode();if(!w||!w.ownerDocument||!w.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:D}=w;if(this.props.disabled||!(d.target instanceof D.defaultView.Node)||this.props.handle&&!Z(d.target,this.props.handle,w)||this.props.cancel&&Z(d.target,this.props.cancel,w))return;d.type==="touchstart"&&!this.props.allowMobileScroll&&d.preventDefault();const q=ie(d);this.touchIdentifier=q;const Y=he(d,q,this);if(Y==null)return;const{x:Ce,y:me}=Y,Pe=ze(this,Ce,me);re("DraggableCore: handleDragStart: %j",Pe),re("calling",this.props.onStart),!(this.props.onStart(d,Pe)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ce(D),this.dragging=!0,this.lastX=Ce,this.lastY=me,K(D,se.move,this.handleDrag),K(D,se.stop,this.handleDragStop))},this.handleDrag=d=>{const w=he(d,this.touchIdentifier,this);if(w==null)return;let{x:D,y:q}=w;if(Array.isArray(this.props.grid)){let me=D-this.lastX,Pe=q-this.lastY;if([me,Pe]=$(this.props.grid,me,Pe),!me&&!Pe)return;D=this.lastX+me,q=this.lastY+Pe}const Y=ze(this,D,q);if(re("DraggableCore: handleDrag: %j",Y),this.props.onDrag(d,Y)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const me=document.createEvent("MouseEvents");me.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(me)}return}this.lastX=D,this.lastY=q},this.handleDragStop=d=>{if(!this.dragging)return;const w=he(d,this.touchIdentifier,this);if(w==null)return;let{x:D,y:q}=w;if(Array.isArray(this.props.grid)){let Pe=D-this.lastX||0,ke=q-this.lastY||0;[Pe,ke]=$(this.props.grid,Pe,ke),D=this.lastX+Pe,q=this.lastY+ke}const Y=ze(this,D,q);if(this.props.onStop(d,Y)===!1||this.mounted===!1)return!1;const me=this.findDOMNode();me&&this.props.enableUserSelectHack&&pe(me.ownerDocument),re("DraggableCore: handleDragStop: %j",Y),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,me&&(re("DraggableCore: Removing handlers"),Q(me.ownerDocument,se.move,this.handleDrag),Q(me.ownerDocument,se.stop,this.handleDragStop))},this.onMouseDown=d=>(se=U.mouse,this.handleDragStart(d)),this.onMouseUp=d=>(se=U.mouse,this.handleDragStop(d)),this.onTouchStart=d=>(se=U.touch,this.handleDragStart(d)),this.onTouchEnd=d=>(se=U.touch,this.handleDragStop(d))}componentDidMount(){this.mounted=!0;const d=this.findDOMNode();d&&K(d,U.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const d=this.findDOMNode();if(d){const{ownerDocument:w}=d;Q(w,U.mouse.move,this.handleDrag),Q(w,U.touch.move,this.handleDrag),Q(w,U.mouse.stop,this.handleDragStop),Q(w,U.touch.stop,this.handleDragStop),Q(d,U.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&pe(w)}}findDOMNode(){var d;if((d=this.props)!=null&&d.nodeRef)return this.props.nodeRef.current;const w=H.default;return typeof w.findDOMNode=="function"?w.findDOMNode(this):(re("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return v.cloneElement(v.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ge.displayName="DraggableCore",ge.propTypes={allowAnyClick:S.default.bool,allowMobileScroll:S.default.bool,children:S.default.node.isRequired,disabled:S.default.bool,enableUserSelectHack:S.default.bool,offsetParent:function(d,w){if(d[w]&&d[w].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:S.default.arrayOf(S.default.number),handle:S.default.string,cancel:S.default.string,nodeRef:S.default.object,onStart:S.default.func,onDrag:S.default.func,onStop:S.default.func,onMouseDown:S.default.func,scale:S.default.number,className:f,style:f,transform:f},ge.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var je=class extends _.Component{constructor(d){super(d),this.onDragStart=(w,D)=>{if(re("Draggable: onDragStart: %j",D),this.props.onStart(w,xe(this,D))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(w,D)=>{if(!this.state.dragging)return!1;re("Draggable: onDrag: %j",D);const q=xe(this,D),Y={x:q.x,y:q.y,slackX:0,slackY:0};if(this.props.bounds){const{x:me,y:Pe}=Y;Y.x+=this.state.slackX,Y.y+=this.state.slackY;const[ke,Ye]=ee(this,Y.x,Y.y);Y.x=ke,Y.y=Ye,Y.slackX=this.state.slackX+(me-Y.x),Y.slackY=this.state.slackY+(Pe-Y.y),q.x=Y.x,q.y=Y.y,q.deltaX=Y.x-this.state.x,q.deltaY=Y.y-this.state.y}if(this.props.onDrag(w,q)===!1)return!1;this.setState(Y)},this.onDragStop=(w,D)=>{if(!this.state.dragging||this.props.onStop(w,xe(this,D))===!1)return!1;re("Draggable: onDragStop: %j",D);const Y={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:me,y:Pe}=this.props.position;Y.x=me,Y.y=Pe}this.setState(Y)},this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:d},{prevPropsPosition:w}){return d&&(!w||d.x!==w.x||d.y!==w.y)?(re("Draggable: getDerivedStateFromProps %j",{position:d,prevPropsPosition:w}),{x:d.x,y:d.y,prevPropsPosition:{...d}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var d;if((d=this.props)!=null&&d.nodeRef)return this.props.nodeRef.current;const w=T.default;return typeof w.findDOMNode=="function"?w.findDOMNode(this):null}render(){const{axis:d,bounds:w,children:D,defaultPosition:q,defaultClassName:Y,defaultClassNameDragging:Ce,defaultClassNameDragged:me,position:Pe,positionOffset:ke,scale:Ye,...$e}=this.props;let yt={},Qe=null;const Ve=!!!Pe||this.state.dragging,et=Pe||q,tt={x:ae(this)&&Ve?this.state.x:et.x,y:W(this)&&Ve?this.state.y:et.y};this.state.isElementSVG?Qe=M(tt,ke):yt=ve(tt,ke);const rt=_.Children.only(D),Qt=(0,p.clsx)(rt.props.className||"",Y,{[Ce]:this.state.dragging,[me]:this.state.dragged});return _.createElement(ge,{...$e,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},_.cloneElement(rt,{className:Qt,style:{...rt.props.style,...yt},transform:Qe}))}};return je.displayName="Draggable",je.propTypes={...ge.propTypes,axis:A.default.oneOf(["both","x","y","none"]),bounds:A.default.oneOfType([A.default.shape({left:A.default.number,right:A.default.number,top:A.default.number,bottom:A.default.number}),A.default.string,A.default.oneOf([!1])]),defaultClassName:A.default.string,defaultClassNameDragging:A.default.string,defaultClassNameDragged:A.default.string,defaultPosition:A.default.shape({x:A.default.number,y:A.default.number}),positionOffset:A.default.shape({x:A.default.oneOfType([A.default.number,A.default.string]),y:A.default.oneOfType([A.default.number,A.default.string])}),position:A.default.shape({x:A.default.number,y:A.default.number}),className:f,style:f,transform:f},je.defaultProps={...ge.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1},$t}var Er;function Xt(){if(Er)return dt.exports;Er=1;const r=zn(),n=r.DraggableCore,a=r.default||r;return dt.exports=a,dt.exports.default=a,dt.exports.DraggableCore=n,dt.exports}var ft={exports:{}},pt={},Pt={},Pr;function kn(){if(Pr)return Pt;Pr=1,Pt.__esModule=!0,Pt.cloneElement=O;var r=n(oe);function n(y){return y&&y.__esModule?y:{default:y}}function a(y,R){var C=Object.keys(y);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(y);R&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(y,_).enumerable})),C.push.apply(C,E)}return C}function o(y){for(var R=1;R<arguments.length;R++){var C=arguments[R]!=null?arguments[R]:{};R%2?a(Object(C),!0).forEach(function(E){h(y,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(C)):a(Object(C)).forEach(function(E){Object.defineProperty(y,E,Object.getOwnPropertyDescriptor(C,E))})}return y}function h(y,R,C){return(R=u(R))in y?Object.defineProperty(y,R,{value:C,enumerable:!0,configurable:!0,writable:!0}):y[R]=C,y}function u(y){var R=x(y,"string");return typeof R=="symbol"?R:R+""}function x(y,R){if(typeof y!="object"||!y)return y;var C=y[Symbol.toPrimitive];if(C!==void 0){var E=C.call(y,R);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(y)}function O(y,R){return R.style&&y.props.style&&(R.style=o(o({},y.props.style),R.style)),R.className&&y.props.className&&(R.className=y.props.className+" "+R.className),r.default.cloneElement(y,R)}return Pt}var ht={},Dr;function Tr(){if(Dr)return ht;Dr=1,ht.__esModule=!0,ht.resizableProps=void 0;var r=n(Ue());Xt();function n(a){return a&&a.__esModule?a:{default:a}}return ht.resizableProps={axis:r.default.oneOf(["both","x","y","none"]),className:r.default.string,children:r.default.element.isRequired,draggableOpts:r.default.shape({allowAnyClick:r.default.bool,cancel:r.default.string,children:r.default.node,disabled:r.default.bool,enableUserSelectHack:r.default.bool,offsetParent:typeof Element<"u"?r.default.instanceOf(Element):r.default.any,grid:r.default.arrayOf(r.default.number),handle:r.default.string,nodeRef:r.default.object,onStart:r.default.func,onDrag:r.default.func,onStop:r.default.func,onMouseDown:r.default.func,scale:r.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),h=0;h<a;h++)o[h]=arguments[h];const u=o[0];return u.axis==="both"||u.axis==="y"?r.default.number.isRequired(...o):r.default.number(...o)},handle:r.default.oneOfType([r.default.node,r.default.func]),handleSize:r.default.arrayOf(r.default.number),lockAspectRatio:r.default.bool,maxConstraints:r.default.arrayOf(r.default.number),minConstraints:r.default.arrayOf(r.default.number),onResizeStop:r.default.func,onResizeStart:r.default.func,onResize:r.default.func,resizeHandles:r.default.arrayOf(r.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:r.default.number,width:function(){for(var a=arguments.length,o=new Array(a),h=0;h<a;h++)o[h]=arguments[h];const u=o[0];return u.axis==="both"||u.axis==="x"?r.default.number.isRequired(...o):r.default.number(...o)}},ht}var zr;function kr(){if(zr)return pt;zr=1,pt.__esModule=!0,pt.default=void 0;var r=u(oe),n=Xt(),a=kn(),o=Tr();const h=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function u(T,p){if(typeof WeakMap=="function")var l=new WeakMap,e=new WeakMap;return(u=function(t,c){if(!c&&t&&t.__esModule)return t;var f,i,b={__proto__:null,default:t};if(t===null||typeof t!="object"&&typeof t!="function")return b;if(f=c?e:l){if(f.has(t))return f.get(t);f.set(t,b)}for(const j in t)j!=="default"&&{}.hasOwnProperty.call(t,j)&&((i=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,j))&&(i.get||i.set)?f(b,j,i):b[j]=t[j]);return b})(T,p)}function x(){return x=Object.assign?Object.assign.bind():function(T){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var e in l)({}).hasOwnProperty.call(l,e)&&(T[e]=l[e])}return T},x.apply(null,arguments)}function O(T,p){if(T==null)return{};var l={};for(var e in T)if({}.hasOwnProperty.call(T,e)){if(p.indexOf(e)!==-1)continue;l[e]=T[e]}return l}function y(T,p){var l=Object.keys(T);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(T);p&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(T,t).enumerable})),l.push.apply(l,e)}return l}function R(T){for(var p=1;p<arguments.length;p++){var l=arguments[p]!=null?arguments[p]:{};p%2?y(Object(l),!0).forEach(function(e){C(T,e,l[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(l)):y(Object(l)).forEach(function(e){Object.defineProperty(T,e,Object.getOwnPropertyDescriptor(l,e))})}return T}function C(T,p,l){return(p=E(p))in T?Object.defineProperty(T,p,{value:l,enumerable:!0,configurable:!0,writable:!0}):T[p]=l,T}function E(T){var p=_(T,"string");return typeof p=="symbol"?p:p+""}function _(T,p){if(typeof T!="object"||!T)return T;var l=T[Symbol.toPrimitive];if(l!==void 0){var e=l.call(T,p);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(T)}let A=class extends r.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(p,l){const e=this.props,t=e.minConstraints,c=e.maxConstraints,f=e.lockAspectRatio;if(!t&&!c&&!f)return[p,l];if(f){const N=this.props.width/this.props.height,F=p-this.props.width,Z=l-this.props.height;Math.abs(F)>Math.abs(Z*N)?l=p/N:p=l*N}const i=p,b=l;let j=this.slack||[0,0],P=j[0],z=j[1];return p+=P,l+=z,t&&(p=Math.max(t[0],p),l=Math.max(t[1],l)),c&&(p=Math.min(c[0],p),l=Math.min(c[1],l)),this.slack=[P+(i-p),z+(b-l)],[p,l]}resizeHandler(p,l){return(e,t)=>{var c,f,i,b;let j=t.node,P=t.deltaX,z=t.deltaY;p==="onResizeStart"&&this.resetData();const N=(this.props.axis==="both"||this.props.axis==="x")&&l!=="n"&&l!=="s",F=(this.props.axis==="both"||this.props.axis==="y")&&l!=="e"&&l!=="w";if(!N&&!F)return;const Z=l[0],K=l[l.length-1],Q=j.getBoundingClientRect();if(this.lastHandleRect!=null){if(K==="w"){const ie=Q.left-this.lastHandleRect.left;P+=ie}if(Z==="n"){const ie=Q.top-this.lastHandleRect.top;z+=ie}}this.lastHandleRect=Q,K==="w"&&(P=-P),Z==="n"&&(z=-z);const V=(c=(f=this.lastSize)==null?void 0:f.width)!=null?c:this.props.width,X=(i=(b=this.lastSize)==null?void 0:b.height)!=null?i:this.props.height;let J=V+(N?P/this.props.transformScale:0),ne=X+(F?z/this.props.transformScale:0);var Se=this.runConstraints(J,ne);if(J=Se[0],ne=Se[1],p==="onResizeStop"&&this.lastSize){var ve=this.lastSize;J=ve.width,ne=ve.height}const M=J!==V||ne!==X;p!=="onResizeStop"&&(this.lastSize={width:J,height:ne});const L=typeof this.props[p]=="function"?this.props[p]:null;L&&!(p==="onResize"&&!M)&&(e.persist==null||e.persist(),L(e,{node:j,size:{width:J,height:ne},handle:l})),p==="onResizeStop"&&this.resetData()}}renderResizeHandle(p,l){const e=this.props.handle;if(!e)return r.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+p,ref:l});if(typeof e=="function")return e(p,l);const t=typeof e.type=="string",c=R({ref:l},t?{}:{handleAxis:p});return r.cloneElement(e,c)}render(){const p=this.props,l=p.children,e=p.className,t=p.draggableOpts;p.width,p.height,p.handle,p.handleSize,p.lockAspectRatio,p.axis,p.minConstraints,p.maxConstraints,p.onResize,p.onResizeStop,p.onResizeStart;const c=p.resizeHandles;p.transformScale;const f=O(p,h);return(0,a.cloneElement)(l,R(R({},f),{},{className:(e?e+" ":"")+"react-resizable",children:[...r.Children.toArray(l.props.children),...c.map(i=>{var b;const j=(b=this.handleRefs[i])!=null?b:this.handleRefs[i]=r.createRef();return r.createElement(n.DraggableCore,x({},t,{nodeRef:j,key:"resizableHandle-"+i,onStop:this.resizeHandler("onResizeStop",i),onStart:this.resizeHandler("onResizeStart",i),onDrag:this.resizeHandler("onResize",i)}),this.renderResizeHandle(i,j))})]}))}};return pt.default=A,A.propTypes=o.resizableProps,A.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},pt}var gt={},Mr;function Mn(){if(Mr)return gt;Mr=1,gt.__esModule=!0,gt.default=void 0;var r=x(oe),n=u(Ue()),a=u(kr()),o=Tr();const h=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function u(p){return p&&p.__esModule?p:{default:p}}function x(p,l){if(typeof WeakMap=="function")var e=new WeakMap,t=new WeakMap;return(x=function(c,f){if(!f&&c&&c.__esModule)return c;var i,b,j={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return j;if(i=f?t:e){if(i.has(c))return i.get(c);i.set(c,j)}for(const P in c)P!=="default"&&{}.hasOwnProperty.call(c,P)&&((b=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,P))&&(b.get||b.set)?i(j,P,b):j[P]=c[P]);return j})(p,l)}function O(){return O=Object.assign?Object.assign.bind():function(p){for(var l=1;l<arguments.length;l++){var e=arguments[l];for(var t in e)({}).hasOwnProperty.call(e,t)&&(p[t]=e[t])}return p},O.apply(null,arguments)}function y(p,l){var e=Object.keys(p);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(p);l&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),e.push.apply(e,t)}return e}function R(p){for(var l=1;l<arguments.length;l++){var e=arguments[l]!=null?arguments[l]:{};l%2?y(Object(e),!0).forEach(function(t){C(p,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(e)):y(Object(e)).forEach(function(t){Object.defineProperty(p,t,Object.getOwnPropertyDescriptor(e,t))})}return p}function C(p,l,e){return(l=E(l))in p?Object.defineProperty(p,l,{value:e,enumerable:!0,configurable:!0,writable:!0}):p[l]=e,p}function E(p){var l=_(p,"string");return typeof l=="symbol"?l:l+""}function _(p,l){if(typeof p!="object"||!p)return p;var e=p[Symbol.toPrimitive];if(e!==void 0){var t=e.call(p,l);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(p)}function A(p,l){if(p==null)return{};var e={};for(var t in p)if({}.hasOwnProperty.call(p,t)){if(l.indexOf(t)!==-1)continue;e[t]=p[t]}return e}let T=class extends r.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(l,e)=>{const t=e.size;this.props.onResize?(l.persist==null||l.persist(),this.setState(t,()=>this.props.onResize&&this.props.onResize(l,e))):this.setState(t)}}static getDerivedStateFromProps(l,e){return e.propsWidth!==l.width||e.propsHeight!==l.height?{width:l.width,height:l.height,propsWidth:l.width,propsHeight:l.height}:null}render(){const l=this.props,e=l.handle,t=l.handleSize;l.onResize;const c=l.onResizeStart,f=l.onResizeStop,i=l.draggableOpts,b=l.minConstraints,j=l.maxConstraints,P=l.lockAspectRatio,z=l.axis;l.width,l.height;const N=l.resizeHandles,F=l.style,Z=l.transformScale,K=A(l,h);return r.createElement(a.default,{axis:z,draggableOpts:i,handle:e,handleSize:t,height:this.state.height,lockAspectRatio:P,maxConstraints:j,minConstraints:b,onResizeStart:c,onResize:this.onResize,onResizeStop:f,resizeHandles:N,transformScale:Z,width:this.state.width},r.createElement("div",O({},K,{style:R(R({},F),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return gt.default=T,T.propTypes=R(R({},o.resizableProps),{},{children:n.default.element}),gt}var Ir;function In(){return Ir||(Ir=1,ft.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ft.exports.Resizable=kr().default,ft.exports.ResizableBox=Mn().default),ft.exports}var Ge={},Ar;function Lr(){if(Ar)return Ge;Ar=1;var r={};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.resizeHandleType=Ge.resizeHandleAxesType=Ge.default=void 0;var n=o(Ue()),a=o(oe);function o(x){return x&&x.__esModule?x:{default:x}}const h=Ge.resizeHandleAxesType=n.default.arrayOf(n.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),u=Ge.resizeHandleType=n.default.oneOfType([n.default.node,n.default.func]);return Ge.default={className:n.default.string,style:n.default.object,width:n.default.number,autoSize:n.default.bool,cols:n.default.number,draggableCancel:n.default.string,draggableHandle:n.default.string,verticalCompact:function(x){x.verticalCompact===!1&&r.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:n.default.oneOf(["vertical","horizontal"]),layout:function(x){var O=x.layout;O!==void 0&&Ke().validateLayout(O,"layout")},margin:n.default.arrayOf(n.default.number),containerPadding:n.default.arrayOf(n.default.number),rowHeight:n.default.number,maxRows:n.default.number,isBounded:n.default.bool,isDraggable:n.default.bool,isResizable:n.default.bool,allowOverlap:n.default.bool,preventCollision:n.default.bool,useCSSTransforms:n.default.bool,transformScale:n.default.number,isDroppable:n.default.bool,resizeHandles:h,resizeHandle:u,onLayoutChange:n.default.func,onDragStart:n.default.func,onDrag:n.default.func,onDragStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,onResizeStop:n.default.func,onDrop:n.default.func,droppingItem:n.default.shape({i:n.default.string.isRequired,w:n.default.number.isRequired,h:n.default.number.isRequired}),children:function(x,O){const y=x[O],R={};a.default.Children.forEach(y,function(C){if((C==null?void 0:C.key)!=null){if(R[C.key])throw new Error('Duplicate child key "'+C.key+'" found! This will cause problems in ReactGridLayout.');R[C.key]=!0}})},innerRef:n.default.any},Ge}var Nr;function An(){if(Nr)return ut;Nr=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.default=void 0;var r=R(oe),n=Mt,a=R(Ue()),o=Xt(),h=In(),u=Ke(),x=Ht(),O=Lr(),y=R(Ct());function R(l){return l&&l.__esModule?l:{default:l}}function C(l,e){var t=Object.keys(l);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(l);e&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(l,f).enumerable})),t.push.apply(t,c)}return t}function E(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?C(Object(t),!0).forEach(function(c){_(l,c,t[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):C(Object(t)).forEach(function(c){Object.defineProperty(l,c,Object.getOwnPropertyDescriptor(t,c))})}return l}function _(l,e,t){return(e=A(e))in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function A(l){var e=T(l,"string");return typeof e=="symbol"?e:e+""}function T(l,e){if(typeof l!="object"||!l)return l;var t=l[Symbol.toPrimitive];if(t!==void 0){var c=t.call(l,e);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(l)}let p=class extends r.default.Component{constructor(){super(...arguments),_(this,"state",{resizing:null,dragging:null,className:""}),_(this,"elementRef",r.default.createRef()),_(this,"onDragStart",(e,t)=>{let{node:c}=t;const{onDragStart:f,transformScale:i}=this.props;if(!f)return;const b={top:0,left:0},{offsetParent:j}=c;if(!j)return;const P=j.getBoundingClientRect(),z=c.getBoundingClientRect(),N=z.left/i,F=P.left/i,Z=z.top/i,K=P.top/i;b.left=N-F+j.scrollLeft,b.top=Z-K+j.scrollTop,this.setState({dragging:b});const{x:Q,y:V}=(0,x.calcXY)(this.getPositionParams(),b.top,b.left,this.props.w,this.props.h);return f.call(this,this.props.i,Q,V,{e,node:c,newPosition:b})}),_(this,"onDrag",(e,t,c)=>{let{node:f,deltaX:i,deltaY:b}=t;const{onDrag:j}=this.props;if(!j)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let P=this.state.dragging.top+b,z=this.state.dragging.left+i;const{isBounded:N,i:F,w:Z,h:K,containerWidth:Q}=this.props,V=this.getPositionParams();if(N){const{offsetParent:Se}=f;if(Se){const{margin:ve,rowHeight:M}=this.props,L=Se.clientHeight-(0,x.calcGridItemWHPx)(K,M,ve[1]);P=(0,x.clamp)(P,0,L);const le=(0,x.calcGridColWidth)(V),ie=Q-(0,x.calcGridItemWHPx)(Z,le,ve[0]);z=(0,x.clamp)(z,0,ie)}}const X={top:P,left:z};c?this.setState({dragging:X}):(0,n.flushSync)(()=>{this.setState({dragging:X})});const{x:J,y:ne}=(0,x.calcXY)(V,P,z,Z,K);return j.call(this,F,J,ne,{e,node:f,newPosition:X})}),_(this,"onDragStop",(e,t)=>{let{node:c}=t;const{onDragStop:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:b,i:j}=this.props,{left:P,top:z}=this.state.dragging,N={top:z,left:P};this.setState({dragging:null});const{x:F,y:Z}=(0,x.calcXY)(this.getPositionParams(),z,P,i,b);return f.call(this,j,F,Z,{e,node:c,newPosition:N})}),_(this,"onResizeStop",(e,t,c)=>this.onResizeHandler(e,t,c,"onResizeStop")),_(this,"onResizeStart",(e,t,c)=>this.onResizeHandler(e,t,c,"onResizeStart")),_(this,"onResize",(e,t,c)=>this.onResizeHandler(e,t,c,"onResize"))}shouldComponentUpdate(e,t){if(this.props.children!==e.children||this.props.droppingPosition!==e.droppingPosition)return!0;const c=(0,x.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),f=(0,x.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,t);return!(0,u.fastPositionEqual)(c,f)||this.props.useCSSTransforms!==e.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(e){this.moveDroppingItem(e)}moveDroppingItem(e){const{droppingPosition:t}=this.props;if(!t)return;const c=this.elementRef.current;if(!c)return;const f=e.droppingPosition||{left:0,top:0},{dragging:i}=this.state,b=i&&t.left!==f.left||t.top!==f.top;if(!i)this.onDragStart(t.e,{node:c,deltaX:t.left,deltaY:t.top});else if(b){const j=t.left-i.left,P=t.top-i.top;this.onDrag(t.e,{node:c,deltaX:j,deltaY:P},!0)}}getPositionParams(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}createStyle(e){const{usePercentages:t,containerWidth:c,useCSSTransforms:f}=this.props;let i;return f?i=(0,u.setTransform)(e):(i=(0,u.setTopLeft)(e),t&&(i.left=(0,u.perc)(e.left/c),i.width=(0,u.perc)(e.width/c))),i}mixinDraggable(e,t){return r.default.createElement(o.DraggableCore,{disabled:!t,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},e)}curryResizeHandler(e,t){return(c,f)=>t(c,f,e)}mixinResizable(e,t,c){const{cols:f,minW:i,minH:b,maxW:j,maxH:P,transformScale:z,resizeHandles:N,resizeHandle:F}=this.props,Z=this.getPositionParams(),K=(0,x.calcGridItemPosition)(Z,0,0,f,0).width,Q=(0,x.calcGridItemPosition)(Z,0,0,i,b),V=(0,x.calcGridItemPosition)(Z,0,0,j,P),X=[Q.width,Q.height],J=[Math.min(V.width,K),Math.min(V.height,1/0)];return r.default.createElement(h.Resizable,{draggableOpts:{disabled:!c},className:c?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:X,maxConstraints:J,onResizeStop:this.curryResizeHandler(t,this.onResizeStop),onResizeStart:this.curryResizeHandler(t,this.onResizeStart),onResize:this.curryResizeHandler(t,this.onResize),transformScale:z,resizeHandles:N,handle:F},e)}onResizeHandler(e,t,c,f){let{node:i,size:b,handle:j}=t;const P=this.props[f];if(!P)return;const{x:z,y:N,i:F,maxH:Z,minH:K,containerWidth:Q}=this.props,{minW:V,maxW:X}=this.props;let J=b;i&&(J=(0,u.resizeItemInDirection)(j,c,b,Q),(0,n.flushSync)(()=>{this.setState({resizing:f==="onResizeStop"?null:J})}));let{w:ne,h:Se}=(0,x.calcWH)(this.getPositionParams(),J.width,J.height,z,N,j);ne=(0,x.clamp)(ne,Math.max(V,1),X),Se=(0,x.clamp)(Se,K,Z),P.call(this,F,ne,Se,{e,node:i,size:J,handle:j})}render(){const{x:e,y:t,w:c,h:f,isDraggable:i,isResizable:b,droppingPosition:j,useCSSTransforms:P}=this.props,z=(0,x.calcGridItemPosition)(this.getPositionParams(),e,t,c,f,this.state),N=r.default.Children.only(this.props.children);let F=r.default.cloneElement(N,{ref:this.elementRef,className:(0,y.default)("react-grid-item",N.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!j,cssTransforms:P}),style:E(E(E({},this.props.style),N.props.style),this.createStyle(z))});return F=this.mixinResizable(F,z,b),F=this.mixinDraggable(F,i),F}};return ut.default=p,_(p,"propTypes",{children:a.default.element,cols:a.default.number.isRequired,containerWidth:a.default.number.isRequired,rowHeight:a.default.number.isRequired,margin:a.default.array.isRequired,maxRows:a.default.number.isRequired,containerPadding:a.default.array.isRequired,x:a.default.number.isRequired,y:a.default.number.isRequired,w:a.default.number.isRequired,h:a.default.number.isRequired,minW:function(l,e){const t=l[e];if(typeof t!="number")return new Error("minWidth not Number");if(t>l.w||t>l.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(l,e){const t=l[e];if(typeof t!="number")return new Error("maxWidth not Number");if(t<l.w||t<l.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(l,e){const t=l[e];if(typeof t!="number")return new Error("minHeight not Number");if(t>l.h||t>l.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(l,e){const t=l[e];if(typeof t!="number")return new Error("maxHeight not Number");if(t<l.h||t<l.minH)return new Error("maxHeight smaller than item height/minHeight")},i:a.default.string.isRequired,resizeHandles:O.resizeHandleAxesType,resizeHandle:O.resizeHandleType,onDragStop:a.default.func,onDragStart:a.default.func,onDrag:a.default.func,onResizeStop:a.default.func,onResizeStart:a.default.func,onResize:a.default.func,isDraggable:a.default.bool.isRequired,isResizable:a.default.bool.isRequired,isBounded:a.default.bool.isRequired,static:a.default.bool,useCSSTransforms:a.default.bool.isRequired,transformScale:a.default.number,className:a.default.string,handle:a.default.string,cancel:a.default.string,droppingPosition:a.default.shape({e:a.default.object.isRequired,left:a.default.number.isRequired,top:a.default.number.isRequired})}),_(p,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),ut}var Wr;function Hr(){if(Wr)return lt;Wr=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;var r=y(oe),n=Nt(),a=O(Ct()),o=Ke(),h=Ht(),u=O(An()),x=O(Lr());function O(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(typeof WeakMap=="function")var c=new WeakMap,f=new WeakMap;return(y=function(i,b){if(!b&&i&&i.__esModule)return i;var j,P,z={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return z;if(j=b?f:c){if(j.has(i))return j.get(i);j.set(i,z)}for(const N in i)N!=="default"&&{}.hasOwnProperty.call(i,N)&&((P=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,N))&&(P.get||P.set)?j(z,N,P):z[N]=i[N]);return z})(e,t)}function R(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);t&&(f=f.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),c.push.apply(c,f)}return c}function C(e){for(var t=1;t<arguments.length;t++){var c=arguments[t]!=null?arguments[t]:{};t%2?R(Object(c),!0).forEach(function(f){E(e,f,c[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):R(Object(c)).forEach(function(f){Object.defineProperty(e,f,Object.getOwnPropertyDescriptor(c,f))})}return e}function E(e,t,c){return(t=_(t))in e?Object.defineProperty(e,t,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[t]=c,e}function _(e){var t=A(e,"string");return typeof t=="symbol"?t:t+""}function A(e,t){if(typeof e!="object"||!e)return e;var c=e[Symbol.toPrimitive];if(c!==void 0){var f=c.call(e,t);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const T="react-grid-layout";let p=!1;try{p=/firefox/i.test(navigator.userAgent)}catch{}let l=class extends r.Component{constructor(){super(...arguments),E(this,"state",{activeDrag:null,layout:(0,o.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,o.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),E(this,"dragEnterCounter",0),E(this,"onDragStart",(t,c,f,i)=>{let{e:b,node:j}=i;const{layout:P}=this.state,z=(0,o.getLayoutItem)(P,t);if(!z)return;const N={w:z.w,h:z.h,x:z.x,y:z.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,o.cloneLayoutItem)(z),oldLayout:P,activeDrag:N}),this.props.onDragStart(P,z,z,null,b,j)}),E(this,"onDrag",(t,c,f,i)=>{let{e:b,node:j}=i;const{oldDragItem:P}=this.state;let{layout:z}=this.state;const{cols:N,allowOverlap:F,preventCollision:Z}=this.props,K=(0,o.getLayoutItem)(z,t);if(!K)return;const Q={w:K.w,h:K.h,x:K.x,y:K.y,placeholder:!0,i:t};z=(0,o.moveElement)(z,K,c,f,!0,Z,(0,o.compactType)(this.props),N,F),this.props.onDrag(z,P,K,Q,b,j),this.setState({layout:F?z:(0,o.compact)(z,(0,o.compactType)(this.props),N),activeDrag:Q})}),E(this,"onDragStop",(t,c,f,i)=>{let{e:b,node:j}=i;if(!this.state.activeDrag)return;const{oldDragItem:P}=this.state;let{layout:z}=this.state;const{cols:N,preventCollision:F,allowOverlap:Z}=this.props,K=(0,o.getLayoutItem)(z,t);if(!K)return;z=(0,o.moveElement)(z,K,c,f,!0,F,(0,o.compactType)(this.props),N,Z);const V=Z?z:(0,o.compact)(z,(0,o.compactType)(this.props),N);this.props.onDragStop(V,P,K,null,b,j);const{oldLayout:X}=this.state;this.setState({activeDrag:null,layout:V,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(V,X)}),E(this,"onResizeStart",(t,c,f,i)=>{let{e:b,node:j}=i;const{layout:P}=this.state,z=(0,o.getLayoutItem)(P,t);z&&(this.setState({oldResizeItem:(0,o.cloneLayoutItem)(z),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(P,z,z,null,b,j))}),E(this,"onResize",(t,c,f,i)=>{let{e:b,node:j,size:P,handle:z}=i;const{oldResizeItem:N}=this.state,{layout:F}=this.state,{cols:Z,preventCollision:K,allowOverlap:Q}=this.props;let V=!1,X,J,ne;const[Se,ve]=(0,o.withLayoutItem)(F,t,L=>{let le;return J=L.x,ne=L.y,["sw","w","nw","n","ne"].indexOf(z)!==-1&&(["sw","nw","w"].indexOf(z)!==-1&&(J=L.x+(L.w-c),c=L.x!==J&&J<0?L.w:c,J=J<0?0:J),["ne","n","nw"].indexOf(z)!==-1&&(ne=L.y+(L.h-f),f=L.y!==ne&&ne<0?L.h:f,ne=ne<0?0:ne),V=!0),K&&!Q&&(le=(0,o.getAllCollisions)(F,C(C({},L),{},{w:c,h:f,x:J,y:ne})).filter(ce=>ce.i!==L.i).length>0,le&&(ne=L.y,f=L.h,J=L.x,c=L.w,V=!1)),L.w=c,L.h=f,L});if(!ve)return;X=Se,V&&(X=(0,o.moveElement)(Se,ve,J,ne,!0,this.props.preventCollision,(0,o.compactType)(this.props),Z,Q));const M={w:ve.w,h:ve.h,x:ve.x,y:ve.y,static:!0,i:t};this.props.onResize(X,N,ve,M,b,j),this.setState({layout:Q?X:(0,o.compact)(X,(0,o.compactType)(this.props),Z),activeDrag:M})}),E(this,"onResizeStop",(t,c,f,i)=>{let{e:b,node:j}=i;const{layout:P,oldResizeItem:z}=this.state,{cols:N,allowOverlap:F}=this.props,Z=(0,o.getLayoutItem)(P,t),K=F?P:(0,o.compact)(P,(0,o.compactType)(this.props),N);this.props.onResizeStop(K,z,Z,null,b,j);const{oldLayout:Q}=this.state;this.setState({activeDrag:null,layout:K,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(K,Q)}),E(this,"onDragOver",t=>{var c;if(t.preventDefault(),t.stopPropagation(),p&&!((c=t.nativeEvent.target)!==null&&c!==void 0&&c.classList.contains(T)))return!1;const{droppingItem:f,onDropDragOver:i,margin:b,cols:j,rowHeight:P,maxRows:z,width:N,containerPadding:F,transformScale:Z}=this.props,K=i==null?void 0:i(t);if(K===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const Q=C(C({},f),K),{layout:V}=this.state,X=t.currentTarget.getBoundingClientRect(),J=t.clientX-X.left,ne=t.clientY-X.top,Se={left:J/Z,top:ne/Z,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ve,top:M}=this.state.droppingPosition;(ve!=J||M!=ne)&&this.setState({droppingPosition:Se})}}else{const ve={cols:j,margin:b,maxRows:z,rowHeight:P,containerWidth:N,containerPadding:F||b},M=(0,h.calcXY)(ve,ne,J,Q.w,Q.h);this.setState({droppingDOMNode:r.createElement("div",{key:Q.i}),droppingPosition:Se,layout:[...V,C(C({},Q),{},{x:M.x,y:M.y,static:!1,isDraggable:!0})]})}}),E(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:c}=this.props,{layout:f}=this.state,i=(0,o.compact)(f.filter(b=>b.i!==t.i),(0,o.compactType)(this.props),c,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),E(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),E(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),E(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:c}=this.props,{layout:f}=this.state,i=f.find(b=>b.i===c.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,c){let f;return c.activeDrag?null:(!(0,n.deepEqual)(t.layout,c.propsLayout)||t.compactType!==c.compactType?f=t.layout:(0,o.childrenEqual)(t.children,c.children)||(f=c.layout),f?{layout:(0,o.synchronizeLayoutWithChildren)(f,t.children,t.cols,(0,o.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,c){return this.props.children!==t.children||!(0,o.fastRGLPropsEqual)(this.props,t,n.deepEqual)||this.state.activeDrag!==c.activeDrag||this.state.mounted!==c.mounted||this.state.droppingPosition!==c.droppingPosition}componentDidUpdate(t,c){if(!this.state.activeDrag){const f=this.state.layout,i=c.layout;this.onLayoutMaybeChanged(f,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,o.bottom)(this.state.layout),c=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+c*2+"px"}onLayoutMaybeChanged(t,c){c||(c=this.state.layout),(0,n.deepEqual)(c,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:c,cols:f,margin:i,containerPadding:b,rowHeight:j,maxRows:P,useCSSTransforms:z,transformScale:N}=this.props;return r.createElement(u.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:c,cols:f,margin:i,containerPadding:b||i,maxRows:P,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:z,transformScale:N},r.createElement("div",null))}processGridItem(t,c){if(!t||!t.key)return;const f=(0,o.getLayoutItem)(this.state.layout,String(t.key));if(!f)return null;const{width:i,cols:b,margin:j,containerPadding:P,rowHeight:z,maxRows:N,isDraggable:F,isResizable:Z,isBounded:K,useCSSTransforms:Q,transformScale:V,draggableCancel:X,draggableHandle:J,resizeHandles:ne,resizeHandle:Se}=this.props,{mounted:ve,droppingPosition:M}=this.state,L=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&F,le=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&Z,ie=f.resizeHandles||ne,ce=L&&K&&f.isBounded!==!1;return r.createElement(u.default,{containerWidth:i,cols:b,margin:j,containerPadding:P||j,maxRows:N,rowHeight:z,cancel:X,handle:J,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:L,isResizable:le,isBounded:ce,useCSSTransforms:Q&&ve,usePercentages:!ve,transformScale:V,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:c?M:void 0,resizeHandles:ie,resizeHandle:Se},t)}render(){const{className:t,style:c,isDroppable:f,innerRef:i}=this.props,b=(0,a.default)(T,t),j=C({height:this.containerHeight()},c);return r.createElement("div",{ref:i,className:b,style:j,onDrop:f?this.onDrop:o.noop,onDragLeave:f?this.onDragLeave:o.noop,onDragEnter:f?this.onDragEnter:o.noop,onDragOver:f?this.onDragOver:o.noop},r.Children.map(this.props.children,P=>this.processGridItem(P)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return lt.default=l,E(l,"displayName","ReactGridLayout"),E(l,"propTypes",x.default),E(l,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:o.noop,onDragStart:o.noop,onDrag:o.noop,onDragStop:o.noop,onResizeStart:o.noop,onResize:o.noop,onResizeStop:o.noop,onDrop:o.noop,onDropDragOver:o.noop}),lt}var mt={},Xe={},Br;function qr(){if(Br)return Xe;Br=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.findOrGenerateResponsiveLayout=o,Xe.getBreakpointFromWidth=n,Xe.getColsFromBreakpoint=a,Xe.sortBreakpoints=h;var r=Ke();function n(u,x){const O=h(u);let y=O[0];for(let R=1,C=O.length;R<C;R++){const E=O[R];x>u[E]&&(y=E)}return y}function a(u,x){if(!x[u])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+u+" is missing!");return x[u]}function o(u,x,O,y,R,C){if(u[O])return(0,r.cloneLayout)(u[O]);let E=u[y];const _=h(x),A=_.slice(_.indexOf(O));for(let T=0,p=A.length;T<p;T++){const l=A[T];if(u[l]){E=u[l];break}}return E=(0,r.cloneLayout)(E||[]),(0,r.compact)((0,r.correctBounds)(E,{cols:R}),C,R)}function h(u){return Object.keys(u).sort(function(O,y){return u[O]-u[y]})}return Xe}var Fr;function Ln(){if(Fr)return mt;Fr=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.default=void 0;var r=y(oe),n=O(Ue()),a=Nt(),o=Ke(),h=qr(),u=O(Hr());const x=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function O(f){return f&&f.__esModule?f:{default:f}}function y(f,i){if(typeof WeakMap=="function")var b=new WeakMap,j=new WeakMap;return(y=function(P,z){if(!z&&P&&P.__esModule)return P;var N,F,Z={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return Z;if(N=z?j:b){if(N.has(P))return N.get(P);N.set(P,Z)}for(const K in P)K!=="default"&&{}.hasOwnProperty.call(P,K)&&((F=(N=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,K))&&(F.get||F.set)?N(Z,K,F):Z[K]=P[K]);return Z})(f,i)}function R(){return R=Object.assign?Object.assign.bind():function(f){for(var i=1;i<arguments.length;i++){var b=arguments[i];for(var j in b)({}).hasOwnProperty.call(b,j)&&(f[j]=b[j])}return f},R.apply(null,arguments)}function C(f,i){if(f==null)return{};var b,j,P=E(f,i);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(f);for(j=0;j<z.length;j++)b=z[j],i.indexOf(b)===-1&&{}.propertyIsEnumerable.call(f,b)&&(P[b]=f[b])}return P}function E(f,i){if(f==null)return{};var b={};for(var j in f)if({}.hasOwnProperty.call(f,j)){if(i.indexOf(j)!==-1)continue;b[j]=f[j]}return b}function _(f,i){var b=Object.keys(f);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(f);i&&(j=j.filter(function(P){return Object.getOwnPropertyDescriptor(f,P).enumerable})),b.push.apply(b,j)}return b}function A(f){for(var i=1;i<arguments.length;i++){var b=arguments[i]!=null?arguments[i]:{};i%2?_(Object(b),!0).forEach(function(j){T(f,j,b[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(b)):_(Object(b)).forEach(function(j){Object.defineProperty(f,j,Object.getOwnPropertyDescriptor(b,j))})}return f}function T(f,i,b){return(i=p(i))in f?Object.defineProperty(f,i,{value:b,enumerable:!0,configurable:!0,writable:!0}):f[i]=b,f}function p(f){var i=l(f,"string");return typeof i=="symbol"?i:i+""}function l(f,i){if(typeof f!="object"||!f)return f;var b=f[Symbol.toPrimitive];if(b!==void 0){var j=b.call(f,i);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(f)}const e=f=>Object.prototype.toString.call(f);function t(f,i){return f==null?null:Array.isArray(f)?f:f[i]}let c=class extends r.Component{constructor(){super(...arguments),T(this,"state",this.generateInitialState()),T(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,A(A({},this.props.layouts),{},{[this.state.breakpoint]:i}))})}generateInitialState(){const{width:i,breakpoints:b,layouts:j,cols:P}=this.props,z=(0,h.getBreakpointFromWidth)(b,i),N=(0,h.getColsFromBreakpoint)(z,P),F=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,h.findOrGenerateResponsiveLayout)(j,b,z,z,N,F),breakpoint:z,cols:N}}static getDerivedStateFromProps(i,b){if(!(0,a.deepEqual)(i.layouts,b.layouts)){const{breakpoint:j,cols:P}=b;return{layout:(0,h.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,j,j,P,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,a.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,a.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:b,cols:j,layouts:P,compactType:z}=this.props,N=this.props.breakpoint||(0,h.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),F=this.state.breakpoint,Z=(0,h.getColsFromBreakpoint)(N,j),K=A({},P);if(F!==N||i.breakpoints!==b||i.cols!==j){F in K||(K[F]=(0,o.cloneLayout)(this.state.layout));let X=(0,h.findOrGenerateResponsiveLayout)(K,b,N,F,Z,z);X=(0,o.synchronizeLayoutWithChildren)(X,this.props.children,Z,z,this.props.allowOverlap),K[N]=X,this.props.onBreakpointChange(N,Z),this.props.onLayoutChange(X,K),this.setState({breakpoint:N,layout:X,cols:Z})}const Q=t(this.props.margin,N),V=t(this.props.containerPadding,N);this.props.onWidthChange(this.props.width,Q,Z,V)}render(){const i=this.props,{breakpoint:b,breakpoints:j,cols:P,layouts:z,margin:N,containerPadding:F,onBreakpointChange:Z,onLayoutChange:K,onWidthChange:Q}=i,V=C(i,x);return r.createElement(u.default,R({},V,{margin:t(N,this.state.breakpoint),containerPadding:t(F,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return mt.default=c,T(c,"propTypes",{breakpoint:n.default.string,breakpoints:n.default.object,allowOverlap:n.default.bool,cols:n.default.object,margin:n.default.oneOfType([n.default.array,n.default.object]),containerPadding:n.default.oneOfType([n.default.array,n.default.object]),layouts(f,i){if(e(f[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+e(f[i]));Object.keys(f[i]).forEach(b=>{if(!(b in f.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,o.validateLayout)(f.layouts[b],"layouts."+b)})},width:n.default.number.isRequired,onBreakpointChange:n.default.func,onLayoutChange:n.default.func,onWidthChange:n.default.func}),T(c,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:o.noop,onLayoutChange:o.noop,onWidthChange:o.noop}),mt}var Dt={},Gr=(function(){if(typeof Map<"u")return Map;function r(n,a){var o=-1;return n.some(function(h,u){return h[0]===a?(o=u,!0):!1}),o}return(function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(a){var o=r(this.__entries__,a),h=this.__entries__[o];return h&&h[1]},n.prototype.set=function(a,o){var h=r(this.__entries__,a);~h?this.__entries__[h][1]=o:this.__entries__.push([a,o])},n.prototype.delete=function(a){var o=this.__entries__,h=r(o,a);~h&&o.splice(h,1)},n.prototype.has=function(a){return!!~r(this.__entries__,a)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(a,o){o===void 0&&(o=null);for(var h=0,u=this.__entries__;h<u.length;h++){var x=u[h];a.call(o,x[1],x[0])}},n})()})(),Jt=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),Nn=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}})(),Wn=2;function Hn(r,n){var a=!1,o=!1,h=0;function u(){a&&(a=!1,r()),o&&O()}function x(){Nn(u)}function O(){var y=Date.now();if(a){if(y-h<Wn)return;o=!0}else a=!0,o=!1,setTimeout(x,n);h=y}return O}var Bn=20,qn=["top","right","bottom","left","width","height","size","weight"],Fn=typeof MutationObserver<"u",Gn=(function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Hn(this.refresh.bind(this),Bn)}return r.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n),this.connected_||this.connect_()},r.prototype.removeObserver=function(n){var a=this.observers_,o=a.indexOf(n);~o&&a.splice(o,1),!a.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},r.prototype.updateObservers_=function(){var n=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return n.forEach(function(a){return a.broadcastActive()}),n.length>0},r.prototype.connect_=function(){!Jt||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Fn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!Jt||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(n){var a=n.propertyName,o=a===void 0?"":a,h=qn.some(function(u){return!!~o.indexOf(u)});h&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r})(),Yr=(function(r,n){for(var a=0,o=Object.keys(n);a<o.length;a++){var h=o[a];Object.defineProperty(r,h,{value:n[h],enumerable:!1,writable:!1,configurable:!0})}return r}),Ze=(function(r){var n=r&&r.ownerDocument&&r.ownerDocument.defaultView;return n||Tt}),Vr=kt(0,0,0,0);function zt(r){return parseFloat(r)||0}function Ur(r){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];return n.reduce(function(o,h){var u=r["border-"+h+"-width"];return o+zt(u)},0)}function Yn(r){for(var n=["top","right","bottom","left"],a={},o=0,h=n;o<h.length;o++){var u=h[o],x=r["padding-"+u];a[u]=zt(x)}return a}function Vn(r){var n=r.getBBox();return kt(0,0,n.width,n.height)}function Un(r){var n=r.clientWidth,a=r.clientHeight;if(!n&&!a)return Vr;var o=Ze(r).getComputedStyle(r),h=Yn(o),u=h.left+h.right,x=h.top+h.bottom,O=zt(o.width),y=zt(o.height);if(o.boxSizing==="border-box"&&(Math.round(O+u)!==n&&(O-=Ur(o,"left","right")+u),Math.round(y+x)!==a&&(y-=Ur(o,"top","bottom")+x)),!Xn(r)){var R=Math.round(O+u)-n,C=Math.round(y+x)-a;Math.abs(R)!==1&&(O-=R),Math.abs(C)!==1&&(y-=C)}return kt(h.left,h.top,O,y)}var $n=(function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof Ze(r).SVGGraphicsElement}:function(r){return r instanceof Ze(r).SVGElement&&typeof r.getBBox=="function"}})();function Xn(r){return r===Ze(r).document.documentElement}function Jn(r){return Jt?$n(r)?Vn(r):Un(r):Vr}function Kn(r){var n=r.x,a=r.y,o=r.width,h=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,x=Object.create(u.prototype);return Yr(x,{x:n,y:a,width:o,height:h,top:a,right:n+o,bottom:h+a,left:n}),x}function kt(r,n,a,o){return{x:r,y:n,width:a,height:o}}var Zn=(function(){function r(n){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=kt(0,0,0,0),this.target=n}return r.prototype.isActive=function(){var n=Jn(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},r})(),Qn=(function(){function r(n,a){var o=Kn(a);Yr(this,{target:n,contentRect:o})}return r})(),eo=(function(){function r(n,a,o){if(this.activeObservations_=[],this.observations_=new Gr,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n,this.controller_=a,this.callbackCtx_=o}return r.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof Ze(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var a=this.observations_;a.has(n)||(a.set(n,new Zn(n)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof Ze(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var a=this.observations_;a.has(n)&&(a.delete(n),a.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(a){a.isActive()&&n.activeObservations_.push(a)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,a=this.activeObservations_.map(function(o){return new Qn(o.target,o.broadcastRect())});this.callback_.call(n,a,n),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r})(),$r=typeof WeakMap<"u"?new WeakMap:new Gr,Xr=(function(){function r(n){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var a=Gn.getInstance(),o=new eo(n,a,this);$r.set(this,o)}return r})();["observe","unobserve","disconnect"].forEach(function(r){Xr.prototype[r]=function(){var n;return(n=$r.get(this))[r].apply(n,arguments)}});var to=(function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:Xr})();const ro=un(Object.freeze(Object.defineProperty({__proto__:null,default:to},Symbol.toStringTag,{value:"Module"})));var Jr;function no(){if(Jr)return Dt;Jr=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.default=T;var r=x(oe),n=u(Ue()),a=u(ro),o=u(Ct());const h=["measureBeforeMount"];function u(p){return p&&p.__esModule?p:{default:p}}function x(p,l){if(typeof WeakMap=="function")var e=new WeakMap,t=new WeakMap;return(x=function(c,f){if(!f&&c&&c.__esModule)return c;var i,b,j={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return j;if(i=f?t:e){if(i.has(c))return i.get(c);i.set(c,j)}for(const P in c)P!=="default"&&{}.hasOwnProperty.call(c,P)&&((b=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,P))&&(b.get||b.set)?i(j,P,b):j[P]=c[P]);return j})(p,l)}function O(){return O=Object.assign?Object.assign.bind():function(p){for(var l=1;l<arguments.length;l++){var e=arguments[l];for(var t in e)({}).hasOwnProperty.call(e,t)&&(p[t]=e[t])}return p},O.apply(null,arguments)}function y(p,l){if(p==null)return{};var e,t,c=R(p,l);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(p);for(t=0;t<f.length;t++)e=f[t],l.indexOf(e)===-1&&{}.propertyIsEnumerable.call(p,e)&&(c[e]=p[e])}return c}function R(p,l){if(p==null)return{};var e={};for(var t in p)if({}.hasOwnProperty.call(p,t)){if(l.indexOf(t)!==-1)continue;e[t]=p[t]}return e}function C(p,l,e){return(l=E(l))in p?Object.defineProperty(p,l,{value:e,enumerable:!0,configurable:!0,writable:!0}):p[l]=e,p}function E(p){var l=_(p,"string");return typeof l=="symbol"?l:l+""}function _(p,l){if(typeof p!="object"||!p)return p;var e=p[Symbol.toPrimitive];if(e!==void 0){var t=e.call(p,l);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(p)}const A="react-grid-layout";function T(p){var l;return l=class extends r.Component{constructor(){super(...arguments),C(this,"state",{width:1280}),C(this,"elementRef",r.createRef()),C(this,"mounted",!1),C(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new a.default(c=>{if(this.elementRef.current instanceof HTMLElement){const i=c[0].contentRect.width;this.setState({width:i})}});const t=this.elementRef.current;t instanceof HTMLElement&&this.resizeObserver.observe(t)}componentWillUnmount(){this.mounted=!1;const t=this.elementRef.current;t instanceof HTMLElement&&this.resizeObserver.unobserve(t),this.resizeObserver.disconnect()}render(){const t=this.props,{measureBeforeMount:c}=t,f=y(t,h);return c&&!this.mounted?r.createElement("div",{className:(0,o.default)(this.props.className,A),style:this.props.style,ref:this.elementRef}):r.createElement(p,O({innerRef:this.elementRef},f,this.state))}},C(l,"defaultProps",{measureBeforeMount:!1}),C(l,"propTypes",{measureBeforeMount:n.default.bool}),l}return Dt}var Kr;function oo(){return Kr||(Kr=1,(function(r){r.exports=Hr().default,r.exports.utils=Ke(),r.exports.calculateUtils=Ht(),r.exports.Responsive=Ln().default,r.exports.Responsive.utils=qr(),r.exports.WidthProvider=no().default})(Lt)),Lt.exports}var io=oo();const so=cn(io);function Zr(r){const n=[];n.push(1,1,0,1,1,0,1,1);for(let a=0;a<r.length;a++){const h=(r.charCodeAt(a)%103).toString(2).padStart(7,"0");for(const u of h)n.push(u==="1"?1:0)}return n.push(1,1,0,0,0,1,1,0,0,0,1,1),n}const Kt=({value:r,format:n})=>{const a=oe.useMemo(()=>Zr(r),[r,n]);if(!r)return s.jsx("div",{style:{fontSize:11,color:"#999"},children:"请设置条形码值"});const o=2,h=44,u=a.length*o;return s.jsxs("div",{style:{textAlign:"center",overflow:"hidden",maxWidth:"100%"},children:[s.jsx("canvas",{ref:x=>{if(!x)return;const O=x.getContext("2d");O&&(x.width=u,x.height=h,O.clearRect(0,0,u,h),a.forEach((y,R)=>{O.fillStyle=y===1?"#000":"#fff",O.fillRect(R*o,0,o,h)}))},style:{width:"100%",maxWidth:u,height:h}}),s.jsx("div",{style:{fontSize:10,marginTop:1,letterSpacing:1},children:r})]})},ao=so,Qr=oe.memo(({comp:r,selected:n,isPreview:a=!1,dataSources:o=[]})=>{const h={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",outline:a?"none":n?"2px solid #1677ff":"1px dashed #d9d9d9",outlineOffset:-1},u=x=>at(r,x,o);switch(r.type){case"text":return s.jsx("div",{style:{...h,fontSize:r.props.fontSize||14,fontWeight:r.props.fontWeight||"normal",fontStyle:r.props.fontStyle||"normal",textAlign:r.props.textAlign||"left",color:r.props.color||"#000",backgroundColor:r.props.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:u("content")||""});case"image":const x=u("src")||r.props.src;return s.jsx("div",{style:h,children:x?s.jsx("img",{src:x,style:{width:"100%",height:"100%",objectFit:r.props.fit||"contain"},alt:""}):s.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#bbb",fontSize:12},children:"请在属性中设置图片地址"})});case"table":return s.jsx(lo,{comp:r,style:h,dataSources:o});case"barcode":const O=u("value")||r.props.value||"123456";return s.jsx("div",{style:{...h,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:s.jsx(Kt,{value:O,format:r.props.format||"CODE128"})});case"line":return s.jsx("div",{style:{...h,display:"flex",alignItems:"center",border:"none",outline:n?"2px solid #1677ff":"1px dashed transparent"},children:s.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${r.props.thickness||1}px ${r.props.style||"solid"} ${r.props.color||"#000"}`,margin:0}})});default:return s.jsx("div",{style:h,children:r.type})}}),lo=({comp:r,style:n,dataSources:a=[]})=>{const o=r.props.borderWidth||1,h=r.props.borderColor||"#000",u=r.tableColumns||[],x=r.props.tableDataSourceId,O=x?a.find(E=>E.id===x):null,y=O?jt(O):null;if(y&&y.length>0)return s.jsxs("table",{style:{...n,borderCollapse:"collapse",width:"100%",height:"100%"},children:[u.length>0&&s.jsx("thead",{children:s.jsx("tr",{style:{backgroundColor:"#f5f5f5"},children:u.map((E,_)=>s.jsx("th",{style:{border:`${o}px solid ${h}`,padding:4,fontSize:12,fontWeight:"bold",textAlign:"center"},children:E.title},_))})}),s.jsx("tbody",{children:y.map((E,_)=>s.jsx("tr",{children:u.map((A,T)=>s.jsx("td",{style:{border:`${o}px solid ${h}`,padding:4,fontSize:12,textAlign:"center"},children:A.fieldPath?E[A.fieldPath]:""},T))},_))})]});const R=r.props.rows||3,C=Math.max(r.props.cols||3,u.length||3);return s.jsx("table",{style:{...n,borderCollapse:"collapse",width:"100%",height:"100%"},children:s.jsx("tbody",{children:Array.from({length:R}).map((E,_)=>s.jsx("tr",{children:Array.from({length:C}).map((A,T)=>s.jsx("td",{style:{border:`${o}px solid ${h}`,padding:2,fontSize:12,textAlign:"center"},children:" "},T))},_))})})},en=({isPreview:r=!1})=>{const n=fe(e=>e.components),a=fe(e=>e.selectedId),o=fe(e=>e.pageSettings),h=fe(e=>e.selectComponent);fe(e=>e.updateComponent);const u=fe(e=>e.setComponents),x=fe(e=>e.addComponent),O=fe(e=>e.gridSettings),y=fe(e=>e.dataSources),R=oe.useMemo(()=>{const e=bt[o.paperSize];if(!e)return{width:o.customWidth*Ee,height:o.customHeight*Ee};const t=e.width*Ee,c=e.height*Ee;return o.orientation==="landscape"?{width:c,height:t}:{width:t,height:c}},[o]),C=oe.useMemo(()=>({top:o.marginTop*Ee,right:o.marginRight*Ee,bottom:o.marginBottom*Ee,left:o.marginLeft*Ee}),[o]),E=R.width-C.left-C.right,_=R.height-C.top-C.bottom,A=oe.useMemo(()=>n.map(e=>({i:e.id,x:e.x,y:e.y,w:e.w,h:e.h})),[n]),T=oe.useCallback(e=>{const t=n.map((c,f)=>{const i=e[f];return i?{...c,x:i.x,y:i.y,w:i.w,h:i.h}:c});u(t)},[n,u]),p=oe.useCallback((e,t,c)=>{var j,P;const f=c,i=(j=f.dataTransfer)==null?void 0:j.getData("componentType");if(!i)return;const b=(P=c.target.closest(".react-grid-layout"))==null?void 0:P.getBoundingClientRect();if(b){const z=Math.floor((f.clientX-b.left)/(E/O.cols)),N=Math.floor((f.clientY-b.top)/(E/O.cols));x(i,Math.max(0,z),Math.max(0,N))}else x(i)},[x,E,O.cols]),l=oe.useCallback(e=>{h(e===a?null:e)},[h,a]);return s.jsx("div",{style:{flex:1,overflow:"auto",background:"#e8e8e8",display:"flex",justifyContent:"center",padding:"24px 0"},children:s.jsxs("div",{id:"print-paper",style:{width:R.width,height:R.height,background:"#fff",boxShadow:"0 2px 12px rgba(0,0,0,0.15)",position:"relative",flexShrink:0},children:[o.showHeader&&s.jsx("div",{style:{position:"absolute",top:0,left:C.left,right:C.right,height:C.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#999",borderBottom:"1px dashed #ddd",overflow:"hidden"},children:o.headerContent}),o.showFooter&&s.jsxs("div",{style:{position:"absolute",bottom:0,left:C.left,right:C.right,height:C.bottom,display:"flex",alignItems:"center",justifyContent:o.showPageNumber?"space-between":"center",fontSize:12,color:"#999",borderTop:"1px dashed #ddd",overflow:"hidden",padding:"0 8px"},children:[s.jsx("span",{children:o.footerContent}),o.showPageNumber&&s.jsx("span",{children:o.pageNumberFormat.replace("{page}","1")})]}),s.jsx("div",{style:{position:"absolute",top:C.top,left:C.left,width:E,height:_},children:r?s.jsx("div",{style:{width:"100%",height:"100%",position:"relative"},children:n.map(e=>{const t=E/O.cols,c=E/O.cols,f={position:"absolute",left:e.x*t,top:e.y*c,width:e.w*t,height:e.h*c};return s.jsx("div",{style:f,children:s.jsx(Qr,{comp:e,selected:!1,isPreview:!0,dataSources:y})},e.id)})}):s.jsx(ao,{className:"canvas-grid",layout:A,cols:O.cols,rowHeight:E/O.cols,width:E,margin:[0,0],containerPadding:[0,0],onLayoutChange:T,onDrop:p,isDroppable:!0,isResizable:!0,isDraggable:!0,compactType:null,preventCollision:!0,draggableHandle:".grid-item-drag-handle",style:{minHeight:_},children:n.map(e=>s.jsx("div",{className:"grid-item-drag-handle",onClick:()=>l(e.id),style:{cursor:"move"},children:s.jsx(Qr,{comp:e,selected:e.id===a,dataSources:y})},e.id))})})]})})},{Text:Ie,Title:Co}=k.Typography,{TextArea:co}=k.Input,uo=()=>{const r=fe(e=>e.components),n=fe(e=>e.selectedId),a=fe(e=>e.dataSources),o=fe(e=>e.updateComponent),h=fe(e=>e.updateComponentTableColumns),u=oe.useMemo(()=>r.find(e=>e.id===n)||null,[r,n]),[x,O]=oe.useState([]),y=oe.useMemo(()=>[{label:"无(使用静态值)",value:""},...a.map(e=>({label:e.name,value:e.id,type:e.type}))],[a]),R=oe.useCallback((e,t)=>{n&&o(n,{props:{...u==null?void 0:u.props,[e]:t}})},[n,u,o]),C=oe.useCallback((e,t,c,f)=>{if(!n)return;let i=f;t&&c&&(i=f);const b=`${e}Binding`;o(n,{props:{...u==null?void 0:u.props,[e]:i,[b]:{dataSourceId:t,fieldPath:c,staticValue:f}}})},[n,u,o]),E=oe.useCallback(e=>{const t=u==null?void 0:u.props[`${e}Binding`],c=String((u==null?void 0:u.props[e])||"");return t?{field:e,dataSourceId:t.dataSourceId||null,fieldPath:t.fieldPath||"",staticValue:t.staticValue??c}:{field:e,dataSourceId:null,fieldPath:"",staticValue:c}},[u]);if(!u)return s.jsx(k.Card,{title:"属性面板",size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16}},children:s.jsx(k.Empty,{description:"请选择画布中的组件",image:k.Empty.PRESENTED_IMAGE_SIMPLE})});const _=sr[u.type]||u.type,A=s.jsxs(s.Fragment,{children:[s.jsx(Ie,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"位置和大小"}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12},children:"X"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:u.x,onChange:e=>o(n,{x:e??0})})]}),s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12},children:"Y"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:u.y,onChange:e=>o(n,{y:e??0})})]}),s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12},children:"宽度"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:u.w,min:1,onChange:e=>o(n,{w:e??1})})]}),s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12},children:"高度"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:u.h,min:1,onChange:e=>o(n,{h:e??1})})]})]})]}),T=({field:e,label:t,placeholder:c,isTextarea:f=!1})=>{const i=E(e),b=a.find(F=>F.id===i.dataSourceId),j=b?St(b):null,P=j?Object.keys(j):[],[z,N]=oe.useState(i.staticValue);return oe.useEffect(()=>{N(i.staticValue)},[i.staticValue,i.dataSourceId]),s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12,display:"block",marginBottom:4},children:t}),s.jsx("div",{style:{marginBottom:4},children:s.jsx(k.Select,{size:"small",style:{width:"100%"},placeholder:"选择数据源",value:i.dataSourceId||"",onChange:F=>{C(e,F||null,F&&i.fieldPath||"",i.staticValue)},options:y})}),i.dataSourceId&&s.jsx("div",{style:{marginBottom:4},children:s.jsx(k.Select,{size:"small",style:{width:"100%"},placeholder:"选择字段",value:i.fieldPath,onChange:F=>{C(e,i.dataSourceId,F||"",i.staticValue)},options:[{label:"请选择字段",value:""},...P.map(F=>({label:F,value:F}))]})}),i.dataSourceId?s.jsxs("div",{style:{padding:6,background:"#f0f5ff",border:"1px solid #adc6ff",borderRadius:4,fontSize:12},children:[s.jsx(Te.DatabaseOutlined,{style:{marginRight:4,color:"#1890ff"}}),s.jsx("span",{style:{fontWeight:500},children:"数据绑定已启用"}),b&&i.fieldPath&&s.jsxs("span",{style:{marginLeft:8},children:[s.jsx(k.Tag,{color:"blue",children:b.name}),s.jsx(k.Tag,{color:"green",children:i.fieldPath})]})]}):f?s.jsx(co,{rows:3,placeholder:c,value:z,onChange:F=>N(F.target.value),onBlur:()=>{C(e,null,"",z)}}):s.jsx(k.Input,{placeholder:c,value:z,onChange:F=>N(F.target.value),onBlur:()=>{C(e,null,"",z)}})]})},p=()=>{const e=u.tableColumns||[],t=a.filter(V=>V.type==="array"),c=u.props.tableDataSourceId||"",f=t.find(V=>V.id===c),i=x.length>0?x:e,[b,j]=oe.useState({}),P=()=>{h(n,i)},z=()=>{const V=[...i,{title:`列${i.length+1}`}];O(V)},N=V=>{const X=i.filter((J,ne)=>ne!==V);O(X)},F=(V,X,J)=>{const ne=[...i];ne[V]={...ne[V],[X]:J},O(ne)};let Z=[];if(f){const V=st(f.data);Array.isArray(V)&&V.length>0&&typeof V[0]=="object"&&(Z=Object.keys(V[0]))}const K=[{title:"列标题",dataIndex:"title",width:100,render:(V,X)=>{const J=X.key in b?b[X.key]:X.title;return s.jsx(k.Input,{size:"small",value:J,placeholder:"列标题",onChange:ne=>{j({...b,[X.key]:ne.target.value})},onBlur:()=>{if(X.key in b){F(Number(X.key),"title",b[X.key]);const ne={...b};delete ne[X.key],j(ne),P()}}})}},{title:"绑定字段",dataIndex:"fieldPath",width:120,render:(V,X)=>s.jsx(k.Select,{size:"small",style:{width:"100%"},value:X.fieldPath||"",placeholder:f?"绑定字段":"选择数据源先",disabled:!f,onChange:J=>{F(Number(X.key),"fieldPath",J||""),P()},options:[{label:"无绑定",value:""},...Z.map(J=>({label:J,value:J}))]})},{title:"操作",width:60,render:(V,X)=>s.jsx(k.Popconfirm,{title:"确定要删除吗?",onConfirm:()=>{N(Number(X.key)),P()},okText:"确定",cancelText:"取消",children:s.jsx(k.Button,{type:"text",danger:!0,size:"small",icon:s.jsx(Te.DeleteOutlined,{})})})}],Q=i.map((V,X)=>({...V,key:String(X)}));return s.jsxs("div",{children:[s.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:s.jsx(Ie,{style:{fontSize:12},children:"表格数据源"})}),s.jsx(k.Select,{size:"small",style:{width:"100%",marginBottom:8},placeholder:"选择数组类型数据源",value:c,onChange:V=>R("tableDataSourceId",V||""),options:[{label:"无(仅静态展示)",value:""},...t.map(V=>({label:V.name,value:V.id}))]}),s.jsx(k.Divider,{}),s.jsxs(k.Space,{style:{marginBottom:8},children:[s.jsx(Ie,{style:{fontSize:12},children:"列配置"}),s.jsx(k.Button,{size:"small",type:"dashed",icon:s.jsx(Te.PlusOutlined,{}),onClick:z}),s.jsx(k.Button,{size:"small",type:"primary",onClick:P,icon:s.jsx(Te.SaveOutlined,{})})]}),s.jsx(k.Table,{dataSource:Q,columns:K,pagination:!1,size:"small",bordered:!0,rowKey:"key"})]})},l=()=>{switch(u.type){case"text":return s.jsxs(s.Fragment,{children:[s.jsx(T,{field:"content",label:"内容",placeholder:"请输入文本内容",isTextarea:!0}),s.jsx(k.Divider,{style:{margin:"4px 0"}}),s.jsx(Ie,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"文字样式"}),s.jsxs(k.Space,{style:{width:"100%"},direction:"vertical",size:4,children:[s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsxs("div",{style:{flex:1},children:[s.jsx(Ie,{style:{fontSize:12},children:"字号"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:u.props.fontSize||14,min:6,max:200,onChange:e=>R("fontSize",e??14)})]}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Ie,{style:{fontSize:12},children:"对齐"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:u.props.textAlign||"left",onChange:e=>R("textAlign",e),options:[{value:"left",label:"左"},{value:"center",label:"中"},{value:"right",label:"右"}]})]})]}),s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsxs("div",{style:{flex:1},children:[s.jsx(Ie,{style:{fontSize:12},children:"字重"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:u.props.fontWeight||"normal",onChange:e=>R("fontWeight",e),options:[{value:"normal",label:"常规"},{value:"bold",label:"加粗"}]})]}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Ie,{style:{fontSize:12},children:"样式"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:u.props.fontStyle||"normal",onChange:e=>R("fontStyle",e),options:[{value:"normal",label:"常规"},{value:"italic",label:"斜体"}]})]})]}),s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12},children:"字体颜色"}),s.jsx(k.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(e,t)=>R("color",t)})]}),s.jsxs("div",{children:[s.jsx(Ie,{style:{fontSize:12},children:"背景色"}),s.jsx(k.ColorPicker,{size:"small",value:u.props.backgroundColor||"transparent",onChange:(e,t)=>R("backgroundColor",t)})]})]})]})]});case"image":return s.jsxs(s.Fragment,{children:[s.jsx(T,{field:"src",label:"图片地址",placeholder:"输入图片 URL"}),s.jsx(k.Divider,{style:{margin:"4px 0"}}),s.jsx(Ie,{style:{fontSize:12,marginTop:8,display:"block"},children:"适应方式"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:u.props.fit||"contain",onChange:e=>R("fit",e),options:[{value:"contain",label:"适应"},{value:"cover",label:"填充"},{value:"fill",label:"拉伸"}]})]});case"table":return s.jsx(p,{});case"barcode":return s.jsxs(s.Fragment,{children:[s.jsx(T,{field:"value",label:"条码值",placeholder:"输入条码内容"}),s.jsx(k.Divider,{style:{margin:"4px 0"}}),s.jsx(Ie,{style:{fontSize:12,marginTop:8,display:"block"},children:"格式"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:u.props.format||"CODE128",onChange:e=>R("format",e),options:[{value:"CODE128",label:"CODE128"}]})]});case"line":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsxs("div",{style:{flex:1},children:[s.jsx(Ie,{style:{fontSize:12},children:"粗细"}),s.jsx(k.InputNumber,{size:"small",style:{width:"100%"},value:u.props.thickness||1,min:1,max:20,onChange:e=>R("thickness",e??1)})]}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Ie,{style:{fontSize:12},children:"样式"}),s.jsx(k.Select,{size:"small",style:{width:"100%"},value:u.props.style||"solid",onChange:e=>R("style",e),options:[{value:"solid",label:"实线"},{value:"dashed",label:"虚线"},{value:"dotted",label:"点线"}]})]})]}),s.jsxs("div",{style:{marginTop:8},children:[s.jsx(Ie,{style:{fontSize:12},children:"颜色"}),s.jsx(k.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(e,t)=>R("color",t)})]})]});default:return null}};return s.jsx(k.Card,{title:`属性 - ${_}`,size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16,overflowY:"auto"}},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[A,s.jsx(k.Divider,{style:{margin:"4px 0"}}),l()]})})},{Text:_o}=k.Typography,fo=()=>{const r=fe(p=>p.previewVisible),n=fe(p=>p.setPreviewVisible),a=fe(p=>p.components),o=fe(p=>p.pageSettings),h=fe(p=>p.gridSettings)||xt,u=fe(p=>p.dataSources),x=oe.useRef(null),O=oe.useMemo(()=>{const p=bt[o.paperSize];if(!p)return{width:o.customWidth*Ee,height:o.customHeight*Ee};const l=p.width*Ee,e=p.height*Ee;return o.orientation==="landscape"?{width:e,height:l}:{width:l,height:e}},[o]),y=oe.useMemo(()=>({top:o.marginTop*Ee,right:o.marginRight*Ee,bottom:o.marginBottom*Ee,left:o.marginLeft*Ee}),[o]),R=O.width-y.left-y.right,C=R/h.cols,E=tr.useReactToPrint({contentRef:x,documentTitle:"打印模板",pageStyle:`
31
52
  @page {
32
- size: ${m.width/A}mm ${m.height/A}mm;
33
- margin: ${n.marginTop}mm ${n.marginRight}mm ${n.marginBottom}mm ${n.marginLeft}mm;
53
+ size: ${O.width/Ee}mm ${O.height/Ee}mm;
54
+ margin: ${o.marginTop}mm ${o.marginRight}mm ${o.marginBottom}mm ${o.marginLeft}mm;
34
55
  }
35
56
  @media print {
36
57
  html, body { margin: 0; padding: 0; }
37
58
  }
38
- `}),g=(y,O)=>{const r=y.props[`${O}Binding`];if(r&&r.dataSourceId&&r.fieldPath){const f=i.find(x=>x.id===r.dataSourceId);if(f&&f.type==="object"){const x=ge(f);if(x){const _=pe(x,r.fieldPath);if(_!=="")return _}}}return(r==null?void 0:r.staticValue)??String(y.props[O]||"")},z=y=>{const O=y.props.tableDataSourceId,r=O?i.find(F=>F.id===O):null,f=r?me(r):null,x=y.tableColumns||[],_=y.props.borderWidth||1,h=y.props.borderColor||"#000000",S=f||Array.from({length:y.props.rows||3}).map(()=>({}));return e.jsxs("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{children:x.map((F,V)=>e.jsx("th",{style:{border:`${_}px solid ${h}`,padding:4,textAlign:"center",fontSize:12,fontWeight:"bold",backgroundColor:"#f5f5f5"},children:F.title||`列${V+1}`},V))})}),e.jsx("tbody",{children:S.map((F,V)=>e.jsx("tr",{children:x.map((H,q)=>e.jsx("td",{style:{border:`${_}px solid ${h}`,padding:4,textAlign:"center",fontSize:12},children:H.fieldPath?pe(F,H.fieldPath):""},q))},V))})]})},N=y=>{const O=y.props,r={position:"absolute",left:y.x*b,top:y.y*b,width:y.w*b,height:y.h*b,overflow:"hidden"},f={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box"};switch(y.type){case"text":return e.jsx("div",{style:r,children:e.jsx("div",{style:{...f,fontSize:O.fontSize||14,fontWeight:O.fontWeight||"normal",fontStyle:O.fontStyle||"normal",textAlign:O.textAlign||"left",color:O.color||"#000",backgroundColor:O.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:g(y,"content")})},y.id);case"image":return e.jsx("div",{style:r,children:e.jsx("div",{style:f,children:O.src?e.jsx("img",{src:g(y,"src"),style:{width:"100%",height:"100%",objectFit:O.fit||"contain"},alt:""}):null})},y.id);case"table":return e.jsx("div",{style:r,children:z(y)},y.id);case"barcode":return e.jsx("div",{style:r,children:e.jsx("div",{style:{...f,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(we,{value:g(y,"value"),format:O.format||"CODE128"})})},y.id);case"line":return e.jsx("div",{style:r,children:e.jsx("div",{style:{...f,display:"flex",alignItems:"center",border:"none"},children:e.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${O.thickness||1}px ${O.style||"solid"} ${O.color||"#000"}`,margin:0}})})},y.id);default:return null}};return e.jsxs(o.Modal,{title:"打印预览",open:s,onCancel:()=>d(!1),width:m.width+80,footer:e.jsxs(o.Space,{children:[e.jsx(o.Button,{onClick:()=>d(!1),children:"关闭"}),e.jsx(o.Button,{type:"primary",icon:e.jsx(B.PrinterOutlined,{}),onClick:()=>P(),children:"打印"})]}),styles:{body:{padding:16,display:"flex",flexDirection:"column",alignItems:"center"}},children:[e.jsx(o.Divider,{style:{margin:"4px 0 12px 0"}}),e.jsxs("div",{ref:v,style:{width:m.width,height:m.height,background:"#fff",border:"1px solid #d9d9d9",position:"relative",overflow:"hidden",flexShrink:0},children:[n.showHeader&&e.jsx("div",{style:{position:"absolute",top:0,left:u.left,right:u.right,height:u.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,overflow:"hidden"},children:n.headerContent}),n.showFooter&&e.jsxs("div",{style:{position:"absolute",bottom:0,left:u.left,right:u.right,height:u.bottom,display:"flex",alignItems:"center",justifyContent:n.showPageNumber?"space-between":"center",fontSize:12,overflow:"hidden",padding:"0 8px"},children:[e.jsx("span",{children:n.footerContent}),n.showPageNumber&&e.jsx("span",{children:n.pageNumberFormat.replace("{page}","1")})]}),e.jsx("div",{style:{position:"absolute",top:u.top,left:u.left,width:j,height:m.height-u.top-u.bottom},children:a.map(N)})]})]})},Dt=()=>{const s=T(l=>l.headerFooterVisible),d=T(l=>l.pageSettings),a=T(l=>l.setPageSettings),n=T(l=>l.setHeaderFooterVisible);return e.jsx(o.Modal,{title:"页眉页脚设置",open:s,onCancel:()=>n(!1),onOk:()=>n(!1),width:480,children:e.jsxs(o.Form,{layout:"vertical",style:{marginTop:8},children:[e.jsx(o.Form.Item,{label:"显示页眉",children:e.jsx(o.Switch,{checked:d.showHeader,onChange:l=>a({showHeader:l})})}),d.showHeader&&e.jsx(o.Form.Item,{label:"页眉内容",children:e.jsx(o.Input,{value:d.headerContent,onChange:l=>a({headerContent:l.target.value})})}),e.jsx(o.Form.Item,{label:"显示页脚",children:e.jsx(o.Switch,{checked:d.showFooter,onChange:l=>a({showFooter:l})})}),d.showFooter&&e.jsxs(e.Fragment,{children:[e.jsx(o.Form.Item,{label:"页脚内容",children:e.jsx(o.Input,{value:d.footerContent,onChange:l=>a({footerContent:l.target.value})})}),e.jsx(o.Form.Item,{label:"显示页码",children:e.jsx(o.Switch,{checked:d.showPageNumber,onChange:l=>a({showPageNumber:l})})}),d.showPageNumber&&e.jsx(o.Form.Item,{label:"页码格式",children:e.jsx(o.Input,{value:d.pageNumberFormat,onChange:l=>a({pageNumberFormat:l.target.value}),placeholder:"第 {page} 页"})})]})]})})},Ye=({isPreview:s=!1,initialTemplateData:d,onSave:a,onPrint:n})=>{const{importJSON:l,exportJSON:i,reset:v,components:m,pageSettings:u,gridSettings:j,dataSources:b}=T(),P=w.useRef(null);w.useEffect(()=>{if(d){const h=JSON.stringify(d),S=l(h);S&&(console.error("导入失败:",S),v())}},[d,l,v]);const g=()=>{if(a)try{const h=i();a(JSON.parse(h))}catch(h){console.error("导出失败:",h)}},z=w.useMemo(()=>{const h=he[u.paperSize];if(!h)return{width:u.customWidth*A,height:u.customHeight*A};const S=h.width*A,F=h.height*A;return u.orientation==="landscape"?{width:F,height:S}:{width:S,height:F}},[u]),N=w.useMemo(()=>({top:u.marginTop*A,right:u.marginRight*A,bottom:u.marginBottom*A,left:u.marginLeft*A}),[u]),y=z.width-N.left-N.right,O=y/((j==null?void 0:j.cols)||fe.cols),r=De.useReactToPrint({contentRef:P,documentTitle:"打印模板",pageStyle:`
59
+ `}),_=(p,l)=>{const e=p.props[`${l}Binding`];if(e&&e.dataSourceId&&e.fieldPath){const t=u.find(c=>c.id===e.dataSourceId);if(t&&t.type==="object"){const c=St(t);if(c){const f=wt(c,e.fieldPath);if(f!=="")return f}}}return(e==null?void 0:e.staticValue)??String(p.props[l]||"")},A=p=>{const l=p.props.tableDataSourceId,e=l?u.find(j=>j.id===l):null,t=e?jt(e):null,c=p.tableColumns||[],f=p.props.borderWidth||1,i=p.props.borderColor||"#000000",b=t||Array.from({length:p.props.rows||3}).map(()=>({}));return s.jsxs("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:[s.jsx("thead",{children:s.jsx("tr",{children:c.map((j,P)=>s.jsx("th",{style:{border:`${f}px solid ${i}`,padding:4,textAlign:"center",fontSize:12,fontWeight:"bold",backgroundColor:"#f5f5f5"},children:j.title||`列${P+1}`},P))})}),s.jsx("tbody",{children:b.map((j,P)=>s.jsx("tr",{children:c.map((z,N)=>s.jsx("td",{style:{border:`${f}px solid ${i}`,padding:4,textAlign:"center",fontSize:12},children:z.fieldPath?wt(j,z.fieldPath):""},N))},P))})]})},T=p=>{const l=p.props,e={position:"absolute",left:p.x*C,top:p.y*C,width:p.w*C,height:p.h*C,overflow:"hidden"},t={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box"};switch(p.type){case"text":return s.jsx("div",{style:e,children:s.jsx("div",{style:{...t,fontSize:l.fontSize||14,fontWeight:l.fontWeight||"normal",fontStyle:l.fontStyle||"normal",textAlign:l.textAlign||"left",color:l.color||"#000",backgroundColor:l.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:_(p,"content")})},p.id);case"image":return s.jsx("div",{style:e,children:s.jsx("div",{style:t,children:l.src?s.jsx("img",{src:_(p,"src"),style:{width:"100%",height:"100%",objectFit:l.fit||"contain"},alt:""}):null})},p.id);case"table":return s.jsx("div",{style:e,children:A(p)},p.id);case"barcode":return s.jsx("div",{style:e,children:s.jsx("div",{style:{...t,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:s.jsx(Kt,{value:_(p,"value"),format:l.format||"CODE128"})})},p.id);case"line":return s.jsx("div",{style:e,children:s.jsx("div",{style:{...t,display:"flex",alignItems:"center",border:"none"},children:s.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${l.thickness||1}px ${l.style||"solid"} ${l.color||"#000"}`,margin:0}})})},p.id);default:return null}};return s.jsxs(k.Modal,{title:"打印预览",open:r,onCancel:()=>n(!1),width:O.width+80,footer:s.jsxs(k.Space,{children:[s.jsx(k.Button,{onClick:()=>n(!1),children:"关闭"}),s.jsx(k.Button,{type:"primary",icon:s.jsx(Te.PrinterOutlined,{}),onClick:()=>E(),children:"打印"})]}),styles:{body:{padding:16,display:"flex",flexDirection:"column",alignItems:"center"}},children:[s.jsx(k.Divider,{style:{margin:"4px 0 12px 0"}}),s.jsxs("div",{ref:x,style:{width:O.width,height:O.height,background:"#fff",border:"1px solid #d9d9d9",position:"relative",overflow:"hidden",flexShrink:0},children:[o.showHeader&&s.jsx("div",{style:{position:"absolute",top:0,left:y.left,right:y.right,height:y.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,overflow:"hidden"},children:o.headerContent}),o.showFooter&&s.jsxs("div",{style:{position:"absolute",bottom:0,left:y.left,right:y.right,height:y.bottom,display:"flex",alignItems:"center",justifyContent:o.showPageNumber?"space-between":"center",fontSize:12,overflow:"hidden",padding:"0 8px"},children:[s.jsx("span",{children:o.footerContent}),o.showPageNumber&&s.jsx("span",{children:o.pageNumberFormat.replace("{page}","1")})]}),s.jsx("div",{style:{position:"absolute",top:y.top,left:y.left,width:R,height:O.height-y.top-y.bottom},children:a.map(T)})]})]})},po=()=>{const r=fe(h=>h.headerFooterVisible),n=fe(h=>h.pageSettings),a=fe(h=>h.setPageSettings),o=fe(h=>h.setHeaderFooterVisible);return s.jsx(k.Modal,{title:"页眉页脚设置",open:r,onCancel:()=>o(!1),onOk:()=>o(!1),width:480,children:s.jsxs(k.Form,{layout:"vertical",style:{marginTop:8},children:[s.jsx(k.Form.Item,{label:"显示页眉",children:s.jsx(k.Switch,{checked:n.showHeader,onChange:h=>a({showHeader:h})})}),n.showHeader&&s.jsx(k.Form.Item,{label:"页眉内容",children:s.jsx(k.Input,{value:n.headerContent,onChange:h=>a({headerContent:h.target.value})})}),s.jsx(k.Form.Item,{label:"显示页脚",children:s.jsx(k.Switch,{checked:n.showFooter,onChange:h=>a({showFooter:h})})}),n.showFooter&&s.jsxs(s.Fragment,{children:[s.jsx(k.Form.Item,{label:"页脚内容",children:s.jsx(k.Input,{value:n.footerContent,onChange:h=>a({footerContent:h.target.value})})}),s.jsx(k.Form.Item,{label:"显示页码",children:s.jsx(k.Switch,{checked:n.showPageNumber,onChange:h=>a({showPageNumber:h})})}),n.showPageNumber&&s.jsx(k.Form.Item,{label:"页码格式",children:s.jsx(k.Input,{value:n.pageNumberFormat,onChange:h=>a({pageNumberFormat:h.target.value}),placeholder:"第 {page} 页"})})]})]})})},tn=({isPreview:r=!1,initialTemplateData:n,onSave:a,onPrint:o})=>{const{importJSON:h,exportJSON:u,reset:x,components:O,pageSettings:y,gridSettings:R,dataSources:C}=fe(),E=oe.useRef(null);oe.useEffect(()=>{if(n){const i=JSON.stringify(n),b=h(i);b&&(console.error("导入失败:",b),x())}},[n,h,x]);const _=()=>{if(a)try{const i=u();a(JSON.parse(i))}catch(i){console.error("导出失败:",i)}},A=oe.useMemo(()=>{const i=bt[y.paperSize];if(!i)return{width:y.customWidth*Ee,height:y.customHeight*Ee};const b=i.width*Ee,j=i.height*Ee;return y.orientation==="landscape"?{width:j,height:b}:{width:b,height:j}},[y]),T=oe.useMemo(()=>({top:y.marginTop*Ee,right:y.marginRight*Ee,bottom:y.marginBottom*Ee,left:y.marginLeft*Ee}),[y]),p=A.width-T.left-T.right,l=p/((R==null?void 0:R.cols)||xt.cols),e=tr.useReactToPrint({contentRef:E,documentTitle:"打印模板",pageStyle:`
39
60
  @page {
40
- size: ${z.width/A}mm ${z.height/A}mm;
41
- margin: ${u.marginTop}mm ${u.marginRight}mm ${u.marginBottom}mm ${u.marginLeft}mm;
61
+ size: ${A.width/Ee}mm ${A.height/Ee}mm;
62
+ margin: ${y.marginTop}mm ${y.marginRight}mm ${y.marginBottom}mm ${y.marginLeft}mm;
42
63
  }
43
64
  @media print {
44
65
  html, body { margin: 0; padding: 0; }
45
66
  }
46
- `}),f=()=>{n?n():r()},x=h=>{const S=h.props,F={position:"absolute",left:h.x*O,top:h.y*O,width:h.w*O,height:h.h*O,overflow:"hidden"},V={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box"};switch(h.type){case"text":return e.jsx("div",{style:F,children:e.jsx("div",{style:{...V,fontSize:S.fontSize||14,fontWeight:S.fontWeight||"normal",fontStyle:S.fontStyle||"normal",textAlign:S.textAlign||"left",color:S.color||"#000",backgroundColor:S.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:ce(h,"content",b)})},h.id);case"image":return e.jsx("div",{style:F,children:e.jsx("div",{style:V,children:S.src?e.jsx("img",{src:ce(h,"src",b),style:{width:"100%",height:"100%",objectFit:S.fit||"contain"},alt:""}):null})},h.id);case"table":return e.jsx("div",{style:F,children:_(h)},h.id);case"barcode":return e.jsx("div",{style:F,children:e.jsx("div",{style:{...V,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(we,{value:ce(h,"value",b),format:S.format||"CODE128"})})},h.id);case"line":return e.jsx("div",{style:F,children:e.jsx("div",{style:{...V,display:"flex",alignItems:"center",border:"none"},children:e.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${S.thickness||1}px ${S.style||"solid"} ${S.color||"#000"}`,margin:0}})})},h.id);default:return null}},_=h=>{const S=h.props.tableDataSourceId,F=S?b.find(U=>U.id===S):null,V=F?me(F):null,H=h.tableColumns||[],q=h.props.borderWidth||1,W=h.props.borderColor||"#000000";if(V&&V.length>0)return e.jsxs("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:[H.length>0&&e.jsx("thead",{children:e.jsx("tr",{style:{backgroundColor:"#f5f5f5"},children:H.map((U,k)=>e.jsx("th",{style:{border:`${q}px solid ${W}`,padding:4,fontSize:12,fontWeight:"bold",textAlign:"center"},children:U.title},k))})}),e.jsx("tbody",{children:V.map((U,k)=>e.jsx("tr",{children:H.map((R,G)=>e.jsx("td",{style:{border:`${q}px solid ${W}`,padding:4,fontSize:12,textAlign:"center"},children:R.fieldPath?U[R.fieldPath]:""},G))},k))})]});const re=h.props.rows||3,ne=Math.max(h.props.cols||3,H.length||3);return e.jsx("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:e.jsx("tbody",{children:Array.from({length:re}).map((U,k)=>e.jsx("tr",{children:Array.from({length:ne}).map((R,G)=>e.jsx("td",{style:{border:`${q}px solid ${W}`,padding:2,fontSize:12,textAlign:"center"},children:" "},G))},k))})})};return s?e.jsx(o.App,{children:e.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:e.jsx(o.Space,{children:e.jsx(o.Button,{type:"primary",icon:e.jsx(B.PrinterOutlined,{}),onClick:f,children:"打印"})})}),e.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"16px",boxSizing:"border-box",overflowY:"auto",background:"#e8e8e8"},children:e.jsx("div",{style:{flexShrink:0},children:e.jsx(Je,{isPreview:!0})})}),e.jsx("div",{style:{position:"absolute",left:"-9999px",top:"-9999px"},children:e.jsxs("div",{ref:P,style:{width:z.width,height:z.height,background:"#fff",position:"relative",overflow:"hidden"},children:[u.showHeader&&e.jsx("div",{style:{position:"absolute",top:0,left:N.left,right:N.right,height:N.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,overflow:"hidden"},children:u.headerContent}),u.showFooter&&e.jsxs("div",{style:{position:"absolute",bottom:0,left:N.left,right:N.right,height:N.bottom,display:"flex",alignItems:"center",justifyContent:u.showPageNumber?"space-between":"center",fontSize:12,overflow:"hidden",padding:"0 8px"},children:[e.jsx("span",{children:u.footerContent}),u.showPageNumber&&e.jsx("span",{children:u.pageNumberFormat.replace("{page}","1")})]}),e.jsx("div",{style:{position:"absolute",top:N.top,left:N.left,width:y,height:z.height-N.top-N.bottom},children:m.map(x)})]})})]})}):e.jsx(o.App,{children:e.jsxs("div",{className:"app-container",children:[e.jsx(vt,{onCustomSave:a?g:void 0,onCustomPrint:n}),e.jsxs("div",{className:"app-body",children:[e.jsx("div",{className:"app-left-panel",children:e.jsx(Pt,{})}),e.jsx(Je,{}),e.jsx("div",{className:"app-right-panel",children:e.jsx(It,{})})]}),e.jsx(zt,{}),e.jsx(Dt,{})]})})};Y.PrintDesigner=Ye,Y.default=Ye,Y.getArrayFromDataSource=me,Y.getObjectFromDataSource=ge,Y.getRenderValue=ce,Y.getValueByPath=pe,Y.safeParseJSON=ae,Y.useDesignerStore=T,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
67
+ `}),t=()=>{o?o():e()},c=i=>{const b=i.props,j={position:"absolute",left:i.x*l,top:i.y*l,width:i.w*l,height:i.h*l,overflow:"hidden"},P={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box"};switch(i.type){case"text":return s.jsx("div",{style:j,children:s.jsx("div",{style:{...P,fontSize:b.fontSize||14,fontWeight:b.fontWeight||"normal",fontStyle:b.fontStyle||"normal",textAlign:b.textAlign||"left",color:b.color||"#000",backgroundColor:b.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:at(i,"content",C)})},i.id);case"image":return s.jsx("div",{style:j,children:s.jsx("div",{style:P,children:b.src?s.jsx("img",{src:at(i,"src",C),style:{width:"100%",height:"100%",objectFit:b.fit||"contain"},alt:""}):null})},i.id);case"table":return s.jsx("div",{style:j,children:f(i)},i.id);case"barcode":return s.jsx("div",{style:j,children:s.jsx("div",{style:{...P,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:s.jsx(Kt,{value:at(i,"value",C),format:b.format||"CODE128"})})},i.id);case"line":return s.jsx("div",{style:j,children:s.jsx("div",{style:{...P,display:"flex",alignItems:"center",border:"none"},children:s.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${b.thickness||1}px ${b.style||"solid"} ${b.color||"#000"}`,margin:0}})})},i.id);default:return null}},f=i=>{const b=i.props.tableDataSourceId,j=b?C.find(Q=>Q.id===b):null,P=j?jt(j):null,z=i.tableColumns||[],N=i.props.borderWidth||1,F=i.props.borderColor||"#000000";if(P&&P.length>0)return s.jsxs("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:[z.length>0&&s.jsx("thead",{children:s.jsx("tr",{style:{backgroundColor:"#f5f5f5"},children:z.map((Q,V)=>s.jsx("th",{style:{border:`${N}px solid ${F}`,padding:4,fontSize:12,fontWeight:"bold",textAlign:"center"},children:Q.title},V))})}),s.jsx("tbody",{children:P.map((Q,V)=>s.jsx("tr",{children:z.map((X,J)=>s.jsx("td",{style:{border:`${N}px solid ${F}`,padding:4,fontSize:12,textAlign:"center"},children:X.fieldPath?Q[X.fieldPath]:""},J))},V))})]});const Z=i.props.rows||3,K=Math.max(i.props.cols||3,z.length||3);return s.jsx("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:s.jsx("tbody",{children:Array.from({length:Z}).map((Q,V)=>s.jsx("tr",{children:Array.from({length:K}).map((X,J)=>s.jsx("td",{style:{border:`${N}px solid ${F}`,padding:2,fontSize:12,textAlign:"center"},children:" "},J))},V))})})};return r?s.jsx(k.App,{children:s.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[s.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:s.jsx(k.Space,{children:s.jsx(k.Button,{type:"primary",icon:s.jsx(Te.PrinterOutlined,{}),onClick:t,children:"打印"})})}),s.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"16px",boxSizing:"border-box",overflowY:"auto",background:"#e8e8e8"},children:s.jsx("div",{style:{flexShrink:0},children:s.jsx(en,{isPreview:!0})})}),s.jsx("div",{style:{position:"absolute",left:"-9999px",top:"-9999px"},children:s.jsxs("div",{ref:E,style:{width:A.width,height:A.height,background:"#fff",position:"relative",overflow:"hidden"},children:[y.showHeader&&s.jsx("div",{style:{position:"absolute",top:0,left:T.left,right:T.right,height:T.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,overflow:"hidden"},children:y.headerContent}),y.showFooter&&s.jsxs("div",{style:{position:"absolute",bottom:0,left:T.left,right:T.right,height:T.bottom,display:"flex",alignItems:"center",justifyContent:y.showPageNumber?"space-between":"center",fontSize:12,overflow:"hidden",padding:"0 8px"},children:[s.jsx("span",{children:y.footerContent}),y.showPageNumber&&s.jsx("span",{children:y.pageNumberFormat.replace("{page}","1")})]}),s.jsx("div",{style:{position:"absolute",top:T.top,left:T.left,width:p,height:A.height-T.top-T.bottom},children:O.map(c)})]})})]})}):s.jsx(k.App,{children:s.jsxs("div",{className:"app-container",children:[s.jsx(gn,{onCustomSave:a?_:void 0,onCustomPrint:o}),s.jsxs("div",{className:"app-body",children:[s.jsx("div",{className:"app-left-panel",children:s.jsx(jn,{})}),s.jsx(en,{}),s.jsx("div",{className:"app-right-panel",children:s.jsx(uo,{})})]}),s.jsx(fo,{}),s.jsx(po,{})]})})};Ne.PrintDesigner=tn,Ne.default=tn,Ne.getArrayFromDataSource=jt,Ne.getObjectFromDataSource=St,Ne.getRenderValue=at,Ne.getValueByPath=wt,Ne.safeParseJSON=st,Ne.useDesignerStore=fe,Object.defineProperties(Ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));