@ws-ui/shared 1.13.3 → 1.13.5

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 +1 @@
1
- export declare const useOutsideClick: <T extends HTMLElement, R = void>(callback: (event: MouseEvent) => R) => import('react').MutableRefObject<T | null>;
1
+ export declare const useOutsideClick: <T extends HTMLElement, R = void>(callback: (event: MouseEvent) => R, event?: "click" | "mousedown") => import('react').MutableRefObject<T | null>;
package/dist/index.cjs.js CHANGED
@@ -198,7 +198,7 @@ __p += '`),Ce&&(ee+=`' +
198
198
  function print() { __p += __j.call(arguments, '') }
199
199
  `:`;
200
200
  `)+ee+`return __p
201
- }`;var Oe=gh(function(){return $e(T,le+"return "+ee).apply(r,P)});if(Oe.source=ee,ll(Oe))throw Oe;return Oe}function G_(n){return Me(n).toLowerCase()}function K_(n){return Me(n).toUpperCase()}function V_(n,o,l){if(n=Me(n),n&&(l||o===r))return Ed(n);if(!n||!(o=zt(o)))return n;var b=ur(n),_=ur(o),T=_d(b,_),P=Od(b,_)+1;return fn(b,T,P).join("")}function X_(n,o,l){if(n=Me(n),n&&(l||o===r))return n.slice(0,Td(n)+1);if(!n||!(o=zt(o)))return n;var b=ur(n),_=Od(b,ur(o))+1;return fn(b,0,_).join("")}function Y_(n,o,l){if(n=Me(n),n&&(l||o===r))return n.replace(lu,"");if(!n||!(o=zt(o)))return n;var b=ur(n),_=_d(b,ur(o));return fn(b,_).join("")}function J_(n,o){var l=N,b=L;if(Ve(o)){var _="separator"in o?o.separator:_;l="length"in o?Ee(o.length):l,b="omission"in o?zt(o.omission):b}n=Me(n);var T=n.length;if(ei(n)){var P=ur(n);T=P.length}if(l>=T)return n;var I=l-ti(b);if(I<1)return b;var z=P?fn(P,0,I).join(""):n.slice(0,I);if(_===r)return z+b;if(P&&(I+=z.length-I),cl(_)){if(n.slice(I).search(_)){var V,X=z;for(_.global||(_=Au(_.source,Me(qf.exec(_))+"g")),_.lastIndex=0;V=_.exec(X);)var ee=V.index;z=z.slice(0,ee===r?I:ee)}}else if(n.indexOf(zt(_),I)!=I){var se=z.lastIndexOf(_);se>-1&&(z=z.slice(0,se))}return z+b}function Q_(n){return n=Me(n),n&&db.test(n)?n.replace(Wf,Pw):n}var eO=ui(function(n,o,l){return n+(l?" ":"")+o.toUpperCase()}),hl=gp("toUpperCase");function hh(n,o,l){return n=Me(n),o=l?r:o,o===r?_w(n)?$w(n):gw(n):n.match(o)||[]}var gh=Te(function(n,o){try{return Dt(n,r,o)}catch(l){return ll(l)?l:new be(l)}}),tO=Wr(function(n,o){return Nt(o,function(l){l=cr(l),br(n,l,al(n[l],n))}),n});function rO(n){var o=n==null?0:n.length,l=ge();return n=o?Ze(n,function(b){if(typeof b[1]!="function")throw new Yt(u);return[l(b[0]),b[1]]}):[],Te(function(b){for(var _=-1;++_<o;){var T=n[_];if(Dt(T[0],this,b))return Dt(T[1],this,b)}})}function nO(n){return P1(Qt(n,g))}function gl(n){return function(){return n}}function iO(n,o){return n==null||n!==n?o:n}var oO=vp(),sO=vp(!0);function It(n){return n}function ml(n){return Gd(typeof n=="function"?n:Qt(n,g))}function aO(n){return Vd(Qt(n,g))}function uO(n,o){return Xd(n,Qt(o,g))}var lO=Te(function(n,o){return function(l){return ji(l,n,o)}}),cO=Te(function(n,o){return function(l){return ji(n,l,o)}});function vl(n,o,l){var b=ft(o),_=xs(o,b);l==null&&!(Ve(o)&&(_.length||!b.length))&&(l=o,o=n,n=this,_=xs(o,ft(o)));var T=!(Ve(l)&&"chain"in l)||!!l.chain,P=Br(n);return Nt(_,function(I){var z=o[I];n[I]=z,P&&(n.prototype[I]=function(){var V=this.__chain__;if(T||V){var X=n(this.__wrapped__),ee=X.__actions__=Ct(this.__actions__);return ee.push({func:z,args:arguments,thisArg:n}),X.__chain__=V,X}return z.apply(n,on([this.value()],arguments))})}),n}function fO(){return pt._===this&&(pt._=Nw),this}function yl(){}function dO(n){return n=Ee(n),Te(function(o){return Yd(o,n)})}var pO=Ku(Ze),hO=Ku(yd),gO=Ku(bu);function mh(n){return tl(n)?wu(cr(n)):Z1(n)}function mO(n){return function(o){return n==null?r:kn(n,o)}}var vO=bp(),yO=bp(!0);function bl(){return[]}function wl(){return!1}function bO(){return{}}function wO(){return""}function xO(){return!0}function SO(n,o){if(n=Ee(n),n<1||n>ce)return[];var l=ne,b=wt(n,ne);o=ge(o),n-=ne;for(var _=Eu(b,o);++l<n;)o(l);return _}function EO(n){return Se(n)?Ze(n,cr):Wt(n)?[n]:Ct(Mp(Me(n)))}function _O(n){var o=++Fw;return Me(n)+o}var OO=Ts(function(n,o){return n+o},0),AO=Vu("ceil"),TO=Ts(function(n,o){return n/o},1),RO=Vu("floor");function PO(n){return n&&n.length?ws(n,It,Lu):r}function CO(n,o){return n&&n.length?ws(n,ge(o,2),Lu):r}function kO(n){return xd(n,It)}function $O(n,o){return xd(n,ge(o,2))}function IO(n){return n&&n.length?ws(n,It,Nu):r}function LO(n,o){return n&&n.length?ws(n,ge(o,2),Nu):r}var MO=Ts(function(n,o){return n*o},1),FO=Vu("round"),DO=Ts(function(n,o){return n-o},0);function NO(n){return n&&n.length?Su(n,It):0}function jO(n,o){return n&&n.length?Su(n,ge(o,2)):0}return A.after=uE,A.ary=Zp,A.assign=VE,A.assignIn=sh,A.assignInWith=ah,A.assignWith=fl,A.at=XE,A.before=Gp,A.bind=al,A.bindAll=tO,A.bindKey=Kp,A.castArray=wE,A.chain=Bp,A.chunk=Px,A.compact=Cx,A.concat=kx,A.cond=rO,A.conforms=nO,A.constant=gl,A.countBy=jS,A.create=YE,A.curry=Vp,A.curryRight=Xp,A.debounce=Yp,A.defaults=JE,A.defaultsDeep=QE,A.defer=lE,A.delay=cE,A.difference=$x,A.differenceBy=Ix,A.differenceWith=Lx,A.drop=Mx,A.dropRight=Fx,A.dropRightWhile=Dx,A.dropWhile=Nx,A.fill=jx,A.filter=WS,A.flatMap=HS,A.flatMapDeep=qS,A.flatMapDepth=ZS,A.flatten=jp,A.flattenDeep=zx,A.flattenDepth=Wx,A.flip=fE,A.flow=oO,A.flowRight=sO,A.fromPairs=Ux,A.functions=s_,A.functionsIn=a_,A.groupBy=GS,A.initial=Hx,A.intersection=qx,A.intersectionBy=Zx,A.intersectionWith=Gx,A.invert=l_,A.invertBy=c_,A.invokeMap=VS,A.iteratee=ml,A.keyBy=XS,A.keys=ft,A.keysIn=$t,A.map=Ls,A.mapKeys=d_,A.mapValues=p_,A.matches=aO,A.matchesProperty=uO,A.memoize=Fs,A.merge=h_,A.mergeWith=uh,A.method=lO,A.methodOf=cO,A.mixin=vl,A.negate=Ds,A.nthArg=dO,A.omit=g_,A.omitBy=m_,A.once=dE,A.orderBy=YS,A.over=pO,A.overArgs=pE,A.overEvery=hO,A.overSome=gO,A.partial=ul,A.partialRight=Jp,A.partition=JS,A.pick=v_,A.pickBy=lh,A.property=mh,A.propertyOf=mO,A.pull=Yx,A.pullAll=Wp,A.pullAllBy=Jx,A.pullAllWith=Qx,A.pullAt=eS,A.range=vO,A.rangeRight=yO,A.rearg=hE,A.reject=tE,A.remove=tS,A.rest=gE,A.reverse=ol,A.sampleSize=nE,A.set=b_,A.setWith=w_,A.shuffle=iE,A.slice=rS,A.sortBy=aE,A.sortedUniq=lS,A.sortedUniqBy=cS,A.split=B_,A.spread=mE,A.tail=fS,A.take=dS,A.takeRight=pS,A.takeRightWhile=hS,A.takeWhile=gS,A.tap=CS,A.throttle=vE,A.thru=Is,A.toArray=nh,A.toPairs=ch,A.toPairsIn=fh,A.toPath=EO,A.toPlainObject=oh,A.transform=x_,A.unary=yE,A.union=mS,A.unionBy=vS,A.unionWith=yS,A.uniq=bS,A.uniqBy=wS,A.uniqWith=xS,A.unset=S_,A.unzip=sl,A.unzipWith=Up,A.update=E_,A.updateWith=__,A.values=fi,A.valuesIn=O_,A.without=SS,A.words=hh,A.wrap=bE,A.xor=ES,A.xorBy=_S,A.xorWith=OS,A.zip=AS,A.zipObject=TS,A.zipObjectDeep=RS,A.zipWith=PS,A.entries=ch,A.entriesIn=fh,A.extend=sh,A.extendWith=ah,vl(A,A),A.add=OO,A.attempt=gh,A.camelCase=P_,A.capitalize=dh,A.ceil=AO,A.clamp=A_,A.clone=xE,A.cloneDeep=EE,A.cloneDeepWith=_E,A.cloneWith=SE,A.conformsTo=OE,A.deburr=ph,A.defaultTo=iO,A.divide=TO,A.endsWith=C_,A.eq=fr,A.escape=k_,A.escapeRegExp=$_,A.every=zS,A.find=US,A.findIndex=Dp,A.findKey=e_,A.findLast=BS,A.findLastIndex=Np,A.findLastKey=t_,A.floor=RO,A.forEach=Hp,A.forEachRight=qp,A.forIn=r_,A.forInRight=n_,A.forOwn=i_,A.forOwnRight=o_,A.get=dl,A.gt=AE,A.gte=TE,A.has=u_,A.hasIn=pl,A.head=zp,A.identity=It,A.includes=KS,A.indexOf=Bx,A.inRange=T_,A.invoke=f_,A.isArguments=Ln,A.isArray=Se,A.isArrayBuffer=RE,A.isArrayLike=kt,A.isArrayLikeObject=rt,A.isBoolean=PE,A.isBuffer=dn,A.isDate=CE,A.isElement=kE,A.isEmpty=$E,A.isEqual=IE,A.isEqualWith=LE,A.isError=ll,A.isFinite=ME,A.isFunction=Br,A.isInteger=Qp,A.isLength=Ns,A.isMap=eh,A.isMatch=FE,A.isMatchWith=DE,A.isNaN=NE,A.isNative=jE,A.isNil=WE,A.isNull=zE,A.isNumber=th,A.isObject=Ve,A.isObjectLike=et,A.isPlainObject=qi,A.isRegExp=cl,A.isSafeInteger=UE,A.isSet=rh,A.isString=js,A.isSymbol=Wt,A.isTypedArray=ci,A.isUndefined=BE,A.isWeakMap=HE,A.isWeakSet=qE,A.join=Kx,A.kebabCase=I_,A.last=tr,A.lastIndexOf=Vx,A.lowerCase=L_,A.lowerFirst=M_,A.lt=ZE,A.lte=GE,A.max=PO,A.maxBy=CO,A.mean=kO,A.meanBy=$O,A.min=IO,A.minBy=LO,A.stubArray=bl,A.stubFalse=wl,A.stubObject=bO,A.stubString=wO,A.stubTrue=xO,A.multiply=MO,A.nth=Xx,A.noConflict=fO,A.noop=yl,A.now=Ms,A.pad=F_,A.padEnd=D_,A.padStart=N_,A.parseInt=j_,A.random=R_,A.reduce=QS,A.reduceRight=eE,A.repeat=z_,A.replace=W_,A.result=y_,A.round=FO,A.runInContext=j,A.sample=rE,A.size=oE,A.snakeCase=U_,A.some=sE,A.sortedIndex=nS,A.sortedIndexBy=iS,A.sortedIndexOf=oS,A.sortedLastIndex=sS,A.sortedLastIndexBy=aS,A.sortedLastIndexOf=uS,A.startCase=H_,A.startsWith=q_,A.subtract=DO,A.sum=NO,A.sumBy=jO,A.template=Z_,A.times=SO,A.toFinite=Hr,A.toInteger=Ee,A.toLength=ih,A.toLower=G_,A.toNumber=rr,A.toSafeInteger=KE,A.toString=Me,A.toUpper=K_,A.trim=V_,A.trimEnd=X_,A.trimStart=Y_,A.truncate=J_,A.unescape=Q_,A.uniqueId=_O,A.upperCase=eO,A.upperFirst=hl,A.each=Hp,A.eachRight=qp,A.first=zp,vl(A,(function(){var n={};return wr(A,function(o,l){Le.call(A.prototype,l)||(n[l]=o)}),n})(),{chain:!1}),A.VERSION=i,Nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){A[n].placeholder=A}),Nt(["drop","take"],function(n,o){Pe.prototype[n]=function(l){l=l===r?1:lt(Ee(l),0);var b=this.__filtered__&&!o?new Pe(this):this.clone();return b.__filtered__?b.__takeCount__=wt(l,b.__takeCount__):b.__views__.push({size:wt(l,ne),type:n+(b.__dir__<0?"Right":"")}),b},Pe.prototype[n+"Right"]=function(l){return this.reverse()[n](l).reverse()}}),Nt(["filter","map","takeWhile"],function(n,o){var l=o+1,b=l==k||l==J;Pe.prototype[n]=function(_){var T=this.clone();return T.__iteratees__.push({iteratee:ge(_,3),type:l}),T.__filtered__=T.__filtered__||b,T}}),Nt(["head","last"],function(n,o){var l="take"+(o?"Right":"");Pe.prototype[n]=function(){return this[l](1).value()[0]}}),Nt(["initial","tail"],function(n,o){var l="drop"+(o?"":"Right");Pe.prototype[n]=function(){return this.__filtered__?new Pe(this):this[l](1)}}),Pe.prototype.compact=function(){return this.filter(It)},Pe.prototype.find=function(n){return this.filter(n).head()},Pe.prototype.findLast=function(n){return this.reverse().find(n)},Pe.prototype.invokeMap=Te(function(n,o){return typeof n=="function"?new Pe(this):this.map(function(l){return ji(l,n,o)})}),Pe.prototype.reject=function(n){return this.filter(Ds(ge(n)))},Pe.prototype.slice=function(n,o){n=Ee(n);var l=this;return l.__filtered__&&(n>0||o<0)?new Pe(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),o!==r&&(o=Ee(o),l=o<0?l.dropRight(-o):l.take(o-n)),l)},Pe.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Pe.prototype.toArray=function(){return this.take(ne)},wr(Pe.prototype,function(n,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),b=/^(?:head|last)$/.test(o),_=A[b?"take"+(o=="last"?"Right":""):o],T=b||/^find/.test(o);_&&(A.prototype[o]=function(){var P=this.__wrapped__,I=b?[1]:arguments,z=P instanceof Pe,V=I[0],X=z||Se(P),ee=function(Re){var Ce=_.apply(A,on([Re],I));return b&&se?Ce[0]:Ce};X&&l&&typeof V=="function"&&V.length!=1&&(z=X=!1);var se=this.__chain__,le=!!this.__actions__.length,me=T&&!se,Oe=z&&!le;if(!T&&X){P=Oe?P:new Pe(this);var pe=n.apply(P,I);return pe.__actions__.push({func:Is,args:[ee],thisArg:r}),new Jt(pe,se)}return me&&Oe?n.apply(this,I):(pe=this.thru(ee),me?b?pe.value()[0]:pe.value():pe)})}),Nt(["pop","push","shift","sort","splice","unshift"],function(n){var o=os[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",b=/^(?:pop|shift)$/.test(n);A.prototype[n]=function(){var _=arguments;if(b&&!this.__chain__){var T=this.value();return o.apply(Se(T)?T:[],_)}return this[l](function(P){return o.apply(Se(P)?P:[],_)})}}),wr(Pe.prototype,function(n,o){var l=A[o];if(l){var b=l.name+"";Le.call(oi,b)||(oi[b]=[]),oi[b].push({name:o,func:l})}}),oi[As(r,S).name]=[{name:"wrapper",func:r}],Pe.prototype.clone=e1,Pe.prototype.reverse=t1,Pe.prototype.value=r1,A.prototype.at=kS,A.prototype.chain=$S,A.prototype.commit=IS,A.prototype.next=LS,A.prototype.plant=FS,A.prototype.reverse=DS,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=NS,A.prototype.first=A.prototype.head,$i&&(A.prototype[$i]=MS),A}),ri=Iw();An?((An.exports=ri)._=ri,gu._=ri):pt._=ri}).call(x$)})(bo,bo.exports)),bo.exports}var Ye=S$();const Rc={FdSave:tt.FdSave,FdWarningDanger:tt.FdWarningDanger,FdInfoCircle:tt.FdInfoCircle,FdInfoBold:tt.FdInfoBold};var Sf=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))(Sf||{}),Bn=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Bn||{}),vi=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(vi||{});const zy={[Bn.PRIMARY]:{icon:"blue-500",button:"primary-dark"},[Bn.DANGER]:{icon:"red-500",button:"primary-dark"},[Bn.WARNING]:{icon:"yellow-400",button:"primary-dark"}},Ql=({color:e=Bn.PRIMARY,variant:t="solid",children:r,autoFocus:i,...s})=>{const a=zy[e].button,u=t==="outlined"?`bg-transparent text-white border border-white hover:border-white hover:bg-white hover:text-${a}`:`text-white bg-${a} border border-${a} hover:border-white hover:bg-primary-hover hover:text-white`;return F.jsx("button",{autoFocus:i,className:He("w-16 rounded px-2 py-1 text-xs font-medium hover:font-bold focus:outline-none",u),...s,children:r})},E$=({name:e,color:t=Bn.PRIMARY,className:r="w-8 h-8"})=>{const i=Rc[e]||Rc.FdInfoCircle,s=`text-${zy[t].icon}`;return F.jsx(i,{className:He(r,s)})},_$=({id:e,title:t,message:r,icon:i,type:s,color:a,zIndex:u=3e3,views:c,width:f=520,hasOverlay:m=!0,container:y,onClose:p,onEdit:g})=>{const v=w=>{p({id:e,reason:w})};W.useEffect(()=>{function w(h){h.key==="Escape"&&v(vi.CANCELED)}return window.addEventListener("keyup",w),()=>{window.removeEventListener("keyup",w)}},[]);const x=Ye.merge(Ye.values(c==null?void 0:c.toggles).flatMap(w=>w.value?w.warnings||[]:[]),c==null?void 0:c.tips),d=(w,h)=>{var E;if(!(c!=null&&c.toggles))return;const S=Ye.cloneDeep(c);(E=S.toggles)!=null&&E[w]&&(S.toggles[w].value=h),g({id:e,views:S})};return zo.createPortal(F.jsx(_a,{appear:!0,show:!0,as:W.Fragment,children:F.jsx("div",{className:He("absolute inset-0 flex h-full w-full items-center justify-center overflow-y-auto",{"bg-black bg-opacity-80":m}),style:{zIndex:u},onClick:()=>v(vi.CANCELED),children:F.jsx(_a.Child,{as:W.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:F.jsx("div",{"data-cy":"confirmation-modal-cy",className:"relative rounded-md border border-grey-50 bg-grey-900",style:{width:f},onClick:w=>w.stopPropagation(),children:F.jsxs("div",{className:"flex flex-col items-center gap-3 p-6 px-12",children:[i?F.jsx("div",{className:"flex items-center justify-center",children:F.jsx(E$,{name:i,color:a,className:"w-6 h-6"})}):null,F.jsx(O$,{condition:t,children:F.jsx("h4",{className:"w-full text-wrap text-lg font-bold leading-6 text-white text-center",children:t})}),F.jsx("p",{className:"w-full text-wrap text-center text-sm font-medium text-white",children:r}),F.jsx("div",{className:"text-xs text-white",children:Ye.values(c==null?void 0:c.toggles).map(w=>F.jsx("div",{children:F.jsxs("label",{htmlFor:w.key,className:"flex items-center",children:[F.jsx(Oy,{size:"xs",value:w.value,onChange:h=>d(w.key,h)}),F.jsx("span",{className:"ml-1",children:w.title})]})},w.key))}),F.jsx(A$,{warnings:x}),F.jsx("div",{className:"flex items-center gap-4",children:s===Sf.CONFIRM?F.jsxs(F.Fragment,{children:[F.jsx(Ql,{autoFocus:!0,color:a,onClick:()=>v(vi.CONFIRMED),children:"Confirm"}),F.jsx(Ql,{color:a,variant:"outlined",onClick:()=>v(vi.CANCELED),children:"Cancel"})]}):F.jsx(Ql,{autoFocus:!0,onClick:()=>v(),children:"OK"})})]})})})})}),y||document.body)},O$=e=>e.condition?F.jsx(F.Fragment,{children:e.children}):null,A$=e=>e.warnings?F.jsx(_a,{appear:!0,show:!!e.warnings.length,as:W.Fragment,children:F.jsx("div",{className:"flex flex-col gap-1 rounded-sm bg-grey-600 p-2 text-xs text-white",children:e.warnings.map((t,r)=>F.jsx(_a.Child,{as:W.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:F.jsxs("div",{className:"flex flex-1 items-center gap-1 rounded-sm px-2 py-1",children:[F.jsx(tt.FdWarningDanger,{className:He({"h-3 w-3":!0,"text-yellow-500":t.type==="warning","text-red-400":t.type==="error","text-primary-dark":t.type==="info"},"mr-3")}),F.jsx("div",{className:"flex-1",children:t.message})]})},`modal-warnings-${r}`))})}):null;var Wy=(e=>(e[e.MIN=.5]="MIN",e[e.MAX=10]="MAX",e[e.STEP=.5]="STEP",e[e.INIT=1]="INIT",e[e.TRANSITION=200]="TRANSITION",e))(Wy||{});const T$=({zoom:e,minZoom:t=.5,maxZoom:r=10,handleZoomIn:i,handleZoomOut:s})=>F.jsxs("div",{className:"flex items-center rounded bg-grey-300 p-1",children:[F.jsx(tt.FdMinusNaked,{onClick:s,className:He("h-5 w-5 p-1",{"text-grey-200":e<=t,"cursor-pointer rounded hover:bg-purple-800":e>t})}),F.jsxs("span",{className:"mx-1 w-10 select-none text-center text-xs",children:[(e*100).toFixed(0),"%"]}),F.jsx(tt.FdPlusNaked,{onClick:i,className:He("h-5 w-5 p-1",{"text-grey-200":e>=r,"cursor-pointer rounded hover:bg-purple-800":e<r})})]}),R$=$.forwardRef(((e,t)=>$.createElement(_n.span,Qe({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))),P$=R$;function Em(e){const t=$.useRef({value:e,previous:e});return $.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}const[Uy]=rf("Tooltip",[Wa]),Ef=Wa(),C$=700,[qM,k$]=Uy("TooltipProvider",{isOpenDelayed:!0,delayDuration:C$,onOpen:()=>{},onClose:()=>{}}),[$$,Ga]=Uy("Tooltip"),I$=e=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:s=!1,onOpenChange:a,delayDuration:u}=e,c=k$("Tooltip",t),f=Ef(t),[m,y]=$.useState(null),p=Uv(),g=$.useRef(0),v=u??c.delayDuration,x=$.useRef(!1),{onOpen:d,onClose:w}=c,[h=!1,S]=ey({prop:i,defaultProp:s,onChange:C=>{C&&(document.dispatchEvent(new CustomEvent("tooltip.open")),d()),a==null||a(C)}}),E=$.useMemo((()=>h?x.current?"delayed-open":"instant-open":"closed"),[h]),R=$.useCallback((()=>{window.clearTimeout(g.current),x.current=!1,S(!0)}),[S]),O=$.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{x.current=!0,S(!0)}),v)}),[v,S]);return $.useEffect((()=>()=>window.clearTimeout(g.current)),[]),$.createElement(Yv,f,$.createElement($$,{scope:t,contentId:p,open:h,stateAttribute:E,trigger:m,onTriggerChange:y,onTriggerEnter:$.useCallback((()=>{c.isOpenDelayed?O():R()}),[c.isOpenDelayed,O,R]),onOpen:$.useCallback(R,[R]),onClose:$.useCallback((()=>{window.clearTimeout(g.current),S(!1),w()}),[S,w])},r))},L$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,...i}=e,s=Ga("TooltipTrigger",r),a=Ef(r),u=En(t,s.onTriggerChange),c=$.useRef(!1),f=$.useCallback((()=>c.current=!1),[]);return $.useEffect((()=>()=>document.removeEventListener("mouseup",f)),[f]),$.createElement(Jv,Qe({asChild:!0},a),$.createElement(_n.button,Qe({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},i,{ref:u,onMouseEnter:qt(e.onMouseEnter,s.onTriggerEnter),onMouseLeave:qt(e.onMouseLeave,s.onClose),onMouseDown:qt(e.onMouseDown,(()=>{s.onClose(),c.current=!0,document.addEventListener("mouseup",f,{once:!0})})),onFocus:qt(e.onFocus,(()=>{c.current||s.onOpen()})),onBlur:qt(e.onBlur,s.onClose),onClick:qt(e.onClick,(m=>{m.detail===0&&s.onClose()}))})))})),M$=$.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,s=Ga("TooltipContent",e.__scopeTooltip);return $.createElement(ef,{present:r||s.open},$.createElement(F$,Qe({ref:t},i)))})),F$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:i,"aria-label":s,portalled:a=!0,...u}=e,c=Ga("TooltipContent",r),f=Ef(r),m=a?tf:$.Fragment,{onClose:y}=c;return Zv((()=>y())),$.useEffect((()=>(document.addEventListener("tooltip.open",y),()=>document.removeEventListener("tooltip.open",y))),[y]),$.createElement(m,null,$.createElement(D$,{__scopeTooltip:r}),$.createElement(Qv,Qe({"data-state":c.stateAttribute},f,u,{ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),$.createElement(qv,null,i),$.createElement(P$,{id:c.contentId,role:"tooltip"},s||i)))}));function D$(e){const{__scopeTooltip:t}=e,r=Ga("CheckTriggerMoved",t),i=Kv(r.trigger),s=i==null?void 0:i.left,a=Em(s),u=i==null?void 0:i.top,c=Em(u),f=r.onClose;return $.useEffect((()=>{(a!==void 0&&a!==s||c!==void 0&&c!==u)&&f()}),[f,a,c,s,u]),null}const N$=I$,j$=L$,z$=M$;function W$(e){return F.jsxs(N$,{delayDuration:e.delayDuration,open:e.open,children:[F.jsx(j$,{tabIndex:-1,asChild:!0,children:F.jsx("span",{children:e.children})}),F.jsxs(z$,{side:e.side,sideOffset:e.sideOffset,alignOffset:e.alignOffset,children:[typeof e.message=="string"&&F.jsx("p",{className:"max-w-[240px] rounded-md bg-primary-light px-1 py-2 text-s font-semibold text-primary-dark",children:e.message}),typeof e.message!="string"&&e.message]})]})}const Or=30,By=.3,Hy=.6,U$=()=>typeof window>"u"?400:Math.round(window.innerHeight*By),qy=()=>typeof window>"u"?600:Math.round(window.innerHeight*Hy),_m=e=>{const t=qy();return Math.min(Math.max(e,Or),t)},B$=()=>F.jsx("div",{className:"h-2 w-full bg-opacity-40 hover:bg-primary-hover"}),H$=e=>{const[t,r]=W.useState(Or),i=W.useRef(),s=W.useRef(null),a=qy(),u=U$(),c=t>Or;W.useEffect(()=>{r(e.isOpen?u:Or)},[e.isOpen,u]),W.useEffect(()=>{const m=()=>{r(y=>y<=Or?Or:_m(y))};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m),s.current&&cancelAnimationFrame(s.current)}},[]);const f=()=>{if(c){r(Or),e.onClose();return}r(u),e.onOpen()};return F.jsx("div",{className:"relative w-full select-none isolate",style:{zIndex:49},children:F.jsx(UO.Resizable,{enable:{top:!0,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},className:"w-full select-none border-t border-grey-900 bg-grey-800",size:{height:t,width:"100%"},maxHeight:a,minHeight:Or,onResizeStart:()=>{i.current&&Date.now()-i.current<200?r(c?Or:u):i.current=Date.now()},onResize:(m,y,p)=>{s.current&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{var g;(g=e.onResize)==null||g.call(e),s.current=null})},onResizeStop:(m,y,p,g)=>{r(v=>_m(v+g.height))},handleComponent:{top:F.jsx(B$,{})},children:F.jsxs("div",{"data-cy":"contextualPanel",className:"absolute inset-0 flex flex-col overflow-hidden",id:`__cp-${Ye.kebabCase(e.path)}`,children:[F.jsxs("div",{className:He("flex justify-between items-center px-3 py-0.5",{"flex-1":!c}),children:[F.jsxs("div",{className:"group flex items-center justify-start",children:[F.jsx("span",{className:"mr-2 text-sm text-fd-gray-lighter",children:"Contextual panel"}),e.tipKey?F.jsx(py,{tipKey:e.tipKey,alwaysOn:!0,asButton:!0}):null,F.jsx("button",{"data-cy":`contextualPanel-toggle-button-${c?"close":"open"}`,className:"rounded p-1 text-white hover:bg-primary-hover focus:outline-none",onClick:f,children:c?F.jsx(tt.FdDoubleArrowDown,{className:"h-4 w-4 text-white"}):F.jsx(tt.FdDoubleArrowUp,{className:"h-4 w-4 text-white"})})]}),e.headerRightSide]}),F.jsxs(fa,{of:c,children:[F.jsx(fa,{of:e.render,children:e.render}),F.jsx(fa,{of:!e.render,children:e.children})]})]})})})};function Zy({children:e,viewBox:t="0 0 24 24",...r}){return F.jsx("svg",{viewBox:t,width:"1em",height:"1em",fill:"none",className:"base-icon",...r,children:e})}function Gy(e){const t=e.isIndeterminate?"M2 12h20":"M4 11.5L9 17L20 6";return F.jsx(Zy,{viewBox:"0 0 24 24",...e,children:F.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",d:t})})}function q$({isChecked:e,isIndeterminate:t,isInvalid:r,icon:i,label:s,className:a="",style:u,...c}){const f=W.useRef(null),m=i||F.jsx(Gy,{}),y=c.checked??e;W.useEffect(()=>{f.current&&(f.current.indeterminate=!!t)},[t]);const p=y||t,g=["base-checkbox-container",a].join(" ");return F.jsxs("label",{className:g,style:u,"data-invalid":r,children:[F.jsx("input",{ref:f,type:"checkbox",className:"base-checkbox-input",checked:y,...c,"aria-invalid":r||void 0}),F.jsx("span",{className:"base-checkbox-control",children:p&&m&&W.cloneElement(m,{isChecked:y,isIndeterminate:t,className:"base-checkbox-icon"})}),s&&F.jsx("span",{className:"base-checkbox-label",children:s})]})}const Z$=({title:e="Invalid page structure",error:t,onClose:r,onOpenInTextEditor:i,onReset:s,resetButtonLabel:a="Reset Page"})=>F.jsx("div",{className:"flex h-full w-full items-center justify-center",children:F.jsxs("div",{className:"flex flex-col items-center rounded bg-grey-300 px-10 py-6 text-center shadow-md",children:[F.jsxs("div",{className:"relative",children:[F.jsx(tt.FdSanityCheckDefault,{className:"relative z-20 h-12 w-12 text-red-500 rounded-full"}),F.jsx("div",{className:"w-1/2 h-1/2 absolute z-0 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white"})]}),F.jsx("p",{className:"mb-2 mt-4 text-2xl text-white",children:e}),F.jsx("p",{className:"text-md mb-4 font-extralight text-grey-100",children:t}),F.jsxs("div",{className:"flex gap-4",children:[i&&F.jsx("button",{className:"text-md rounded border border-primary-dark hover:border-primary-hover bg-primary-dark hover:bg-primary-hover px-3 py-1 text-white focus:outline-none",onClick:i,children:"Open in Text Editor"}),s&&F.jsx("button",{className:"text-md rounded border border-red-500 bg-red-500 hover:bg-red-400 focus:ring-red-500 px-3 py-1 text-white focus:outline-none",onClick:s,children:a}),r&&F.jsx("button",{className:"text-md rounded border border-grey-50 bg-transparent hover:bg-grey-50 text-white hover:text-primary-dark px-3 py-1 focus:outline-none",onClick:r,children:"Close"})]})]})});function G$(e,t){const r=W.useRef(!1);W.useEffect(()=>{if(r.current)return e();r.current=!0},t)}const ec=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function tc(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),r)}function mo(e,t,r,i){e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent&&e.detachEvent("on".concat(t),r)}function Ky(e,t){const r=t.slice(0,t.length-1);for(let i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function Vy(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function K$(e,t){const r=e.length>=t.length?e:t,i=e.length>=t.length?t:e;let s=!0;for(let a=0;a<r.length;a++)i.indexOf(r[a])===-1&&(s=!1);return s}const Io={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ec?173:189,"=":ec?61:187,";":ec?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},vr={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},wo={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},vt={16:!1,18:!1,17:!1,91:!1},Je={};for(let e=1;e<20;e++)Io["f".concat(e)]=111+e;let Ke=[],Po=null,Xy="all";const Gr=new Map,Pi=e=>Io[e.toLowerCase()]||vr[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),V$=e=>Object.keys(Io).find(t=>Io[t]===e),X$=e=>Object.keys(vr).find(t=>vr[t]===e);function Yy(e){Xy=e||"all"}function Lo(){return Xy||"all"}function Y$(){return Ke.slice(0)}function J$(){return Ke.map(e=>V$(e)||X$(e)||String.fromCharCode(e))}function Q$(){const e=[];return Object.keys(Je).forEach(t=>{Je[t].forEach(r=>{let{key:i,scope:s,mods:a,shortcut:u}=r;e.push({scope:s,shortcut:u,mods:a,keys:i.split("+").map(c=>Pi(c))})})}),e}function eI(e){const t=e.target||e.srcElement,{tagName:r}=t;let i=!0;const s=r==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(s||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function tI(e){return typeof e=="string"&&(e=Pi(e)),Ke.indexOf(e)!==-1}function rI(e,t){let r,i;e||(e=Lo());for(const s in Je)if(Object.prototype.hasOwnProperty.call(Je,s))for(r=Je[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1).forEach(u=>{let{element:c}=u;return _f(c)}):i++;Lo()===e&&Yy(t||"all")}function nI(e){let t=e.keyCode||e.which||e.charCode;e.key&&e.key.toLowerCase()==="capslock"&&(t=Pi(e.key));const r=Ke.indexOf(t);if(r>=0&&Ke.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&Ke.splice(0,Ke.length),(t===93||t===224)&&(t=91),t in vt){vt[t]=!1;for(const i in vr)vr[i]===t&&(mr[i]=!1)}}function Jy(e){if(typeof e>"u")Object.keys(Je).forEach(s=>{Array.isArray(Je[s])&&Je[s].forEach(a=>na(a)),delete Je[s]}),_f(null);else if(Array.isArray(e))e.forEach(s=>{s.key&&na(s)});else if(typeof e=="object")e.key&&na(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let[s,a]=r;typeof s=="function"&&(a=s,s=""),na({key:e,scope:s,method:a,splitKey:"+"})}}const na=e=>{let{key:t,scope:r,method:i,splitKey:s="+"}=e;Vy(t).forEach(u=>{const c=u.split(s),f=c.length,m=c[f-1],y=m==="*"?"*":Pi(m);if(!Je[y])return;r||(r=Lo());const p=f>1?Ky(vr,c):[],g=[];Je[y]=Je[y].filter(v=>{const d=(i?v.method===i:!0)&&v.scope===r&&K$(v.mods,p);return d&&g.push(v.element),!d}),g.forEach(v=>_f(v))})};function Om(e,t,r,i){if(t.element!==i)return;let s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(const a in vt)Object.prototype.hasOwnProperty.call(vt,a)&&(!vt[a]&&t.mods.indexOf(+a)>-1||vt[a]&&t.mods.indexOf(+a)===-1)&&(s=!1);(t.mods.length===0&&!vt[16]&&!vt[18]&&!vt[17]&&!vt[91]||s||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(Ke),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Am(e,t){const r=Je["*"];let i=e.keyCode||e.which||e.charCode;if(e.key&&e.key.toLowerCase()==="capslock"||!mr.filter.call(this,e))return;if((i===93||i===224)&&(i=91),Ke.indexOf(i)===-1&&i!==229&&Ke.push(i),["metaKey","ctrlKey","altKey","shiftKey"].forEach(c=>{const f=wo[c];e[c]&&Ke.indexOf(f)===-1?Ke.push(f):!e[c]&&Ke.indexOf(f)>-1?Ke.splice(Ke.indexOf(f),1):c==="metaKey"&&e[c]&&(Ke=Ke.filter(m=>m in wo||m===i))}),i in vt){vt[i]=!0;for(const c in vr)if(Object.prototype.hasOwnProperty.call(vr,c)){const f=wo[vr[c]];mr[c]=e[f]}if(!r)return}for(const c in vt)Object.prototype.hasOwnProperty.call(vt,c)&&(vt[c]=e[wo[c]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ke.indexOf(17)===-1&&Ke.push(17),Ke.indexOf(18)===-1&&Ke.push(18),vt[17]=!0,vt[18]=!0);const s=Lo();if(r)for(let c=0;c<r.length;c++)r[c].scope===s&&(e.type==="keydown"&&r[c].keydown||e.type==="keyup"&&r[c].keyup)&&Om(e,r[c],s,t);if(!(i in Je))return;const a=Je[i],u=a.length;for(let c=0;c<u;c++)if((e.type==="keydown"&&a[c].keydown||e.type==="keyup"&&a[c].keyup)&&a[c].key){const f=a[c],{splitKey:m}=f,y=f.key.split(m),p=[];for(let g=0;g<y.length;g++)p.push(Pi(y[g]));p.sort().join("")===Ke.sort().join("")&&Om(e,f,s,t)}}function mr(e,t,r){Ke=[];const i=Vy(e);let s=[],a="all",u=document,c=0,f=!1,m=!0,y="+",p=!1,g=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(u=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(m=t.keydown),t.capture!==void 0&&(p=t.capture),typeof t.splitKey=="string"&&(y=t.splitKey),t.single===!0&&(g=!0)),typeof t=="string"&&(a=t),g&&Jy(e,a);c<i.length;c++)e=i[c].split(y),s=[],e.length>1&&(s=Ky(vr,e)),e=e[e.length-1],e=e==="*"?"*":Pi(e),e in Je||(Je[e]=[]),Je[e].push({keyup:f,keydown:m,scope:a,mods:s,shortcut:i[c],method:r,key:i[c],splitKey:y,element:u});if(typeof u<"u"&&window){if(!Gr.has(u)){const v=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Am(d,u)},x=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Am(d,u),nI(d)};Gr.set(u,{keydownListener:v,keyupListenr:x,capture:p}),tc(u,"keydown",v,p),tc(u,"keyup",x,p)}if(!Po){const v=()=>{Ke=[]};Po={listener:v,capture:p},tc(window,"focus",v,p)}}}function iI(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Je).forEach(r=>{Je[r].filter(s=>s.scope===t&&s.shortcut===e).forEach(s=>{s&&s.method&&s.method()})})}function _f(e){const t=Object.values(Je).flat();if(t.findIndex(i=>{let{element:s}=i;return s===e})<0){const{keydownListener:i,keyupListenr:s,capture:a}=Gr.get(e)||{};i&&s&&(mo(e,"keyup",s,a),mo(e,"keydown",i,a),Gr.delete(e))}if((t.length<=0||Gr.size<=0)&&(Object.keys(Gr).forEach(s=>{const{keydownListener:a,keyupListenr:u,capture:c}=Gr.get(s)||{};a&&u&&(mo(s,"keyup",u,c),mo(s,"keydown",a,c),Gr.delete(s))}),Gr.clear(),Object.keys(Je).forEach(s=>delete Je[s]),Po)){const{listener:s,capture:a}=Po;mo(window,"focus",s,a),Po=null}}const rc={getPressedKeyString:J$,setScope:Yy,getScope:Lo,deleteScope:rI,getPressedKeyCodes:Y$,getAllKeyCodes:Q$,isPressed:tI,filter:eI,trigger:iI,unbind:Jy,keyMap:Io,modifier:vr,modifierMap:wo};for(const e in rc)Object.prototype.hasOwnProperty.call(rc,e)&&(mr[e]=rc[e]);if(typeof window<"u"){const e=window.hotkeys;mr.noConflict=t=>(t&&window.hotkeys===mr&&(window.hotkeys=e),mr),window.hotkeys=mr}mr.filter=()=>!0;function oI(e,t,r,i){r instanceof Array&&(i=r,r=void 0),i=i||[],r=r||{};const{preventDefault:s=!0}=r,a=W.useCallback((c,f)=>{s&&c.preventDefault(),setTimeout(()=>t(c,f))},i),u=()=>{mr.unbind(e,a)};W.useEffect(()=>(mr(e,r,a),u),[e,r,a])}const sI=e=>{const t=W.useRef(null);return W.useEffect(()=>{const r=i=>{t.current&&!t.current.contains(i.target)&&e(i)};return document.addEventListener("click",r,!0),()=>{document.removeEventListener("click",r,!0)}},[e]),t};function aI(e){const t=W.useRef();return W.useEffect(()=>{t.current=e},[e]),t.current}function uI(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e},[e]),t}function lI(e){const t=W.useRef(null);return W.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t}function cI(e){const[t,r]=W.useState(e),i=(a,u)=>{r(c=>({...c,features:{...c.features,[a]:{enabled:u}}}))},s=W.useCallback((...a)=>a.every(u=>{var c;return(c=t.features[u])==null?void 0:c.enabled}),[t.features]);return{setFeature:i,isFeatureEnabled:s}}const Qy=W.createContext(""),fI=e=>F.jsx(Qy.Provider,{value:e.value,children:e.children}),dI=()=>{const e=W.useContext(Qy);if(typeof e!="string")throw new Error("Error while calling useIdentity! Context has incorrect type (expected string)");return e};function pI(e){const[t,r]=W.useState(e),i=W.useMemo(()=>hI(t,r),[]);return{state:t,actions:{...i,set:s=>{r(typeof s=="function"?s:a=>({...a,...s}))}}}}function hI(e,t=()=>{}){return Object.keys(e).reduce((i,s)=>({...i,[`set${Ye.upperFirst(s)}`]:a=>t(u=>({...u,[s]:a}))}),{})}const gI=(e,t,r={})=>{r={timeout:200,...r};const i=W.useRef(),s=()=>{i.current&&(clearTimeout(i.current),i.current=null)};return W.useCallback((a,...u)=>{s(),t&&a.detail===1&&(i.current=setTimeout(()=>{t(a,...u)},r.timeout)),a.detail%2===0&&e(a,...u)},[t,e,r.timeout])};function yt(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(process.env.NODE_ENV!=="production"){var s=SI[e],a=s?typeof s=="function"?s.apply(null,r):s:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(u){return"'"+u+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ti(e){return!!e&&!!e[Kt]}function Gn(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var i=Object.getPrototypeOf(r);if(i===null)return!0;var s=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return s===Object||typeof s=="function"&&Function.toString.call(s)===EI})(e)||Array.isArray(e)||!!e[Lm]||!!(!((t=e.constructor)===null||t===void 0)&&t[Lm])||Of(e)||Af(e))}function Mo(e,t,r){r===void 0&&(r=!1),Ci(e)===0?(r?Object.keys:Cf)(e).forEach((function(i){r&&typeof i=="symbol"||t(i,e[i],e)})):e.forEach((function(i,s){return t(s,i,e)}))}function Ci(e){var t=e[Kt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Of(e)?2:Af(e)?3:0}function Pc(e,t){return Ci(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function mI(e,t){return Ci(e)===2?e.get(t):e[t]}function e0(e,t,r){var i=Ci(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function vI(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Of(e){return wI&&e instanceof Map}function Af(e){return xI&&e instanceof Set}function Nn(e){return e.o||e.t}function Tf(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=_I(e);delete t[Kt];for(var r=Cf(t),i=0;i<r.length;i++){var s=r[i],a=t[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Object.getPrototypeOf(e),t)}function Fo(e,t){return t===void 0&&(t=!1),Rf(e)||Ti(e)||!Gn(e)||(Ci(e)>1&&(e.set=e.add=e.clear=e.delete=yI),Object.freeze(e),t&&Mo(e,(function(r,i){return Fo(i,!0)}),!0)),e}function yI(){yt(2)}function Rf(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function $r(e){var t=OI[e];return t||yt(18,e),t}function Tm(){return process.env.NODE_ENV==="production"||Ri||yt(0),Ri}function nc(e,t){t&&($r("Patches"),e.u=[],e.s=[],e.v=t)}function Ra(e){Cc(e),e.p.forEach(bI),e.p=null}function Cc(e){e===Ri&&(Ri=e.l)}function Rm(e){return Ri={p:[],l:Ri,h:e,m:!0,_:0}}function bI(e){var t=e[Kt];t.i===0||t.i===1?t.j():t.g=!0}function ic(e,t){t._=t.p.length;var r=t.p[0],i=e!==void 0&&e!==r;return t.h.O||$r("ES5").S(t,e,i),i?(r[Kt].P&&(Ra(t),yt(4)),Gn(e)&&(e=Pa(t,e),t.l||Ca(t,e)),t.u&&$r("Patches").M(r[Kt].t,e,t.u,t.s)):e=Pa(t,r,[]),Ra(t),t.u&&t.v(t.u,t.s),e!==r0?e:void 0}function Pa(e,t,r){if(Rf(t))return t;var i=t[Kt];if(!i)return Mo(t,(function(c,f){return Pm(e,i,t,c,f,r)}),!0),t;if(i.A!==e)return t;if(!i.P)return Ca(e,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var s=i.i===4||i.i===5?i.o=Tf(i.k):i.o,a=s,u=!1;i.i===3&&(a=new Set(s),s.clear(),u=!0),Mo(a,(function(c,f){return Pm(e,i,s,c,f,r,u)})),Ca(e,s,!1),r&&e.u&&$r("Patches").N(i,r,e.u,e.s)}return i.o}function Pm(e,t,r,i,s,a,u){if(process.env.NODE_ENV!=="production"&&s===r&&yt(5),Ti(s)){var c=Pa(e,s,a&&t&&t.i!==3&&!Pc(t.R,i)?a.concat(i):void 0);if(e0(r,i,c),!Ti(c))return;e.m=!1}else u&&r.add(s);if(Gn(s)&&!Rf(s)){if(!e.h.D&&e._<1)return;Pa(e,s),t&&t.A.l||Ca(e,s)}}function Ca(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Fo(t,r)}function oc(e,t){var r=e[Kt];return(r?Nn(r):e)[t]}function Cm(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Object.getPrototypeOf(r)}}function kc(e){e.P||(e.P=!0,e.l&&kc(e.l))}function sc(e){e.o||(e.o=Tf(e.t))}function $c(e,t,r){var i=Of(t)?$r("MapSet").F(t,r):Af(t)?$r("MapSet").T(t,r):e.O?(function(s,a){var u=Array.isArray(s),c={i:u?1:0,A:a?a.A:Tm(),P:!1,I:!1,R:{},l:a,t:s,k:null,o:null,j:null,C:!1},f=c,m=Ic;u&&(f=[c],m=xo);var y=Proxy.revocable(f,m),p=y.revoke,g=y.proxy;return c.k=g,c.j=p,g})(t,r):$r("ES5").J(t,r);return(r?r.A:Tm()).p.push(i),i}function t0(e){return Ti(e)||yt(22,e),(function t(r){if(!Gn(r))return r;var i,s=r[Kt],a=Ci(r);if(s){if(!s.P&&(s.i<4||!$r("ES5").K(s)))return s.t;s.I=!0,i=km(r,a),s.I=!1}else i=km(r,a);return Mo(i,(function(u,c){s&&mI(s.t,u)===c||e0(i,u,t(c))})),a===3?new Set(i):i})(e)}function km(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Tf(e)}var $m,Ri,Pf=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",wI=typeof Map<"u",xI=typeof Set<"u",Im=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",r0=Pf?Symbol.for("immer-nothing"):(($m={})["immer-nothing"]=!0,$m),Lm=Pf?Symbol.for("immer-draftable"):"__$immer_draftable",Kt=Pf?Symbol.for("immer-state"):"__$immer_state",SI={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},EI=""+Object.prototype.constructor,Cf=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,_I=Object.getOwnPropertyDescriptors||function(e){var t={};return Cf(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},OI={},Ic={get:function(e,t){if(t===Kt)return e;var r=Nn(e);if(!Pc(r,t))return(function(s,a,u){var c,f=Cm(a,u);return f?"value"in f?f.value:(c=f.get)===null||c===void 0?void 0:c.call(s.k):void 0})(e,r,t);var i=r[t];return e.I||!Gn(i)?i:i===oc(e.t,t)?(sc(e),e.o[t]=$c(e.A.h,i,e)):i},has:function(e,t){return t in Nn(e)},ownKeys:function(e){return Reflect.ownKeys(Nn(e))},set:function(e,t,r){var i=Cm(Nn(e),t);if(i!=null&&i.set)return i.set.call(e.k,r),!0;if(!e.P){var s=oc(Nn(e),t),a=s==null?void 0:s[Kt];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(vI(r,s)&&(r!==void 0||Pc(e.t,t)))return!0;sc(e),kc(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return oc(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,sc(e),kc(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Nn(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty:function(){yt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){yt(12)}},xo={};Mo(Ic,(function(e,t){xo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),xo.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&yt(13),xo.set.call(this,e,t,void 0)},xo.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&yt(14),Ic.set.call(this,e[0],t,r,e[0])};var AI=(function(){function e(r){var i=this;this.O=Im,this.D=!0,this.produce=function(s,a,u){if(typeof s=="function"&&typeof a!="function"){var c=a;a=s;var f=i;return function(d){var w=this;d===void 0&&(d=c);for(var h=arguments.length,S=Array(h>1?h-1:0),E=1;E<h;E++)S[E-1]=arguments[E];return f.produce(d,(function(R){var O;return(O=a).call.apply(O,[w,R].concat(S))}))}}var m;if(typeof a!="function"&&yt(6),u!==void 0&&typeof u!="function"&&yt(7),Gn(s)){var y=Rm(i),p=$c(i,s,void 0),g=!0;try{m=a(p),g=!1}finally{g?Ra(y):Cc(y)}return typeof Promise<"u"&&m instanceof Promise?m.then((function(d){return nc(y,u),ic(d,y)}),(function(d){throw Ra(y),d})):(nc(y,u),ic(m,y))}if(!s||typeof s!="object"){if((m=a(s))===void 0&&(m=s),m===r0&&(m=void 0),i.D&&Fo(m,!0),u){var v=[],x=[];$r("Patches").M(s,m,v,x),u(v,x)}return m}yt(21,s)},this.produceWithPatches=function(s,a){if(typeof s=="function")return function(m){for(var y=arguments.length,p=Array(y>1?y-1:0),g=1;g<y;g++)p[g-1]=arguments[g];return i.produceWithPatches(m,(function(v){return s.apply(void 0,[v].concat(p))}))};var u,c,f=i.produce(s,a,(function(m,y){u=m,c=y}));return typeof Promise<"u"&&f instanceof Promise?f.then((function(m){return[m,u,c]})):[f,u,c]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){Gn(r)||yt(8),Ti(r)&&(r=t0(r));var i=Rm(this),s=$c(this,r,void 0);return s[Kt].C=!0,Cc(i),s},t.finishDraft=function(r,i){var s=r&&r[Kt];process.env.NODE_ENV!=="production"&&(s&&s.C||yt(9),s.I&&yt(10));var a=s.A;return nc(a,i),ic(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Im&&yt(20),this.O=r},t.applyPatches=function(r,i){var s;for(s=i.length-1;s>=0;s--){var a=i[s];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}s>-1&&(i=i.slice(s+1));var u=$r("Patches").$;return Ti(r)?u(r,i):this.produce(r,(function(c){return u(c,i)}))},e})(),Vt=new AI,TI=Vt.produce;Vt.produceWithPatches.bind(Vt);Vt.setAutoFreeze.bind(Vt);Vt.setUseProxies.bind(Vt);Vt.applyPatches.bind(Vt);Vt.createDraft.bind(Vt);Vt.finishDraft.bind(Vt);function RI(e){var t=W.useState(function(){return Fo(typeof e=="function"?e():e,!0)}),r=t[1];return[t[0],W.useCallback(function(i){r(typeof i=="function"?TI(i):Fo(i))},[])]}const PI=process.env.NODE_ENV==="development",ac=PI&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:null,CI=(e,t,r)=>{const[i,s]=RI(e),a=W.useRef(null);W.useEffect(()=>{var f;return r&&(a.current=ac==null?void 0:ac.connect({name:r,trace:!0}),(f=a.current)==null||f.init(e)),()=>{var m,y;(y=(m=a.current)==null?void 0:m.disconnect)==null||y.call(m)}},[]);const u=t&&typeof t=="object"?t:{},c=W.useMemo(()=>Object.keys(u).reduce((f,m)=>({...f,[m]:y=>(s(p=>{var g;u[m](p,y),(g=a.current)==null||g.send({type:u[m].name},t0(p))}),c)}),{}),[s]);return{state:i,dispatch:c}};function Xr(e){return typeof e=="function"}function n0(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var uc=n0(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
201
+ }`;var Oe=gh(function(){return $e(T,le+"return "+ee).apply(r,P)});if(Oe.source=ee,ll(Oe))throw Oe;return Oe}function G_(n){return Me(n).toLowerCase()}function K_(n){return Me(n).toUpperCase()}function V_(n,o,l){if(n=Me(n),n&&(l||o===r))return Ed(n);if(!n||!(o=zt(o)))return n;var b=ur(n),_=ur(o),T=_d(b,_),P=Od(b,_)+1;return fn(b,T,P).join("")}function X_(n,o,l){if(n=Me(n),n&&(l||o===r))return n.slice(0,Td(n)+1);if(!n||!(o=zt(o)))return n;var b=ur(n),_=Od(b,ur(o))+1;return fn(b,0,_).join("")}function Y_(n,o,l){if(n=Me(n),n&&(l||o===r))return n.replace(lu,"");if(!n||!(o=zt(o)))return n;var b=ur(n),_=_d(b,ur(o));return fn(b,_).join("")}function J_(n,o){var l=N,b=L;if(Ve(o)){var _="separator"in o?o.separator:_;l="length"in o?Ee(o.length):l,b="omission"in o?zt(o.omission):b}n=Me(n);var T=n.length;if(ei(n)){var P=ur(n);T=P.length}if(l>=T)return n;var I=l-ti(b);if(I<1)return b;var z=P?fn(P,0,I).join(""):n.slice(0,I);if(_===r)return z+b;if(P&&(I+=z.length-I),cl(_)){if(n.slice(I).search(_)){var V,X=z;for(_.global||(_=Au(_.source,Me(qf.exec(_))+"g")),_.lastIndex=0;V=_.exec(X);)var ee=V.index;z=z.slice(0,ee===r?I:ee)}}else if(n.indexOf(zt(_),I)!=I){var se=z.lastIndexOf(_);se>-1&&(z=z.slice(0,se))}return z+b}function Q_(n){return n=Me(n),n&&db.test(n)?n.replace(Wf,Pw):n}var eO=ui(function(n,o,l){return n+(l?" ":"")+o.toUpperCase()}),hl=gp("toUpperCase");function hh(n,o,l){return n=Me(n),o=l?r:o,o===r?_w(n)?$w(n):gw(n):n.match(o)||[]}var gh=Te(function(n,o){try{return Dt(n,r,o)}catch(l){return ll(l)?l:new be(l)}}),tO=Wr(function(n,o){return Nt(o,function(l){l=cr(l),br(n,l,al(n[l],n))}),n});function rO(n){var o=n==null?0:n.length,l=ge();return n=o?Ze(n,function(b){if(typeof b[1]!="function")throw new Yt(u);return[l(b[0]),b[1]]}):[],Te(function(b){for(var _=-1;++_<o;){var T=n[_];if(Dt(T[0],this,b))return Dt(T[1],this,b)}})}function nO(n){return P1(Qt(n,g))}function gl(n){return function(){return n}}function iO(n,o){return n==null||n!==n?o:n}var oO=vp(),sO=vp(!0);function It(n){return n}function ml(n){return Gd(typeof n=="function"?n:Qt(n,g))}function aO(n){return Vd(Qt(n,g))}function uO(n,o){return Xd(n,Qt(o,g))}var lO=Te(function(n,o){return function(l){return ji(l,n,o)}}),cO=Te(function(n,o){return function(l){return ji(n,l,o)}});function vl(n,o,l){var b=ft(o),_=xs(o,b);l==null&&!(Ve(o)&&(_.length||!b.length))&&(l=o,o=n,n=this,_=xs(o,ft(o)));var T=!(Ve(l)&&"chain"in l)||!!l.chain,P=Br(n);return Nt(_,function(I){var z=o[I];n[I]=z,P&&(n.prototype[I]=function(){var V=this.__chain__;if(T||V){var X=n(this.__wrapped__),ee=X.__actions__=Ct(this.__actions__);return ee.push({func:z,args:arguments,thisArg:n}),X.__chain__=V,X}return z.apply(n,on([this.value()],arguments))})}),n}function fO(){return pt._===this&&(pt._=Nw),this}function yl(){}function dO(n){return n=Ee(n),Te(function(o){return Yd(o,n)})}var pO=Ku(Ze),hO=Ku(yd),gO=Ku(bu);function mh(n){return tl(n)?wu(cr(n)):Z1(n)}function mO(n){return function(o){return n==null?r:kn(n,o)}}var vO=bp(),yO=bp(!0);function bl(){return[]}function wl(){return!1}function bO(){return{}}function wO(){return""}function xO(){return!0}function SO(n,o){if(n=Ee(n),n<1||n>ce)return[];var l=ne,b=wt(n,ne);o=ge(o),n-=ne;for(var _=Eu(b,o);++l<n;)o(l);return _}function EO(n){return Se(n)?Ze(n,cr):Wt(n)?[n]:Ct(Mp(Me(n)))}function _O(n){var o=++Fw;return Me(n)+o}var OO=Ts(function(n,o){return n+o},0),AO=Vu("ceil"),TO=Ts(function(n,o){return n/o},1),RO=Vu("floor");function PO(n){return n&&n.length?ws(n,It,Lu):r}function CO(n,o){return n&&n.length?ws(n,ge(o,2),Lu):r}function kO(n){return xd(n,It)}function $O(n,o){return xd(n,ge(o,2))}function IO(n){return n&&n.length?ws(n,It,Nu):r}function LO(n,o){return n&&n.length?ws(n,ge(o,2),Nu):r}var MO=Ts(function(n,o){return n*o},1),FO=Vu("round"),DO=Ts(function(n,o){return n-o},0);function NO(n){return n&&n.length?Su(n,It):0}function jO(n,o){return n&&n.length?Su(n,ge(o,2)):0}return A.after=uE,A.ary=Zp,A.assign=VE,A.assignIn=sh,A.assignInWith=ah,A.assignWith=fl,A.at=XE,A.before=Gp,A.bind=al,A.bindAll=tO,A.bindKey=Kp,A.castArray=wE,A.chain=Bp,A.chunk=Px,A.compact=Cx,A.concat=kx,A.cond=rO,A.conforms=nO,A.constant=gl,A.countBy=jS,A.create=YE,A.curry=Vp,A.curryRight=Xp,A.debounce=Yp,A.defaults=JE,A.defaultsDeep=QE,A.defer=lE,A.delay=cE,A.difference=$x,A.differenceBy=Ix,A.differenceWith=Lx,A.drop=Mx,A.dropRight=Fx,A.dropRightWhile=Dx,A.dropWhile=Nx,A.fill=jx,A.filter=WS,A.flatMap=HS,A.flatMapDeep=qS,A.flatMapDepth=ZS,A.flatten=jp,A.flattenDeep=zx,A.flattenDepth=Wx,A.flip=fE,A.flow=oO,A.flowRight=sO,A.fromPairs=Ux,A.functions=s_,A.functionsIn=a_,A.groupBy=GS,A.initial=Hx,A.intersection=qx,A.intersectionBy=Zx,A.intersectionWith=Gx,A.invert=l_,A.invertBy=c_,A.invokeMap=VS,A.iteratee=ml,A.keyBy=XS,A.keys=ft,A.keysIn=$t,A.map=Ls,A.mapKeys=d_,A.mapValues=p_,A.matches=aO,A.matchesProperty=uO,A.memoize=Fs,A.merge=h_,A.mergeWith=uh,A.method=lO,A.methodOf=cO,A.mixin=vl,A.negate=Ds,A.nthArg=dO,A.omit=g_,A.omitBy=m_,A.once=dE,A.orderBy=YS,A.over=pO,A.overArgs=pE,A.overEvery=hO,A.overSome=gO,A.partial=ul,A.partialRight=Jp,A.partition=JS,A.pick=v_,A.pickBy=lh,A.property=mh,A.propertyOf=mO,A.pull=Yx,A.pullAll=Wp,A.pullAllBy=Jx,A.pullAllWith=Qx,A.pullAt=eS,A.range=vO,A.rangeRight=yO,A.rearg=hE,A.reject=tE,A.remove=tS,A.rest=gE,A.reverse=ol,A.sampleSize=nE,A.set=b_,A.setWith=w_,A.shuffle=iE,A.slice=rS,A.sortBy=aE,A.sortedUniq=lS,A.sortedUniqBy=cS,A.split=B_,A.spread=mE,A.tail=fS,A.take=dS,A.takeRight=pS,A.takeRightWhile=hS,A.takeWhile=gS,A.tap=CS,A.throttle=vE,A.thru=Is,A.toArray=nh,A.toPairs=ch,A.toPairsIn=fh,A.toPath=EO,A.toPlainObject=oh,A.transform=x_,A.unary=yE,A.union=mS,A.unionBy=vS,A.unionWith=yS,A.uniq=bS,A.uniqBy=wS,A.uniqWith=xS,A.unset=S_,A.unzip=sl,A.unzipWith=Up,A.update=E_,A.updateWith=__,A.values=fi,A.valuesIn=O_,A.without=SS,A.words=hh,A.wrap=bE,A.xor=ES,A.xorBy=_S,A.xorWith=OS,A.zip=AS,A.zipObject=TS,A.zipObjectDeep=RS,A.zipWith=PS,A.entries=ch,A.entriesIn=fh,A.extend=sh,A.extendWith=ah,vl(A,A),A.add=OO,A.attempt=gh,A.camelCase=P_,A.capitalize=dh,A.ceil=AO,A.clamp=A_,A.clone=xE,A.cloneDeep=EE,A.cloneDeepWith=_E,A.cloneWith=SE,A.conformsTo=OE,A.deburr=ph,A.defaultTo=iO,A.divide=TO,A.endsWith=C_,A.eq=fr,A.escape=k_,A.escapeRegExp=$_,A.every=zS,A.find=US,A.findIndex=Dp,A.findKey=e_,A.findLast=BS,A.findLastIndex=Np,A.findLastKey=t_,A.floor=RO,A.forEach=Hp,A.forEachRight=qp,A.forIn=r_,A.forInRight=n_,A.forOwn=i_,A.forOwnRight=o_,A.get=dl,A.gt=AE,A.gte=TE,A.has=u_,A.hasIn=pl,A.head=zp,A.identity=It,A.includes=KS,A.indexOf=Bx,A.inRange=T_,A.invoke=f_,A.isArguments=Ln,A.isArray=Se,A.isArrayBuffer=RE,A.isArrayLike=kt,A.isArrayLikeObject=rt,A.isBoolean=PE,A.isBuffer=dn,A.isDate=CE,A.isElement=kE,A.isEmpty=$E,A.isEqual=IE,A.isEqualWith=LE,A.isError=ll,A.isFinite=ME,A.isFunction=Br,A.isInteger=Qp,A.isLength=Ns,A.isMap=eh,A.isMatch=FE,A.isMatchWith=DE,A.isNaN=NE,A.isNative=jE,A.isNil=WE,A.isNull=zE,A.isNumber=th,A.isObject=Ve,A.isObjectLike=et,A.isPlainObject=qi,A.isRegExp=cl,A.isSafeInteger=UE,A.isSet=rh,A.isString=js,A.isSymbol=Wt,A.isTypedArray=ci,A.isUndefined=BE,A.isWeakMap=HE,A.isWeakSet=qE,A.join=Kx,A.kebabCase=I_,A.last=tr,A.lastIndexOf=Vx,A.lowerCase=L_,A.lowerFirst=M_,A.lt=ZE,A.lte=GE,A.max=PO,A.maxBy=CO,A.mean=kO,A.meanBy=$O,A.min=IO,A.minBy=LO,A.stubArray=bl,A.stubFalse=wl,A.stubObject=bO,A.stubString=wO,A.stubTrue=xO,A.multiply=MO,A.nth=Xx,A.noConflict=fO,A.noop=yl,A.now=Ms,A.pad=F_,A.padEnd=D_,A.padStart=N_,A.parseInt=j_,A.random=R_,A.reduce=QS,A.reduceRight=eE,A.repeat=z_,A.replace=W_,A.result=y_,A.round=FO,A.runInContext=j,A.sample=rE,A.size=oE,A.snakeCase=U_,A.some=sE,A.sortedIndex=nS,A.sortedIndexBy=iS,A.sortedIndexOf=oS,A.sortedLastIndex=sS,A.sortedLastIndexBy=aS,A.sortedLastIndexOf=uS,A.startCase=H_,A.startsWith=q_,A.subtract=DO,A.sum=NO,A.sumBy=jO,A.template=Z_,A.times=SO,A.toFinite=Hr,A.toInteger=Ee,A.toLength=ih,A.toLower=G_,A.toNumber=rr,A.toSafeInteger=KE,A.toString=Me,A.toUpper=K_,A.trim=V_,A.trimEnd=X_,A.trimStart=Y_,A.truncate=J_,A.unescape=Q_,A.uniqueId=_O,A.upperCase=eO,A.upperFirst=hl,A.each=Hp,A.eachRight=qp,A.first=zp,vl(A,(function(){var n={};return wr(A,function(o,l){Le.call(A.prototype,l)||(n[l]=o)}),n})(),{chain:!1}),A.VERSION=i,Nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){A[n].placeholder=A}),Nt(["drop","take"],function(n,o){Pe.prototype[n]=function(l){l=l===r?1:lt(Ee(l),0);var b=this.__filtered__&&!o?new Pe(this):this.clone();return b.__filtered__?b.__takeCount__=wt(l,b.__takeCount__):b.__views__.push({size:wt(l,ne),type:n+(b.__dir__<0?"Right":"")}),b},Pe.prototype[n+"Right"]=function(l){return this.reverse()[n](l).reverse()}}),Nt(["filter","map","takeWhile"],function(n,o){var l=o+1,b=l==k||l==J;Pe.prototype[n]=function(_){var T=this.clone();return T.__iteratees__.push({iteratee:ge(_,3),type:l}),T.__filtered__=T.__filtered__||b,T}}),Nt(["head","last"],function(n,o){var l="take"+(o?"Right":"");Pe.prototype[n]=function(){return this[l](1).value()[0]}}),Nt(["initial","tail"],function(n,o){var l="drop"+(o?"":"Right");Pe.prototype[n]=function(){return this.__filtered__?new Pe(this):this[l](1)}}),Pe.prototype.compact=function(){return this.filter(It)},Pe.prototype.find=function(n){return this.filter(n).head()},Pe.prototype.findLast=function(n){return this.reverse().find(n)},Pe.prototype.invokeMap=Te(function(n,o){return typeof n=="function"?new Pe(this):this.map(function(l){return ji(l,n,o)})}),Pe.prototype.reject=function(n){return this.filter(Ds(ge(n)))},Pe.prototype.slice=function(n,o){n=Ee(n);var l=this;return l.__filtered__&&(n>0||o<0)?new Pe(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),o!==r&&(o=Ee(o),l=o<0?l.dropRight(-o):l.take(o-n)),l)},Pe.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Pe.prototype.toArray=function(){return this.take(ne)},wr(Pe.prototype,function(n,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),b=/^(?:head|last)$/.test(o),_=A[b?"take"+(o=="last"?"Right":""):o],T=b||/^find/.test(o);_&&(A.prototype[o]=function(){var P=this.__wrapped__,I=b?[1]:arguments,z=P instanceof Pe,V=I[0],X=z||Se(P),ee=function(Re){var Ce=_.apply(A,on([Re],I));return b&&se?Ce[0]:Ce};X&&l&&typeof V=="function"&&V.length!=1&&(z=X=!1);var se=this.__chain__,le=!!this.__actions__.length,me=T&&!se,Oe=z&&!le;if(!T&&X){P=Oe?P:new Pe(this);var pe=n.apply(P,I);return pe.__actions__.push({func:Is,args:[ee],thisArg:r}),new Jt(pe,se)}return me&&Oe?n.apply(this,I):(pe=this.thru(ee),me?b?pe.value()[0]:pe.value():pe)})}),Nt(["pop","push","shift","sort","splice","unshift"],function(n){var o=os[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",b=/^(?:pop|shift)$/.test(n);A.prototype[n]=function(){var _=arguments;if(b&&!this.__chain__){var T=this.value();return o.apply(Se(T)?T:[],_)}return this[l](function(P){return o.apply(Se(P)?P:[],_)})}}),wr(Pe.prototype,function(n,o){var l=A[o];if(l){var b=l.name+"";Le.call(oi,b)||(oi[b]=[]),oi[b].push({name:o,func:l})}}),oi[As(r,S).name]=[{name:"wrapper",func:r}],Pe.prototype.clone=e1,Pe.prototype.reverse=t1,Pe.prototype.value=r1,A.prototype.at=kS,A.prototype.chain=$S,A.prototype.commit=IS,A.prototype.next=LS,A.prototype.plant=FS,A.prototype.reverse=DS,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=NS,A.prototype.first=A.prototype.head,$i&&(A.prototype[$i]=MS),A}),ri=Iw();An?((An.exports=ri)._=ri,gu._=ri):pt._=ri}).call(x$)})(bo,bo.exports)),bo.exports}var Ye=S$();const Rc={FdSave:tt.FdSave,FdWarningDanger:tt.FdWarningDanger,FdInfoCircle:tt.FdInfoCircle,FdInfoBold:tt.FdInfoBold};var Sf=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))(Sf||{}),Bn=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Bn||{}),vi=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(vi||{});const zy={[Bn.PRIMARY]:{icon:"blue-500",button:"primary-dark"},[Bn.DANGER]:{icon:"red-500",button:"primary-dark"},[Bn.WARNING]:{icon:"yellow-400",button:"primary-dark"}},Ql=({color:e=Bn.PRIMARY,variant:t="solid",children:r,autoFocus:i,...s})=>{const a=zy[e].button,u=t==="outlined"?`bg-transparent text-white border border-white hover:border-white hover:bg-white hover:text-${a}`:`text-white bg-${a} border border-${a} hover:border-white hover:bg-primary-hover hover:text-white`;return F.jsx("button",{autoFocus:i,className:He("w-16 rounded px-2 py-1 text-xs font-medium hover:font-bold focus:outline-none",u),...s,children:r})},E$=({name:e,color:t=Bn.PRIMARY,className:r="w-8 h-8"})=>{const i=Rc[e]||Rc.FdInfoCircle,s=`text-${zy[t].icon}`;return F.jsx(i,{className:He(r,s)})},_$=({id:e,title:t,message:r,icon:i,type:s,color:a,zIndex:u=3e3,views:c,width:f=520,hasOverlay:m=!0,container:y,onClose:p,onEdit:g})=>{const v=w=>{p({id:e,reason:w})};W.useEffect(()=>{function w(h){h.key==="Escape"&&v(vi.CANCELED)}return window.addEventListener("keyup",w),()=>{window.removeEventListener("keyup",w)}},[]);const x=Ye.merge(Ye.values(c==null?void 0:c.toggles).flatMap(w=>w.value?w.warnings||[]:[]),c==null?void 0:c.tips),d=(w,h)=>{var E;if(!(c!=null&&c.toggles))return;const S=Ye.cloneDeep(c);(E=S.toggles)!=null&&E[w]&&(S.toggles[w].value=h),g({id:e,views:S})};return zo.createPortal(F.jsx(_a,{appear:!0,show:!0,as:W.Fragment,children:F.jsx("div",{className:He("absolute inset-0 flex h-full w-full items-center justify-center overflow-y-auto",{"bg-black bg-opacity-80":m}),style:{zIndex:u},onClick:()=>v(vi.CANCELED),children:F.jsx(_a.Child,{as:W.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:F.jsx("div",{"data-cy":"confirmation-modal-cy",className:"relative rounded-md border border-grey-50 bg-grey-900",style:{width:f},onClick:w=>w.stopPropagation(),children:F.jsxs("div",{className:"flex flex-col items-center gap-3 p-6 px-12",children:[i?F.jsx("div",{className:"flex items-center justify-center",children:F.jsx(E$,{name:i,color:a,className:"w-6 h-6"})}):null,F.jsx(O$,{condition:t,children:F.jsx("h4",{className:"w-full text-wrap text-lg font-bold leading-6 text-white text-center",children:t})}),F.jsx("p",{className:"w-full text-wrap text-center text-sm font-medium text-white",children:r}),F.jsx("div",{className:"text-xs text-white",children:Ye.values(c==null?void 0:c.toggles).map(w=>F.jsx("div",{children:F.jsxs("label",{htmlFor:w.key,className:"flex items-center",children:[F.jsx(Oy,{size:"xs",value:w.value,onChange:h=>d(w.key,h)}),F.jsx("span",{className:"ml-1",children:w.title})]})},w.key))}),F.jsx(A$,{warnings:x}),F.jsx("div",{className:"flex items-center gap-4",children:s===Sf.CONFIRM?F.jsxs(F.Fragment,{children:[F.jsx(Ql,{autoFocus:!0,color:a,onClick:()=>v(vi.CONFIRMED),children:"Confirm"}),F.jsx(Ql,{color:a,variant:"outlined",onClick:()=>v(vi.CANCELED),children:"Cancel"})]}):F.jsx(Ql,{autoFocus:!0,onClick:()=>v(),children:"OK"})})]})})})})}),y||document.body)},O$=e=>e.condition?F.jsx(F.Fragment,{children:e.children}):null,A$=e=>e.warnings?F.jsx(_a,{appear:!0,show:!!e.warnings.length,as:W.Fragment,children:F.jsx("div",{className:"flex flex-col gap-1 rounded-sm bg-grey-600 p-2 text-xs text-white",children:e.warnings.map((t,r)=>F.jsx(_a.Child,{as:W.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:F.jsxs("div",{className:"flex flex-1 items-center gap-1 rounded-sm px-2 py-1",children:[F.jsx(tt.FdWarningDanger,{className:He({"h-3 w-3":!0,"text-yellow-500":t.type==="warning","text-red-400":t.type==="error","text-primary-dark":t.type==="info"},"mr-3")}),F.jsx("div",{className:"flex-1",children:t.message})]})},`modal-warnings-${r}`))})}):null;var Wy=(e=>(e[e.MIN=.5]="MIN",e[e.MAX=10]="MAX",e[e.STEP=.5]="STEP",e[e.INIT=1]="INIT",e[e.TRANSITION=200]="TRANSITION",e))(Wy||{});const T$=({zoom:e,minZoom:t=.5,maxZoom:r=10,handleZoomIn:i,handleZoomOut:s})=>F.jsxs("div",{className:"flex items-center rounded bg-grey-300 p-1",children:[F.jsx(tt.FdMinusNaked,{onClick:s,className:He("h-5 w-5 p-1",{"text-grey-200":e<=t,"cursor-pointer rounded hover:bg-purple-800":e>t})}),F.jsxs("span",{className:"mx-1 w-10 select-none text-center text-xs",children:[(e*100).toFixed(0),"%"]}),F.jsx(tt.FdPlusNaked,{onClick:i,className:He("h-5 w-5 p-1",{"text-grey-200":e>=r,"cursor-pointer rounded hover:bg-purple-800":e<r})})]}),R$=$.forwardRef(((e,t)=>$.createElement(_n.span,Qe({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))),P$=R$;function Em(e){const t=$.useRef({value:e,previous:e});return $.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}const[Uy]=rf("Tooltip",[Wa]),Ef=Wa(),C$=700,[qM,k$]=Uy("TooltipProvider",{isOpenDelayed:!0,delayDuration:C$,onOpen:()=>{},onClose:()=>{}}),[$$,Ga]=Uy("Tooltip"),I$=e=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:s=!1,onOpenChange:a,delayDuration:u}=e,c=k$("Tooltip",t),f=Ef(t),[m,y]=$.useState(null),p=Uv(),g=$.useRef(0),v=u??c.delayDuration,x=$.useRef(!1),{onOpen:d,onClose:w}=c,[h=!1,S]=ey({prop:i,defaultProp:s,onChange:C=>{C&&(document.dispatchEvent(new CustomEvent("tooltip.open")),d()),a==null||a(C)}}),E=$.useMemo((()=>h?x.current?"delayed-open":"instant-open":"closed"),[h]),R=$.useCallback((()=>{window.clearTimeout(g.current),x.current=!1,S(!0)}),[S]),O=$.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{x.current=!0,S(!0)}),v)}),[v,S]);return $.useEffect((()=>()=>window.clearTimeout(g.current)),[]),$.createElement(Yv,f,$.createElement($$,{scope:t,contentId:p,open:h,stateAttribute:E,trigger:m,onTriggerChange:y,onTriggerEnter:$.useCallback((()=>{c.isOpenDelayed?O():R()}),[c.isOpenDelayed,O,R]),onOpen:$.useCallback(R,[R]),onClose:$.useCallback((()=>{window.clearTimeout(g.current),S(!1),w()}),[S,w])},r))},L$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,...i}=e,s=Ga("TooltipTrigger",r),a=Ef(r),u=En(t,s.onTriggerChange),c=$.useRef(!1),f=$.useCallback((()=>c.current=!1),[]);return $.useEffect((()=>()=>document.removeEventListener("mouseup",f)),[f]),$.createElement(Jv,Qe({asChild:!0},a),$.createElement(_n.button,Qe({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},i,{ref:u,onMouseEnter:qt(e.onMouseEnter,s.onTriggerEnter),onMouseLeave:qt(e.onMouseLeave,s.onClose),onMouseDown:qt(e.onMouseDown,(()=>{s.onClose(),c.current=!0,document.addEventListener("mouseup",f,{once:!0})})),onFocus:qt(e.onFocus,(()=>{c.current||s.onOpen()})),onBlur:qt(e.onBlur,s.onClose),onClick:qt(e.onClick,(m=>{m.detail===0&&s.onClose()}))})))})),M$=$.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,s=Ga("TooltipContent",e.__scopeTooltip);return $.createElement(ef,{present:r||s.open},$.createElement(F$,Qe({ref:t},i)))})),F$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:i,"aria-label":s,portalled:a=!0,...u}=e,c=Ga("TooltipContent",r),f=Ef(r),m=a?tf:$.Fragment,{onClose:y}=c;return Zv((()=>y())),$.useEffect((()=>(document.addEventListener("tooltip.open",y),()=>document.removeEventListener("tooltip.open",y))),[y]),$.createElement(m,null,$.createElement(D$,{__scopeTooltip:r}),$.createElement(Qv,Qe({"data-state":c.stateAttribute},f,u,{ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),$.createElement(qv,null,i),$.createElement(P$,{id:c.contentId,role:"tooltip"},s||i)))}));function D$(e){const{__scopeTooltip:t}=e,r=Ga("CheckTriggerMoved",t),i=Kv(r.trigger),s=i==null?void 0:i.left,a=Em(s),u=i==null?void 0:i.top,c=Em(u),f=r.onClose;return $.useEffect((()=>{(a!==void 0&&a!==s||c!==void 0&&c!==u)&&f()}),[f,a,c,s,u]),null}const N$=I$,j$=L$,z$=M$;function W$(e){return F.jsxs(N$,{delayDuration:e.delayDuration,open:e.open,children:[F.jsx(j$,{tabIndex:-1,asChild:!0,children:F.jsx("span",{children:e.children})}),F.jsxs(z$,{side:e.side,sideOffset:e.sideOffset,alignOffset:e.alignOffset,children:[typeof e.message=="string"&&F.jsx("p",{className:"max-w-[240px] rounded-md bg-primary-light px-1 py-2 text-s font-semibold text-primary-dark",children:e.message}),typeof e.message!="string"&&e.message]})]})}const Or=30,By=.3,Hy=.6,U$=()=>typeof window>"u"?400:Math.round(window.innerHeight*By),qy=()=>typeof window>"u"?600:Math.round(window.innerHeight*Hy),_m=e=>{const t=qy();return Math.min(Math.max(e,Or),t)},B$=()=>F.jsx("div",{className:"h-2 w-full bg-opacity-40 hover:bg-primary-hover"}),H$=e=>{const[t,r]=W.useState(Or),i=W.useRef(),s=W.useRef(null),a=qy(),u=U$(),c=t>Or;W.useEffect(()=>{r(e.isOpen?u:Or)},[e.isOpen,u]),W.useEffect(()=>{const m=()=>{r(y=>y<=Or?Or:_m(y))};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m),s.current&&cancelAnimationFrame(s.current)}},[]);const f=()=>{if(c){r(Or),e.onClose();return}r(u),e.onOpen()};return F.jsx("div",{className:"relative w-full select-none isolate",style:{zIndex:49},children:F.jsx(UO.Resizable,{enable:{top:!0,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},className:"w-full select-none border-t border-grey-900 bg-grey-800",size:{height:t,width:"100%"},maxHeight:a,minHeight:Or,onResizeStart:()=>{i.current&&Date.now()-i.current<200?r(c?Or:u):i.current=Date.now()},onResize:(m,y,p)=>{s.current&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{var g;(g=e.onResize)==null||g.call(e),s.current=null})},onResizeStop:(m,y,p,g)=>{r(v=>_m(v+g.height))},handleComponent:{top:F.jsx(B$,{})},children:F.jsxs("div",{"data-cy":"contextualPanel",className:"absolute inset-0 flex flex-col overflow-hidden",id:`__cp-${Ye.kebabCase(e.path)}`,children:[F.jsxs("div",{className:He("flex justify-between items-center px-3 py-0.5",{"flex-1":!c}),children:[F.jsxs("div",{className:"group flex items-center justify-start",children:[F.jsx("span",{className:"mr-2 text-sm text-fd-gray-lighter",children:"Contextual panel"}),e.tipKey?F.jsx(py,{tipKey:e.tipKey,alwaysOn:!0,asButton:!0}):null,F.jsx("button",{"data-cy":`contextualPanel-toggle-button-${c?"close":"open"}`,className:"rounded p-1 text-white hover:bg-primary-hover focus:outline-none",onClick:f,children:c?F.jsx(tt.FdDoubleArrowDown,{className:"h-4 w-4 text-white"}):F.jsx(tt.FdDoubleArrowUp,{className:"h-4 w-4 text-white"})})]}),e.headerRightSide]}),F.jsxs(fa,{of:c,children:[F.jsx(fa,{of:e.render,children:e.render}),F.jsx(fa,{of:!e.render,children:e.children})]})]})})})};function Zy({children:e,viewBox:t="0 0 24 24",...r}){return F.jsx("svg",{viewBox:t,width:"1em",height:"1em",fill:"none",className:"base-icon",...r,children:e})}function Gy(e){const t=e.isIndeterminate?"M2 12h20":"M4 11.5L9 17L20 6";return F.jsx(Zy,{viewBox:"0 0 24 24",...e,children:F.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",d:t})})}function q$({isChecked:e,isIndeterminate:t,isInvalid:r,icon:i,label:s,className:a="",style:u,...c}){const f=W.useRef(null),m=i||F.jsx(Gy,{}),y=c.checked??e;W.useEffect(()=>{f.current&&(f.current.indeterminate=!!t)},[t]);const p=y||t,g=["base-checkbox-container",a].join(" ");return F.jsxs("label",{className:g,style:u,"data-invalid":r,children:[F.jsx("input",{ref:f,type:"checkbox",className:"base-checkbox-input",checked:y,...c,"aria-invalid":r||void 0}),F.jsx("span",{className:"base-checkbox-control",children:p&&m&&W.cloneElement(m,{isChecked:y,isIndeterminate:t,className:"base-checkbox-icon"})}),s&&F.jsx("span",{className:"base-checkbox-label",children:s})]})}const Z$=({title:e="Invalid page structure",error:t,onClose:r,onOpenInTextEditor:i,onReset:s,resetButtonLabel:a="Reset Page"})=>F.jsx("div",{className:"flex h-full w-full items-center justify-center",children:F.jsxs("div",{className:"flex flex-col items-center rounded bg-grey-300 px-10 py-6 text-center shadow-md",children:[F.jsxs("div",{className:"relative",children:[F.jsx(tt.FdSanityCheckDefault,{className:"relative z-20 h-12 w-12 text-red-500 rounded-full"}),F.jsx("div",{className:"w-1/2 h-1/2 absolute z-0 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white"})]}),F.jsx("p",{className:"mb-2 mt-4 text-2xl text-white",children:e}),F.jsx("p",{className:"text-md mb-4 font-extralight text-grey-100",children:t}),F.jsxs("div",{className:"flex gap-4",children:[i&&F.jsx("button",{className:"text-md rounded border border-primary-dark hover:border-primary-hover bg-primary-dark hover:bg-primary-hover px-3 py-1 text-white focus:outline-none",onClick:i,children:"Open in Text Editor"}),s&&F.jsx("button",{className:"text-md rounded border border-red-500 bg-red-500 hover:bg-red-400 focus:ring-red-500 px-3 py-1 text-white focus:outline-none",onClick:s,children:a}),r&&F.jsx("button",{className:"text-md rounded border border-grey-50 bg-transparent hover:bg-grey-50 text-white hover:text-primary-dark px-3 py-1 focus:outline-none",onClick:r,children:"Close"})]})]})});function G$(e,t){const r=W.useRef(!1);W.useEffect(()=>{if(r.current)return e();r.current=!0},t)}const ec=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function tc(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),r)}function mo(e,t,r,i){e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent&&e.detachEvent("on".concat(t),r)}function Ky(e,t){const r=t.slice(0,t.length-1);for(let i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function Vy(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function K$(e,t){const r=e.length>=t.length?e:t,i=e.length>=t.length?t:e;let s=!0;for(let a=0;a<r.length;a++)i.indexOf(r[a])===-1&&(s=!1);return s}const Io={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ec?173:189,"=":ec?61:187,";":ec?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},vr={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},wo={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},vt={16:!1,18:!1,17:!1,91:!1},Je={};for(let e=1;e<20;e++)Io["f".concat(e)]=111+e;let Ke=[],Po=null,Xy="all";const Gr=new Map,Pi=e=>Io[e.toLowerCase()]||vr[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),V$=e=>Object.keys(Io).find(t=>Io[t]===e),X$=e=>Object.keys(vr).find(t=>vr[t]===e);function Yy(e){Xy=e||"all"}function Lo(){return Xy||"all"}function Y$(){return Ke.slice(0)}function J$(){return Ke.map(e=>V$(e)||X$(e)||String.fromCharCode(e))}function Q$(){const e=[];return Object.keys(Je).forEach(t=>{Je[t].forEach(r=>{let{key:i,scope:s,mods:a,shortcut:u}=r;e.push({scope:s,shortcut:u,mods:a,keys:i.split("+").map(c=>Pi(c))})})}),e}function eI(e){const t=e.target||e.srcElement,{tagName:r}=t;let i=!0;const s=r==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(s||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function tI(e){return typeof e=="string"&&(e=Pi(e)),Ke.indexOf(e)!==-1}function rI(e,t){let r,i;e||(e=Lo());for(const s in Je)if(Object.prototype.hasOwnProperty.call(Je,s))for(r=Je[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1).forEach(u=>{let{element:c}=u;return _f(c)}):i++;Lo()===e&&Yy(t||"all")}function nI(e){let t=e.keyCode||e.which||e.charCode;e.key&&e.key.toLowerCase()==="capslock"&&(t=Pi(e.key));const r=Ke.indexOf(t);if(r>=0&&Ke.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&Ke.splice(0,Ke.length),(t===93||t===224)&&(t=91),t in vt){vt[t]=!1;for(const i in vr)vr[i]===t&&(mr[i]=!1)}}function Jy(e){if(typeof e>"u")Object.keys(Je).forEach(s=>{Array.isArray(Je[s])&&Je[s].forEach(a=>na(a)),delete Je[s]}),_f(null);else if(Array.isArray(e))e.forEach(s=>{s.key&&na(s)});else if(typeof e=="object")e.key&&na(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let[s,a]=r;typeof s=="function"&&(a=s,s=""),na({key:e,scope:s,method:a,splitKey:"+"})}}const na=e=>{let{key:t,scope:r,method:i,splitKey:s="+"}=e;Vy(t).forEach(u=>{const c=u.split(s),f=c.length,m=c[f-1],y=m==="*"?"*":Pi(m);if(!Je[y])return;r||(r=Lo());const p=f>1?Ky(vr,c):[],g=[];Je[y]=Je[y].filter(v=>{const d=(i?v.method===i:!0)&&v.scope===r&&K$(v.mods,p);return d&&g.push(v.element),!d}),g.forEach(v=>_f(v))})};function Om(e,t,r,i){if(t.element!==i)return;let s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(const a in vt)Object.prototype.hasOwnProperty.call(vt,a)&&(!vt[a]&&t.mods.indexOf(+a)>-1||vt[a]&&t.mods.indexOf(+a)===-1)&&(s=!1);(t.mods.length===0&&!vt[16]&&!vt[18]&&!vt[17]&&!vt[91]||s||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(Ke),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Am(e,t){const r=Je["*"];let i=e.keyCode||e.which||e.charCode;if(e.key&&e.key.toLowerCase()==="capslock"||!mr.filter.call(this,e))return;if((i===93||i===224)&&(i=91),Ke.indexOf(i)===-1&&i!==229&&Ke.push(i),["metaKey","ctrlKey","altKey","shiftKey"].forEach(c=>{const f=wo[c];e[c]&&Ke.indexOf(f)===-1?Ke.push(f):!e[c]&&Ke.indexOf(f)>-1?Ke.splice(Ke.indexOf(f),1):c==="metaKey"&&e[c]&&(Ke=Ke.filter(m=>m in wo||m===i))}),i in vt){vt[i]=!0;for(const c in vr)if(Object.prototype.hasOwnProperty.call(vr,c)){const f=wo[vr[c]];mr[c]=e[f]}if(!r)return}for(const c in vt)Object.prototype.hasOwnProperty.call(vt,c)&&(vt[c]=e[wo[c]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ke.indexOf(17)===-1&&Ke.push(17),Ke.indexOf(18)===-1&&Ke.push(18),vt[17]=!0,vt[18]=!0);const s=Lo();if(r)for(let c=0;c<r.length;c++)r[c].scope===s&&(e.type==="keydown"&&r[c].keydown||e.type==="keyup"&&r[c].keyup)&&Om(e,r[c],s,t);if(!(i in Je))return;const a=Je[i],u=a.length;for(let c=0;c<u;c++)if((e.type==="keydown"&&a[c].keydown||e.type==="keyup"&&a[c].keyup)&&a[c].key){const f=a[c],{splitKey:m}=f,y=f.key.split(m),p=[];for(let g=0;g<y.length;g++)p.push(Pi(y[g]));p.sort().join("")===Ke.sort().join("")&&Om(e,f,s,t)}}function mr(e,t,r){Ke=[];const i=Vy(e);let s=[],a="all",u=document,c=0,f=!1,m=!0,y="+",p=!1,g=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(u=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(m=t.keydown),t.capture!==void 0&&(p=t.capture),typeof t.splitKey=="string"&&(y=t.splitKey),t.single===!0&&(g=!0)),typeof t=="string"&&(a=t),g&&Jy(e,a);c<i.length;c++)e=i[c].split(y),s=[],e.length>1&&(s=Ky(vr,e)),e=e[e.length-1],e=e==="*"?"*":Pi(e),e in Je||(Je[e]=[]),Je[e].push({keyup:f,keydown:m,scope:a,mods:s,shortcut:i[c],method:r,key:i[c],splitKey:y,element:u});if(typeof u<"u"&&window){if(!Gr.has(u)){const v=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Am(d,u)},x=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Am(d,u),nI(d)};Gr.set(u,{keydownListener:v,keyupListenr:x,capture:p}),tc(u,"keydown",v,p),tc(u,"keyup",x,p)}if(!Po){const v=()=>{Ke=[]};Po={listener:v,capture:p},tc(window,"focus",v,p)}}}function iI(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Je).forEach(r=>{Je[r].filter(s=>s.scope===t&&s.shortcut===e).forEach(s=>{s&&s.method&&s.method()})})}function _f(e){const t=Object.values(Je).flat();if(t.findIndex(i=>{let{element:s}=i;return s===e})<0){const{keydownListener:i,keyupListenr:s,capture:a}=Gr.get(e)||{};i&&s&&(mo(e,"keyup",s,a),mo(e,"keydown",i,a),Gr.delete(e))}if((t.length<=0||Gr.size<=0)&&(Object.keys(Gr).forEach(s=>{const{keydownListener:a,keyupListenr:u,capture:c}=Gr.get(s)||{};a&&u&&(mo(s,"keyup",u,c),mo(s,"keydown",a,c),Gr.delete(s))}),Gr.clear(),Object.keys(Je).forEach(s=>delete Je[s]),Po)){const{listener:s,capture:a}=Po;mo(window,"focus",s,a),Po=null}}const rc={getPressedKeyString:J$,setScope:Yy,getScope:Lo,deleteScope:rI,getPressedKeyCodes:Y$,getAllKeyCodes:Q$,isPressed:tI,filter:eI,trigger:iI,unbind:Jy,keyMap:Io,modifier:vr,modifierMap:wo};for(const e in rc)Object.prototype.hasOwnProperty.call(rc,e)&&(mr[e]=rc[e]);if(typeof window<"u"){const e=window.hotkeys;mr.noConflict=t=>(t&&window.hotkeys===mr&&(window.hotkeys=e),mr),window.hotkeys=mr}mr.filter=()=>!0;function oI(e,t,r,i){r instanceof Array&&(i=r,r=void 0),i=i||[],r=r||{};const{preventDefault:s=!0}=r,a=W.useCallback((c,f)=>{s&&c.preventDefault(),setTimeout(()=>t(c,f))},i),u=()=>{mr.unbind(e,a)};W.useEffect(()=>(mr(e,r,a),u),[e,r,a])}const sI=(e,t="click")=>{const r=W.useRef(null);return W.useEffect(()=>{const i=s=>{r.current&&!r.current.contains(s.target)&&e(s)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[e,t]),r};function aI(e){const t=W.useRef();return W.useEffect(()=>{t.current=e},[e]),t.current}function uI(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e},[e]),t}function lI(e){const t=W.useRef(null);return W.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t}function cI(e){const[t,r]=W.useState(e),i=(a,u)=>{r(c=>({...c,features:{...c.features,[a]:{enabled:u}}}))},s=W.useCallback((...a)=>a.every(u=>{var c;return(c=t.features[u])==null?void 0:c.enabled}),[t.features]);return{setFeature:i,isFeatureEnabled:s}}const Qy=W.createContext(""),fI=e=>F.jsx(Qy.Provider,{value:e.value,children:e.children}),dI=()=>{const e=W.useContext(Qy);if(typeof e!="string")throw new Error("Error while calling useIdentity! Context has incorrect type (expected string)");return e};function pI(e){const[t,r]=W.useState(e),i=W.useMemo(()=>hI(t,r),[]);return{state:t,actions:{...i,set:s=>{r(typeof s=="function"?s:a=>({...a,...s}))}}}}function hI(e,t=()=>{}){return Object.keys(e).reduce((i,s)=>({...i,[`set${Ye.upperFirst(s)}`]:a=>t(u=>({...u,[s]:a}))}),{})}const gI=(e,t,r={})=>{r={timeout:200,...r};const i=W.useRef(),s=()=>{i.current&&(clearTimeout(i.current),i.current=null)};return W.useCallback((a,...u)=>{s(),t&&a.detail===1&&(i.current=setTimeout(()=>{t(a,...u)},r.timeout)),a.detail%2===0&&e(a,...u)},[t,e,r.timeout])};function yt(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(process.env.NODE_ENV!=="production"){var s=SI[e],a=s?typeof s=="function"?s.apply(null,r):s:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(u){return"'"+u+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ti(e){return!!e&&!!e[Kt]}function Gn(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var i=Object.getPrototypeOf(r);if(i===null)return!0;var s=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return s===Object||typeof s=="function"&&Function.toString.call(s)===EI})(e)||Array.isArray(e)||!!e[Lm]||!!(!((t=e.constructor)===null||t===void 0)&&t[Lm])||Of(e)||Af(e))}function Mo(e,t,r){r===void 0&&(r=!1),Ci(e)===0?(r?Object.keys:Cf)(e).forEach((function(i){r&&typeof i=="symbol"||t(i,e[i],e)})):e.forEach((function(i,s){return t(s,i,e)}))}function Ci(e){var t=e[Kt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Of(e)?2:Af(e)?3:0}function Pc(e,t){return Ci(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function mI(e,t){return Ci(e)===2?e.get(t):e[t]}function e0(e,t,r){var i=Ci(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function vI(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Of(e){return wI&&e instanceof Map}function Af(e){return xI&&e instanceof Set}function Nn(e){return e.o||e.t}function Tf(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=_I(e);delete t[Kt];for(var r=Cf(t),i=0;i<r.length;i++){var s=r[i],a=t[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Object.getPrototypeOf(e),t)}function Fo(e,t){return t===void 0&&(t=!1),Rf(e)||Ti(e)||!Gn(e)||(Ci(e)>1&&(e.set=e.add=e.clear=e.delete=yI),Object.freeze(e),t&&Mo(e,(function(r,i){return Fo(i,!0)}),!0)),e}function yI(){yt(2)}function Rf(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function $r(e){var t=OI[e];return t||yt(18,e),t}function Tm(){return process.env.NODE_ENV==="production"||Ri||yt(0),Ri}function nc(e,t){t&&($r("Patches"),e.u=[],e.s=[],e.v=t)}function Ra(e){Cc(e),e.p.forEach(bI),e.p=null}function Cc(e){e===Ri&&(Ri=e.l)}function Rm(e){return Ri={p:[],l:Ri,h:e,m:!0,_:0}}function bI(e){var t=e[Kt];t.i===0||t.i===1?t.j():t.g=!0}function ic(e,t){t._=t.p.length;var r=t.p[0],i=e!==void 0&&e!==r;return t.h.O||$r("ES5").S(t,e,i),i?(r[Kt].P&&(Ra(t),yt(4)),Gn(e)&&(e=Pa(t,e),t.l||Ca(t,e)),t.u&&$r("Patches").M(r[Kt].t,e,t.u,t.s)):e=Pa(t,r,[]),Ra(t),t.u&&t.v(t.u,t.s),e!==r0?e:void 0}function Pa(e,t,r){if(Rf(t))return t;var i=t[Kt];if(!i)return Mo(t,(function(c,f){return Pm(e,i,t,c,f,r)}),!0),t;if(i.A!==e)return t;if(!i.P)return Ca(e,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var s=i.i===4||i.i===5?i.o=Tf(i.k):i.o,a=s,u=!1;i.i===3&&(a=new Set(s),s.clear(),u=!0),Mo(a,(function(c,f){return Pm(e,i,s,c,f,r,u)})),Ca(e,s,!1),r&&e.u&&$r("Patches").N(i,r,e.u,e.s)}return i.o}function Pm(e,t,r,i,s,a,u){if(process.env.NODE_ENV!=="production"&&s===r&&yt(5),Ti(s)){var c=Pa(e,s,a&&t&&t.i!==3&&!Pc(t.R,i)?a.concat(i):void 0);if(e0(r,i,c),!Ti(c))return;e.m=!1}else u&&r.add(s);if(Gn(s)&&!Rf(s)){if(!e.h.D&&e._<1)return;Pa(e,s),t&&t.A.l||Ca(e,s)}}function Ca(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Fo(t,r)}function oc(e,t){var r=e[Kt];return(r?Nn(r):e)[t]}function Cm(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Object.getPrototypeOf(r)}}function kc(e){e.P||(e.P=!0,e.l&&kc(e.l))}function sc(e){e.o||(e.o=Tf(e.t))}function $c(e,t,r){var i=Of(t)?$r("MapSet").F(t,r):Af(t)?$r("MapSet").T(t,r):e.O?(function(s,a){var u=Array.isArray(s),c={i:u?1:0,A:a?a.A:Tm(),P:!1,I:!1,R:{},l:a,t:s,k:null,o:null,j:null,C:!1},f=c,m=Ic;u&&(f=[c],m=xo);var y=Proxy.revocable(f,m),p=y.revoke,g=y.proxy;return c.k=g,c.j=p,g})(t,r):$r("ES5").J(t,r);return(r?r.A:Tm()).p.push(i),i}function t0(e){return Ti(e)||yt(22,e),(function t(r){if(!Gn(r))return r;var i,s=r[Kt],a=Ci(r);if(s){if(!s.P&&(s.i<4||!$r("ES5").K(s)))return s.t;s.I=!0,i=km(r,a),s.I=!1}else i=km(r,a);return Mo(i,(function(u,c){s&&mI(s.t,u)===c||e0(i,u,t(c))})),a===3?new Set(i):i})(e)}function km(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Tf(e)}var $m,Ri,Pf=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",wI=typeof Map<"u",xI=typeof Set<"u",Im=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",r0=Pf?Symbol.for("immer-nothing"):(($m={})["immer-nothing"]=!0,$m),Lm=Pf?Symbol.for("immer-draftable"):"__$immer_draftable",Kt=Pf?Symbol.for("immer-state"):"__$immer_state",SI={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},EI=""+Object.prototype.constructor,Cf=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,_I=Object.getOwnPropertyDescriptors||function(e){var t={};return Cf(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},OI={},Ic={get:function(e,t){if(t===Kt)return e;var r=Nn(e);if(!Pc(r,t))return(function(s,a,u){var c,f=Cm(a,u);return f?"value"in f?f.value:(c=f.get)===null||c===void 0?void 0:c.call(s.k):void 0})(e,r,t);var i=r[t];return e.I||!Gn(i)?i:i===oc(e.t,t)?(sc(e),e.o[t]=$c(e.A.h,i,e)):i},has:function(e,t){return t in Nn(e)},ownKeys:function(e){return Reflect.ownKeys(Nn(e))},set:function(e,t,r){var i=Cm(Nn(e),t);if(i!=null&&i.set)return i.set.call(e.k,r),!0;if(!e.P){var s=oc(Nn(e),t),a=s==null?void 0:s[Kt];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(vI(r,s)&&(r!==void 0||Pc(e.t,t)))return!0;sc(e),kc(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return oc(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,sc(e),kc(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Nn(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty:function(){yt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){yt(12)}},xo={};Mo(Ic,(function(e,t){xo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),xo.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&yt(13),xo.set.call(this,e,t,void 0)},xo.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&yt(14),Ic.set.call(this,e[0],t,r,e[0])};var AI=(function(){function e(r){var i=this;this.O=Im,this.D=!0,this.produce=function(s,a,u){if(typeof s=="function"&&typeof a!="function"){var c=a;a=s;var f=i;return function(d){var w=this;d===void 0&&(d=c);for(var h=arguments.length,S=Array(h>1?h-1:0),E=1;E<h;E++)S[E-1]=arguments[E];return f.produce(d,(function(R){var O;return(O=a).call.apply(O,[w,R].concat(S))}))}}var m;if(typeof a!="function"&&yt(6),u!==void 0&&typeof u!="function"&&yt(7),Gn(s)){var y=Rm(i),p=$c(i,s,void 0),g=!0;try{m=a(p),g=!1}finally{g?Ra(y):Cc(y)}return typeof Promise<"u"&&m instanceof Promise?m.then((function(d){return nc(y,u),ic(d,y)}),(function(d){throw Ra(y),d})):(nc(y,u),ic(m,y))}if(!s||typeof s!="object"){if((m=a(s))===void 0&&(m=s),m===r0&&(m=void 0),i.D&&Fo(m,!0),u){var v=[],x=[];$r("Patches").M(s,m,v,x),u(v,x)}return m}yt(21,s)},this.produceWithPatches=function(s,a){if(typeof s=="function")return function(m){for(var y=arguments.length,p=Array(y>1?y-1:0),g=1;g<y;g++)p[g-1]=arguments[g];return i.produceWithPatches(m,(function(v){return s.apply(void 0,[v].concat(p))}))};var u,c,f=i.produce(s,a,(function(m,y){u=m,c=y}));return typeof Promise<"u"&&f instanceof Promise?f.then((function(m){return[m,u,c]})):[f,u,c]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){Gn(r)||yt(8),Ti(r)&&(r=t0(r));var i=Rm(this),s=$c(this,r,void 0);return s[Kt].C=!0,Cc(i),s},t.finishDraft=function(r,i){var s=r&&r[Kt];process.env.NODE_ENV!=="production"&&(s&&s.C||yt(9),s.I&&yt(10));var a=s.A;return nc(a,i),ic(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Im&&yt(20),this.O=r},t.applyPatches=function(r,i){var s;for(s=i.length-1;s>=0;s--){var a=i[s];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}s>-1&&(i=i.slice(s+1));var u=$r("Patches").$;return Ti(r)?u(r,i):this.produce(r,(function(c){return u(c,i)}))},e})(),Vt=new AI,TI=Vt.produce;Vt.produceWithPatches.bind(Vt);Vt.setAutoFreeze.bind(Vt);Vt.setUseProxies.bind(Vt);Vt.applyPatches.bind(Vt);Vt.createDraft.bind(Vt);Vt.finishDraft.bind(Vt);function RI(e){var t=W.useState(function(){return Fo(typeof e=="function"?e():e,!0)}),r=t[1];return[t[0],W.useCallback(function(i){r(typeof i=="function"?TI(i):Fo(i))},[])]}const PI=process.env.NODE_ENV==="development",ac=PI&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:null,CI=(e,t,r)=>{const[i,s]=RI(e),a=W.useRef(null);W.useEffect(()=>{var f;return r&&(a.current=ac==null?void 0:ac.connect({name:r,trace:!0}),(f=a.current)==null||f.init(e)),()=>{var m,y;(y=(m=a.current)==null?void 0:m.disconnect)==null||y.call(m)}},[]);const u=t&&typeof t=="object"?t:{},c=W.useMemo(()=>Object.keys(u).reduce((f,m)=>({...f,[m]:y=>(s(p=>{var g;u[m](p,y),(g=a.current)==null||g.send({type:u[m].name},t0(p))}),c)}),{}),[s]);return{state:i,dispatch:c}};function Xr(e){return typeof e=="function"}function n0(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var uc=n0(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
202
202
  `+r.map(function(i,s){return s+1+") "+i.toString()}).join(`
203
203
  `):"",this.name="UnsubscriptionError",this.errors=r}});function Lc(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ka=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,s,a;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=mc(u),f=c.next();!f.done;f=c.next()){var m=f.value;m.remove(this)}}catch(d){t={error:d}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}else u.remove(this);var y=this.initialTeardown;if(Xr(y))try{y()}catch(d){a=d instanceof uc?d.errors:[d]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var g=mc(p),v=g.next();!v.done;v=g.next()){var x=v.value;try{Mm(x)}catch(d){a=a??[],d instanceof uc?a=Sa(Sa([],vc(a)),vc(d.errors)):a.push(d)}}}catch(d){i={error:d}}finally{try{v&&!v.done&&(s=g.return)&&s.call(g)}finally{if(i)throw i.error}}}if(a)throw new uc(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Mm(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Lc(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Lc(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),i0=Ka.EMPTY;function o0(e){return e instanceof Ka||e&&"closed"in e&&Xr(e.remove)&&Xr(e.add)&&Xr(e.unsubscribe)}function Mm(e){Xr(e)?e():e.unsubscribe()}var kI={Promise:void 0},$I={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Sa([e,t],vc(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function II(e){$I.setTimeout(function(){throw e})}function Fm(){}function ga(e){e()}var s0=(function(e){ja(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,o0(r)&&r.add(i)):i.destination=FI,i}return t.create=function(r,i,s){return new Mc(r,i,s)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Ka),LI=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){ia(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){ia(i)}else ia(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ia(r)}},e})(),Mc=(function(e){ja(t,e);function t(r,i,s){var a=e.call(this)||this,u;return Xr(r)||!r?u={next:r??void 0,error:i??void 0,complete:s??void 0}:u=r,a.destination=new LI(u),a}return t})(s0);function ia(e){II(e)}function MI(e){throw e}var FI={closed:!0,next:Fm,error:MI,complete:Fm},DI=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function NI(e){return e}function jI(e){return e.length===0?NI:e.length===1?e[0]:function(r){return e.reduce(function(i,s){return s(i)},r)}}var Dm=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var s=this,a=WI(t)?t:new Mc(t,r,i);return ga(function(){var u=s,c=u.operator,f=u.source;a.add(c?c.call(a,f):f?s._subscribe(a):s._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Nm(r),new r(function(s,a){var u=new Mc({next:function(c){try{t(c)}catch(f){a(f),u.unsubscribe()}},error:a,complete:s});i.subscribe(u)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[DI]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return jI(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Nm(t),new t(function(i,s){var a;r.subscribe(function(u){return a=u},function(u){return s(u)},function(){return i(a)})})},e.create=function(t){return new e(t)},e})();function Nm(e){var t;return(t=e??kI.Promise)!==null&&t!==void 0?t:Promise}function zI(e){return e&&Xr(e.next)&&Xr(e.error)&&Xr(e.complete)}function WI(e){return e&&e instanceof s0||zI(e)&&o0(e)}var UI=n0(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Mr=(function(e){ja(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new jm(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new UI},t.prototype.next=function(r){var i=this;ga(function(){var s,a;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var u=mc(i.currentObservers),c=u.next();!c.done;c=u.next()){var f=c.value;f.next(r)}}catch(m){s={error:m}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(s)throw s.error}}}})},t.prototype.error=function(r){var i=this;ga(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var s=i.observers;s.length;)s.shift().error(r)}})},t.prototype.complete=function(){var r=this;ga(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,s=this,a=s.hasError,u=s.isStopped,c=s.observers;return a||u?i0:(this.currentObservers=null,c.push(r),new Ka(function(){i.currentObservers=null,Lc(c,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,s=i.hasError,a=i.thrownError,u=i.isStopped;s?r.error(a):u&&r.complete()},t.prototype.asObservable=function(){var r=new Dm;return r.source=this,r},t.create=function(r,i){return new jm(r,i)},t})(Dm),jm=(function(e){ja(t,e);function t(r,i){var s=e.call(this)||this;return s.destination=r,s.source=i,s}return t.prototype.next=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,r)},t.prototype.error=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&s!==void 0?s:i0},t})(Mr),a0=(e=>(e.RELOAD="reload",e.RECOMPUTE="recompute",e))(a0||{}),u0=(e=>(e.RENAME="rename",e.TYPE_CHANGE="type-change",e))(u0||{});const BI=new Mr,HI=new Mr,l0=new Mr;var c0=(e=>(e.SAVE_ALL="save-all",e))(c0||{});const qI=new Mr;var f0=(e=>(e.WILL_SAVE="will-save",e.DID_SAVE="did-save",e.WILL_CREATE="will-create",e.WILL_RENAME="will-rename",e.WILL_DELETE="will-delete",e.DID_CREATE="did-create",e.DID_RENAME="did-rename",e.DID_DELETE="did-delete",e.DIAGNOSTIC_REFRESH="diagnostic-refresh",e))(f0||{});const ZI=new Mr;var d0=(e=>(e.RESEND_BREAKPOINTS="resend-breakpoints",e))(d0||{});const GI=new Mr,KI=new Mr;var Do=(e=>(e.EVENT_STARTED="event-started",e.EVENT_ENDED="event-ended",e.EVENT_EMITED="event-emited",e.REQUEST_SENT="request-sent",e))(Do||{});const ka=new Mr,VI=new Mr,kf=255;var $f=(e=>(e.EMPTY="Please enter a valid name",e.LENGTH_EXCEEDED=`The name is too long, it should not exceed ${kf} characters (including extension)`,e.SHOULD_START_WITH_LETTER="The name can only start with a letter or a Japanese character",e.INVALID="Invalid name",e))($f||{});function p0(e,t){const r=t?e.replace(/\.[^.]+$/,""):e;if(e==="")throw new Error("Please enter a valid name");if(e.length>kf)throw new Error($f.LENGTH_EXCEEDED);if(!/^[a-zA-Z\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF]/.test(r))throw new Error("The name can only start with a letter or a Japanese character");if(!/^[\w\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF-]+$/i.test(r))throw new Error("Invalid name");return!0}function XI(e){if(!e)return null;if(typeof e=="string")try{p0(e)}catch(t){return t.message}}function YI(e,t){let r="";if(["array","object"].includes(t))try{const i=JSON.parse(e);t==="array"&&(!Array.isArray(i)||!Ye.isObject(i))&&(r=`Invalid value for type ${t}`),t==="object"&&(!Ye.isObject(i)||Array.isArray(i))&&(r=`Invalid value for type ${t}`)}catch{r=`Invalid value for type ${t}`}return t==="date"&&(new RegExp(/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/).test(e)||(r=`Invalid value for type ${t}`)),t==="number"&&isNaN(+e)&&(r=`Invalid value for type ${t}`),["boolean","bool"].includes(t)&&typeof e!="boolean"&&!["true","false"].includes(e)&&(r=`Invalid value for type ${t}`),r}function JI(){return{PLACEHOLDER_PREFIX:`@!MASK_${Date.now().toString(36)+Math.random().toString(36).substring(2,8)}_`,counter:0}}function Va(e){const{PLACEHOLDER_PREFIX:t,counter:r}=JI();let i=r;const s=[],a="@!",u=y=>(s.push(y),`${t}${i++}${a}`);let c=e.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g,u);c=c.replace(/([\{\s]\s*\w+\s*)(:\s*\d+)/g,(y,p,g)=>p+u(g)),c=c.replace(/:\d{2}:\d{2}/g,u);const f=new RegExp(":(?!4D\\.\\w+)[CPK]?\\d+","g");let m=c.replace(f,"");for(let y=0;y<s.length;y++){const g=`${t}${y}${a}`.replace(/([.*+?^${}()|[\]\\])/g,"\\$1"),v=new RegExp(g,"g");m=m.replace(v,s[y])}return m}var If=(e=>(e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.WELCOME="welcome",e.SETTINGS="settings",e.ROOT="root",e.REPORTS="report",e))(If||{});const wn={CLASSES:"Classes",METHODS:"Methods",SHARED:"Shared",WEBFORMS:"WebForms",CLASSES_FOLDER:"ClassesFolder",REPORTS:"Reports",DEBUGGER:"Debugger"};var Xe=(e=>(e.FOLDER="folder",e.WEBFORM="webform",e.REPORT="report",e.METHOD="method",e.CLASS="class",e.CLASS_FOLDER="classfolder",e.DEBUGGER="debugger",e.WELCOME="welcome",e.SETTINGS="settings",e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.DEBUGGERS="debugger",e.MODELS="models",e.ROLES="roles",e.HTTP_HANDLERS="http-handlers",e.LOCALIZATION="localization",e.MODEL="model",e.DATA_EXPLORER="dataexplorer",e.MOBILE="mobile",e.MOBILEFORM="mform",e.FILE="file",e.TEXT="text",e))(Xe||{}),On=(e=>(e.GET_FOLDER="getFolder",e.GET="get",e.SAVE="save",e.RENAME="rename",e.DROP="drop",e.ADD_FOLDER="addFolder",e.CREATE_FOLDER="mkdir",e.RENAME_FOLDER="renameFolder",e.DROP_FOLDER="dropFolder",e.REMOVE_ITEM="removeItem",e.MOVE_ITEM="moveItem",e.GET_INFO="getInfo",e.SAVE_CONTENT="save",e.UPDATE_CHECK="update:check",e.UPDATE_INSTALL="update:install",e.GET_APP_SETTINGS="getWebServerInfo",e.GET_FILE_CONTENT="getFileContent",e.SET_FILE_CONTENT="setFileContent",e.GET_FILES_INFO="getFilesInfo",e))(On||{}),Lf=(e=>(e[e.DISABLED=0]="DISABLED",e[e.ENABLED=1]="ENABLED",e))(Lf||{});const h0="roles.json",g0="qodlyApp.json",QI="model.4DModel",m0="HTTPHandlers.json",v0="Shared/i18n.json";function eL(e){const t=Mf(e);switch(t){case Xe.SETTINGS:return{filename:"Settings",type:t};case Xe.HTTP_HANDLERS:return{filename:"HTTP Handlers",type:t};case Xe.ROLES:return{filename:"Roles & Privileges",type:t};case Xe.LOCALIZATION:return{filename:"Localization",type:t};case Xe.MODEL:return{filename:"Model",type:t};default:{const r=e.split("/"),[i]=r[1].split(".");return{filename:i,type:t}}}}function Mf(e){const t=e.split("."),r=t.pop(),i=t.join(".").split("/")[0];switch(!0){case r==="4DModel":return Xe.MODEL;case r==="WebForm":return Xe.WEBFORM;case(["4dm","4qs","4qm"].includes(r)&&i===wn.METHODS):return Xe.METHOD;case(["4dm","4qs","4qm"].includes(r)&&i===wn.CLASSES):return Xe.CLASS;case e===h0:return Xe.ROLES;case e===m0:return Xe.HTTP_HANDLERS;case e===g0:return Xe.SETTINGS;case e===v0:return Xe.LOCALIZATION;default:return Xe.TEXT}}function tL(e,t=!1){switch(e){case wn.REPORTS:case"report":return"QoDoc";case wn.WEBFORMS:case"webform":return"WebForm";case"Mobile":case"mform":return"MForm";case"class":case"method":case wn.CLASSES:case wn.METHODS:return t?"4qs":"4dm";default:return""}}function rL(e,t=""){const r=new RegExp("(?<=\\/)(\\w+)(?=\\.)").exec(e);return r?r[1]:t}function nL(e,t,r){switch(t){case Xe.MOBILEFORM:return`${e}.MForm`;case Xe.WEBFORM:return`${e}.WebForm`;case Xe.REPORT:return`${e}.QoDoc`;case Xe.METHOD:case Xe.CLASS:return`${e}.${r?"4qs":"4dm"}`;default:return e}}class y0{constructor(){this.current=Promise.resolve()}lock(){let t;const r=new Promise(s=>{t=s}),i=this.current.then(()=>t);return this.current=r,i}}function Ff(){const e=new y0;return async t=>{const r=await e.lock();try{const i=await t();return r(),i}catch(i){console.error(i),r();return}}}const b0=Ye.curry((e,t,r)=>e&&Ye.get(r,e)===t),iL=Ye.curry((e,t,r)=>Ye.get(r,e)!==t),oL=Ye.curry((e,t)=>Ye.get(t,"id")!==e),sL=Ye.curry((e,t)=>Ye.get(t,"id")===e),aL=Ye.curry((e,t)=>Ye.get(t,"path")===e);function uL(e="id",t,r){return r.findIndex(b0(e,t))!==-1}function w0(e,t){return e.localeCompare(t,void 0,{numeric:!0})}function lL(e){if(!e)return"";const{id:t,namespace:r}=e;return r&&t?`${r}:${t}`:t}function cL(e=""){const t=e.trim().split(":")||[];let r="",i="";return t.length>1?(r=t[1],i=t[0]):r=t[0],{id:r,namespace:i,root:r.split(".").filter(Boolean)[0],original:i?`${i}:${r}`:r,parts:t}}function x0(e){return["bool","word","string","text","uuid","short","long","number","long64","duration","object","date","image","blob"].includes(e.type||"")}function fL(e){return e.type==="object"}function S0(e){var t;return e.kind==="relatedEntities"||((t=e.type)==null?void 0:t.includes("Selection"))||e.behavior==="relatedEntities"}function E0(e){return e.kind==="relatedEntity"||e.behavior==="relatedEntity"||!x0(e)}function dL(e){return S0(e)||E0(e)}function pL(e){return e.applyTo==="dataStore"}function hL(e){return e.applyTo==="dataClass"}function gL(e){return e.applyTo==="entity"}function mL(e){return e.applyTo==="entityCollection"}function vL(e){return e.type==="entity"}function yL(e){return e.type==="entitysel"}function _0(e){return e.dataType==="array"}function O0(e){return e.dataType==="object"}function A0(e){return e.type==="scalar"}function bL(e){return _0(e)||O0(e)||A0(e)}const wL=e=>e!=null&&e.type==="entity",xL=e=>e.type==="entitysel",SL=e=>e.type==="array"||e.type==="scalar"&&e.dataType==="array",EL=e=>e.type==="object"||e.type==="scalar"&&e.dataType==="object",_L=e=>e.type==="scalar"&&e.dataType==="date",OL=(e,t)=>(e||"")===(t||"");function AL(){return new Promise((e,t)=>{window.addEventListener("bundle:ready",r=>r.data?e():t(r.caughtErr))})}function TL(){return new Promise(e=>{window.addEventListener("i18n:ready",()=>e())})}const So="Qodly",T0="Location",R0="UserLanguage",P0="Title",$a={[So]:[{id:P0,dataType:"string",type:"scalar",namespace:So,initialValue:""},{id:T0,dataType:"object",type:"scalar",namespace:So,initialValue:{urlQuery:[],urlPath:{},Anchor:""},schema:{type:"object",properties:[{name:"urlQuery",type:"object",initialValue:{}},{name:"urlPath",type:"array",initialValue:[]},{name:"Anchor",type:"string",initialValue:""}]}},{id:R0,dataType:"object",type:"scalar",namespace:So,initialValue:{selected:{},supported:[]},schema:{type:"object",properties:[{name:"selected",type:"object",initialValue:{},attributes:[{name:"isocode",type:"string"},{name:"local",type:"string"},{name:"native",type:"string"},{name:"flag",type:"string"}]},{name:"supported",type:"array",initialValue:[],attributes:[{name:"isocode",type:"string"},{name:"local",type:"string"},{name:"native",type:"string"},{name:"flag",type:"string"}]}]}}]};var No=(e=>(e.capable="capable",e.incapable="incapable",e.indifferent="indifferent",e))(No||{}),C0=(e=>(e.soap="soap",e.web="web",e.sql="sql",e.rest="rest",e))(C0||{}),Df=(e=>(e.table="table",e.catalog="catalog",e.currentRecord="currentRecord",e.currentSelection="currentSelection",e))(Df||{});const RL={publishedSoap:"soap",publishedWeb:"web",publishedSql:"sql",publishedRest:"rest"};function PL(e){var a;let t={};try{const u=((a=e.match(/\/\/%attributes = (.*)/))==null?void 0:a[1])||"";t=JSON.parse(u)}catch{}const{published4DMobile:r,...i}=t;return{...{invisible:!1,shared:!1,executedOnServer:!1,preemptive:No.indifferent,publishedSoap:!1,publishedWsdl:!1,publishedWeb:!1,publishedSql:!1,publishedRest:!!r,publishedRestOptions:r||{table:"",scope:Df.table}},...i}}function k0(e){const t={};return e.invisible&&(t.invisible=!0),e.shared&&(t.shared=!0),e.executedOnServer&&(t.executedOnServer=!0),e.preemptive&&[No.capable,No.incapable].includes(e.preemptive)&&(t.preemptive=e.preemptive),e.publishedSoap&&(t.publishedSoap=!0,e.publishedWsdl&&(t.publishedWsdl=!0)),e.publishedWeb&&(t.publishedWeb=!0),e.publishedSql&&(t.publishedSql=!0),e.publishedRest&&e.publishedRestOptions&&(t.published4DMobile=e.publishedRestOptions),JSON.stringify(t).replace(/"(true|false)"/g,"$1")}function CL(e,t,r=!1){const i=Ye.isString(t)?t:k0(t);if(!r&&$0(e))return e;const s=I0(e);return`//%attributes = ${i}\r
204
204
  ${s}`}function $0(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function I0(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const kL=()=>Jc.uuid().replaceAll("-","").toUpperCase(),$L=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/_{2,}/g,"_").replace(/^_|_$/g,"");function L0(e){var r;if(!e||typeof e!="object")return[];const t=((r=e.__STATUS)==null?void 0:r.errors)??e.__ERRORS??e.errorStack;return Array.isArray(t)?t:[]}function M0(e,t){return t?e.filter(r=>r.seriousError===!0):[]}function IL(e,t){const r=L0(e);return M0(r,t)}function LL(e){const t=e.map(r=>typeof r.message=="string"?r.message:String(r));return t.length===0?[]:[{messages:t}]}const at="/rest/$designer",Go="/rest/$designer-ext";function ML(...e){return t=>{if(e.length===0)return t;const r={...t};return e.forEach(i=>{typeof r[i]=="string"&&(r[i]=new Date(r[i]))}),r}}class Fc extends Error{constructor(t,r,i){super(),this.url=t,this.response=r,this.data=i}log(){console.error("Error while sending the request",this)}}async function Ne(e,t){var s;ka.next({action:Do.REQUEST_SENT});const r=await window.fetch(e,t);if(/401/.test(r.status.toString())&&(window.location.href="/login.html?redirect=studio"),/^[45]/.test(r.status.toString())){let a;try{const u=await r.json();((s=u==null?void 0:u.__ERROR)==null?void 0:s.some(f=>f.errCode===1651))&&ka.next({action:Do.EVENT_EMITED,payload:{eventName:"onsessionexpired"}}),a=new Fc(e,r,u)}catch{a=new Fc(e,r)}throw a.log(),a}return await r.json()}function FL(e){return ka.next({action:Do.REQUEST_SENT}),e}var Er={},mt={},zm;function zn(){if(zm)return mt;zm=1;var e=mt.ValidationError=function(d,w,h,S,E,R){if(Array.isArray(S)?(this.path=S,this.property=S.reduce(function(C,U){return C+c(U)},"instance")):S!==void 0&&(this.property=S),d&&(this.message=d),h){var O=h.$id||h.id;this.schema=O||h}w!==void 0&&(this.instance=w),this.name=E,this.argument=R,this.stack=this.toString()};e.prototype.toString=function(){return this.property+" "+this.message};var t=mt.ValidatorResult=function(d,w,h,S){this.instance=d,this.schema=w,this.options=h,this.path=S.path,this.propertyPath=S.propertyPath,this.errors=[],this.throwError=h&&h.throwError,this.throwFirst=h&&h.throwFirst,this.throwAll=h&&h.throwAll,this.disableFormat=h&&h.disableFormat===!0};t.prototype.addError=function(d){var w;if(typeof d=="string")w=new e(d,this.instance,this.schema,this.path);else{if(!d)throw new Error("Missing error detail");if(!d.message)throw new Error("Missing error message");if(!d.name)throw new Error("Missing validator type");w=new e(d.message,this.instance,this.schema,this.path,d.name,d.argument)}if(this.errors.push(w),this.throwFirst)throw new i(this);if(this.throwError)throw w;return w},t.prototype.importErrors=function(d){typeof d=="string"||d&&d.validatorType?this.addError(d):d&&d.errors&&(this.errors=this.errors.concat(d.errors))};function r(x,d){return d+": "+x.toString()+`