@dao42/d42paas-front 0.8.5 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DaoPaaS.es.js +1 -1
- package/dist/DaoPaaS.umd.js +1 -1
- package/dist/sdk/docs/classes/DaoPaaS.html +18 -18
- package/dist/sdk/docs/interfaces/BrowserProps.html +5 -5
- package/dist/sdk/docs/interfaces/Component.html +2 -2
- package/dist/sdk/docs/interfaces/ConsoleOrShellProps.html +8 -8
- package/dist/sdk/docs/interfaces/DiffPatternInfo.html +1 -1
- package/dist/sdk/docs/interfaces/EditorProps.html +4 -4
- package/dist/sdk/docs/interfaces/ErrorType.html +1 -1
- package/dist/sdk/docs/interfaces/MenuTagProps.html +1 -1
- package/dist/sdk/docs/interfaces/MessageType.html +5 -5
- package/dist/sdk/docs/interfaces/Options.html +8 -8
- package/dist/sdk/docs/interfaces/TreeProps.html +8 -8
- package/dist/sdk/docs/interfaces/UserInfo.html +2 -2
- package/dist/sdk/docs/modules.html +2 -2
- package/package.json +4 -1
package/dist/DaoPaaS.es.js
CHANGED
|
@@ -17309,7 +17309,7 @@ class DaoPaaS {
|
|
|
17309
17309
|
return daoStore.getState();
|
|
17310
17310
|
}
|
|
17311
17311
|
async init() {
|
|
17312
|
-
const SDK_VERSION = "0.8.
|
|
17312
|
+
const SDK_VERSION = "0.8.6";
|
|
17313
17313
|
const {
|
|
17314
17314
|
setSocket
|
|
17315
17315
|
} = useOT.getState();
|
package/dist/DaoPaaS.umd.js
CHANGED
|
@@ -238,7 +238,7 @@ __p += '`),si&&(ht+=`' +
|
|
|
238
238
|
function print() { __p += __j.call(arguments, '') }
|
|
239
239
|
`:`;
|
|
240
240
|
`)+ht+`return __p
|
|
241
|
-
}`;var Wn=x1e(function(){return Ti(ue,Ut+"return "+ht).apply(t,Ce)});if(Wn.source=ht,Xq(Wn))throw Wn;return Wn}function QRt(C){return Ai(C).toLowerCase()}function JRt(C){return Ai(C).toUpperCase()}function eNt(C,S,I){if(C=Ai(C),C&&(I||S===t))return Abe(C);if(!C||!(S=rc(S)))return C;var F=Gu(C),Z=Gu(S),ue=Obe(F,Z),Ce=Mbe(F,Z)+1;return Cm(F,ue,Ce).join("")}function tNt(C,S,I){if(C=Ai(C),C&&(I||S===t))return C.slice(0,Fbe(C)+1);if(!C||!(S=rc(S)))return C;var F=Gu(C),Z=Mbe(F,Gu(S))+1;return Cm(F,0,Z).join("")}function nNt(C,S,I){if(C=Ai(C),C&&(I||S===t))return C.replace(ae,"");if(!C||!(S=rc(S)))return C;var F=Gu(C),Z=Obe(F,Gu(S));return Cm(F,Z).join("")}function iNt(C,S){var I=D,F=R;if(Fr(S)){var Z="separator"in S?S.separator:Z;I="length"in S?Pn(S.length):I,F="omission"in S?rc(S.omission):F}C=Ai(C);var ue=C.length;if(My(C)){var Ce=Gu(C);ue=Ce.length}if(I>=ue)return C;var Le=I-Py(F);if(Le<1)return F;var Ne=Ce?Cm(Ce,0,Le).join(""):C.slice(0,Le);if(Z===t)return Ne+F;if(Ce&&(Le+=Ne.length-Le),Qq(Z)){if(C.slice(Le).search(Z)){var at,ct=Ne;for(Z.global||(Z=gq(Z.source,Ai(Ht.exec(Z))+"g")),Z.lastIndex=0;at=Z.exec(ct);)var ht=at.index;Ne=Ne.slice(0,ht===t?Le:ht)}}else if(C.indexOf(rc(Z),Le)!=Le){var Lt=Ne.lastIndexOf(Z);Lt>-1&&(Ne=Ne.slice(0,Lt))}return Ne+F}function rNt(C){return C=Ai(C),C&&Fo.test(C)?C.replace(ra,AEt):C}var oNt=zy(function(C,S,I){return C+(I?" ":"")+S.toUpperCase()}),tK=k0e("toUpperCase");function S1e(C,S,I){return C=Ai(C),S=I?t:S,S===t?LEt(C)?PEt(C):bEt(C):C.match(S)||[]}var x1e=Vn(function(C,S){try{return nc(C,t,S)}catch(I){return Xq(I)?I:new kn(I)}}),sNt=Jf(function(C,S){return qc(S,function(I){I=Eh(I),Xf(C,I,Yq(C[I],C))}),C});function aNt(C){var S=C==null?0:C.length,I=nn();return C=S?Tr(C,function(F){if(typeof F[1]!="function")throw new Kc(s);return[I(F[0]),F[1]]}):[],Vn(function(F){for(var Z=-1;++Z<S;){var ue=C[Z];if(nc(ue[0],this,F))return nc(ue[1],this,F)}})}function lNt(C){return ATt(Yc(C,d))}function nK(C){return function(){return C}}function cNt(C,S){return C==null||C!==C?S:C}var uNt=T0e(),dNt=T0e(!0);function Cl(C){return C}function iK(C){return i0e(typeof C=="function"?C:Yc(C,d))}function hNt(C){return o0e(Yc(C,d))}function fNt(C,S){return s0e(C,Yc(S,d))}var gNt=Vn(function(C,S){return function(I){return PT(I,C,S)}}),pNt=Vn(function(C,S){return function(I){return PT(C,I,S)}});function rK(C,S,I){var F=ms(S),Z=UP(S,F);I==null&&!(Fr(S)&&(Z.length||!F.length))&&(I=S,S=C,C=this,Z=UP(S,ms(S)));var ue=!(Fr(I)&&"chain"in I)||!!I.chain,Ce=tg(C);return qc(Z,function(Le){var Ne=S[Le];C[Le]=Ne,Ce&&(C.prototype[Le]=function(){var at=this.__chain__;if(ue||at){var ct=C(this.__wrapped__),ht=ct.__actions__=_l(this.__actions__);return ht.push({func:Ne,args:arguments,thisArg:C}),ct.__chain__=at,ct}return Ne.apply(C,gm([this.value()],arguments))})}),C}function mNt(){return vr._===this&&(vr._=VEt),this}function oK(){}function _Nt(C){return C=Pn(C),Vn(function(S){return a0e(S,C)})}var vNt=Pq(Tr),bNt=Pq(Lbe),CNt=Pq(aq);function k1e(C){return zq(C)?lq(Eh(C)):ZTt(C)}function yNt(C){return function(S){return C==null?t:vb(C,S)}}var wNt=D0e(),SNt=D0e(!0);function sK(){return[]}function aK(){return!1}function xNt(){return{}}function kNt(){return""}function ENt(){return!0}function TNt(C,S){if(C=Pn(C),C<1||C>V)return[];var I=q,F=aa(C,q);S=nn(S),C-=q;for(var Z=dq(F,S);++I<C;)S(I);return Z}function LNt(C){return Ln(C)?Tr(C,Eh):oc(C)?[C]:_l(j0e(Ai(C)))}function DNt(C){var S=++HEt;return Ai(C)+S}var INt=ZP(function(C,S){return C+S},0),RNt=Fq("ceil"),NNt=ZP(function(C,S){return C/S},1),ANt=Fq("floor");function ONt(C){return C&&C.length?zP(C,Cl,wq):t}function MNt(C,S){return C&&C.length?zP(C,nn(S,2),wq):t}function PNt(C){return Rbe(C,Cl)}function FNt(C,S){return Rbe(C,nn(S,2))}function BNt(C){return C&&C.length?zP(C,Cl,Eq):t}function WNt(C,S){return C&&C.length?zP(C,nn(S,2),Eq):t}var HNt=ZP(function(C,S){return C*S},1),$Nt=Fq("round"),VNt=ZP(function(C,S){return C-S},0);function zNt(C){return C&&C.length?uq(C,Cl):0}function UNt(C,S){return C&&C.length?uq(C,nn(S,2)):0}return ie.after=hIt,ie.ary=n1e,ie.assign=JIt,ie.assignIn=m1e,ie.assignInWith=c4,ie.assignWith=eRt,ie.at=tRt,ie.before=i1e,ie.bind=Yq,ie.bindAll=sNt,ie.bindKey=r1e,ie.castArray=xIt,ie.chain=J0e,ie.chunk=ALt,ie.compact=OLt,ie.concat=MLt,ie.cond=aNt,ie.conforms=lNt,ie.constant=nK,ie.countBy=zDt,ie.create=nRt,ie.curry=o1e,ie.curryRight=s1e,ie.debounce=a1e,ie.defaults=iRt,ie.defaultsDeep=rRt,ie.defer=fIt,ie.delay=gIt,ie.difference=PLt,ie.differenceBy=FLt,ie.differenceWith=BLt,ie.drop=WLt,ie.dropRight=HLt,ie.dropRightWhile=$Lt,ie.dropWhile=VLt,ie.fill=zLt,ie.filter=jDt,ie.flatMap=GDt,ie.flatMapDeep=YDt,ie.flatMapDepth=ZDt,ie.flatten=Y0e,ie.flattenDeep=ULt,ie.flattenDepth=jLt,ie.flip=pIt,ie.flow=uNt,ie.flowRight=dNt,ie.fromPairs=qLt,ie.functions=dRt,ie.functionsIn=hRt,ie.groupBy=XDt,ie.initial=GLt,ie.intersection=YLt,ie.intersectionBy=ZLt,ie.intersectionWith=XLt,ie.invert=gRt,ie.invertBy=pRt,ie.invokeMap=JDt,ie.iteratee=iK,ie.keyBy=eIt,ie.keys=ms,ie.keysIn=bl,ie.map=i4,ie.mapKeys=_Rt,ie.mapValues=vRt,ie.matches=hNt,ie.matchesProperty=fNt,ie.memoize=o4,ie.merge=bRt,ie.mergeWith=_1e,ie.method=gNt,ie.methodOf=pNt,ie.mixin=rK,ie.negate=s4,ie.nthArg=_Nt,ie.omit=CRt,ie.omitBy=yRt,ie.once=mIt,ie.orderBy=tIt,ie.over=vNt,ie.overArgs=_It,ie.overEvery=bNt,ie.overSome=CNt,ie.partial=Zq,ie.partialRight=l1e,ie.partition=nIt,ie.pick=wRt,ie.pickBy=v1e,ie.property=k1e,ie.propertyOf=yNt,ie.pull=tDt,ie.pullAll=X0e,ie.pullAllBy=nDt,ie.pullAllWith=iDt,ie.pullAt=rDt,ie.range=wNt,ie.rangeRight=SNt,ie.rearg=vIt,ie.reject=oIt,ie.remove=oDt,ie.rest=bIt,ie.reverse=Kq,ie.sampleSize=aIt,ie.set=xRt,ie.setWith=kRt,ie.shuffle=lIt,ie.slice=sDt,ie.sortBy=dIt,ie.sortedUniq=fDt,ie.sortedUniqBy=gDt,ie.split=GRt,ie.spread=CIt,ie.tail=pDt,ie.take=mDt,ie.takeRight=_Dt,ie.takeRightWhile=vDt,ie.takeWhile=bDt,ie.tap=ODt,ie.throttle=yIt,ie.thru=n4,ie.toArray=f1e,ie.toPairs=b1e,ie.toPairsIn=C1e,ie.toPath=LNt,ie.toPlainObject=p1e,ie.transform=ERt,ie.unary=wIt,ie.union=CDt,ie.unionBy=yDt,ie.unionWith=wDt,ie.uniq=SDt,ie.uniqBy=xDt,ie.uniqWith=kDt,ie.unset=TRt,ie.unzip=Gq,ie.unzipWith=Q0e,ie.update=LRt,ie.updateWith=DRt,ie.values=qy,ie.valuesIn=IRt,ie.without=EDt,ie.words=S1e,ie.wrap=SIt,ie.xor=TDt,ie.xorBy=LDt,ie.xorWith=DDt,ie.zip=IDt,ie.zipObject=RDt,ie.zipObjectDeep=NDt,ie.zipWith=ADt,ie.entries=b1e,ie.entriesIn=C1e,ie.extend=m1e,ie.extendWith=c4,rK(ie,ie),ie.add=INt,ie.attempt=x1e,ie.camelCase=ORt,ie.capitalize=y1e,ie.ceil=RNt,ie.clamp=RRt,ie.clone=kIt,ie.cloneDeep=TIt,ie.cloneDeepWith=LIt,ie.cloneWith=EIt,ie.conformsTo=DIt,ie.deburr=w1e,ie.defaultTo=cNt,ie.divide=NNt,ie.endsWith=MRt,ie.eq=Zu,ie.escape=PRt,ie.escapeRegExp=FRt,ie.every=UDt,ie.find=qDt,ie.findIndex=K0e,ie.findKey=oRt,ie.findLast=KDt,ie.findLastIndex=G0e,ie.findLastKey=sRt,ie.floor=ANt,ie.forEach=e1e,ie.forEachRight=t1e,ie.forIn=aRt,ie.forInRight=lRt,ie.forOwn=cRt,ie.forOwnRight=uRt,ie.get=Jq,ie.gt=IIt,ie.gte=RIt,ie.has=fRt,ie.hasIn=eK,ie.head=Z0e,ie.identity=Cl,ie.includes=QDt,ie.indexOf=KLt,ie.inRange=NRt,ie.invoke=mRt,ie.isArguments=yb,ie.isArray=Ln,ie.isArrayBuffer=NIt,ie.isArrayLike=vl,ie.isArrayLikeObject=_o,ie.isBoolean=AIt,ie.isBuffer=ym,ie.isDate=OIt,ie.isElement=MIt,ie.isEmpty=PIt,ie.isEqual=FIt,ie.isEqualWith=BIt,ie.isError=Xq,ie.isFinite=WIt,ie.isFunction=tg,ie.isInteger=c1e,ie.isLength=a4,ie.isMap=u1e,ie.isMatch=HIt,ie.isMatchWith=$It,ie.isNaN=VIt,ie.isNative=zIt,ie.isNil=jIt,ie.isNull=UIt,ie.isNumber=d1e,ie.isObject=Fr,ie.isObjectLike=so,ie.isPlainObject=VT,ie.isRegExp=Qq,ie.isSafeInteger=qIt,ie.isSet=h1e,ie.isString=l4,ie.isSymbol=oc,ie.isTypedArray=jy,ie.isUndefined=KIt,ie.isWeakMap=GIt,ie.isWeakSet=YIt,ie.join=QLt,ie.kebabCase=BRt,ie.last=Xc,ie.lastIndexOf=JLt,ie.lowerCase=WRt,ie.lowerFirst=HRt,ie.lt=ZIt,ie.lte=XIt,ie.max=ONt,ie.maxBy=MNt,ie.mean=PNt,ie.meanBy=FNt,ie.min=BNt,ie.minBy=WNt,ie.stubArray=sK,ie.stubFalse=aK,ie.stubObject=xNt,ie.stubString=kNt,ie.stubTrue=ENt,ie.multiply=HNt,ie.nth=eDt,ie.noConflict=mNt,ie.noop=oK,ie.now=r4,ie.pad=$Rt,ie.padEnd=VRt,ie.padStart=zRt,ie.parseInt=URt,ie.random=ARt,ie.reduce=iIt,ie.reduceRight=rIt,ie.repeat=jRt,ie.replace=qRt,ie.result=SRt,ie.round=$Nt,ie.runInContext=Re,ie.sample=sIt,ie.size=cIt,ie.snakeCase=KRt,ie.some=uIt,ie.sortedIndex=aDt,ie.sortedIndexBy=lDt,ie.sortedIndexOf=cDt,ie.sortedLastIndex=uDt,ie.sortedLastIndexBy=dDt,ie.sortedLastIndexOf=hDt,ie.startCase=YRt,ie.startsWith=ZRt,ie.subtract=VNt,ie.sum=zNt,ie.sumBy=UNt,ie.template=XRt,ie.times=TNt,ie.toFinite=ng,ie.toInteger=Pn,ie.toLength=g1e,ie.toLower=QRt,ie.toNumber=Qc,ie.toSafeInteger=QIt,ie.toString=Ai,ie.toUpper=JRt,ie.trim=eNt,ie.trimEnd=tNt,ie.trimStart=nNt,ie.truncate=iNt,ie.unescape=rNt,ie.uniqueId=DNt,ie.upperCase=oNt,ie.upperFirst=tK,ie.each=e1e,ie.eachRight=t1e,ie.first=Z0e,rK(ie,function(){var C={};return xh(ie,function(S,I){Bi.call(ie.prototype,I)||(C[I]=S)}),C}(),{chain:!1}),ie.VERSION=i,qc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(C){ie[C].placeholder=ie}),qc(["drop","take"],function(C,S){ni.prototype[C]=function(I){I=I===t?1:Qo(Pn(I),0);var F=this.__filtered__&&!S?new ni(this):this.clone();return F.__filtered__?F.__takeCount__=aa(I,F.__takeCount__):F.__views__.push({size:aa(I,q),type:C+(F.__dir__<0?"Right":"")}),F},ni.prototype[C+"Right"]=function(I){return this.reverse()[C](I).reverse()}}),qc(["filter","map","takeWhile"],function(C,S){var I=S+1,F=I==X||I==O;ni.prototype[C]=function(Z){var ue=this.clone();return ue.__iteratees__.push({iteratee:nn(Z,3),type:I}),ue.__filtered__=ue.__filtered__||F,ue}}),qc(["head","last"],function(C,S){var I="take"+(S?"Right":"");ni.prototype[C]=function(){return this[I](1).value()[0]}}),qc(["initial","tail"],function(C,S){var I="drop"+(S?"":"Right");ni.prototype[C]=function(){return this.__filtered__?new ni(this):this[I](1)}}),ni.prototype.compact=function(){return this.filter(Cl)},ni.prototype.find=function(C){return this.filter(C).head()},ni.prototype.findLast=function(C){return this.reverse().find(C)},ni.prototype.invokeMap=Vn(function(C,S){return typeof C=="function"?new ni(this):this.map(function(I){return PT(I,C,S)})}),ni.prototype.reject=function(C){return this.filter(s4(nn(C)))},ni.prototype.slice=function(C,S){C=Pn(C);var I=this;return I.__filtered__&&(C>0||S<0)?new ni(I):(C<0?I=I.takeRight(-C):C&&(I=I.drop(C)),S!==t&&(S=Pn(S),I=S<0?I.dropRight(-S):I.take(S-C)),I)},ni.prototype.takeRightWhile=function(C){return this.reverse().takeWhile(C).reverse()},ni.prototype.toArray=function(){return this.take(q)},xh(ni.prototype,function(C,S){var I=/^(?:filter|find|map|reject)|While$/.test(S),F=/^(?:head|last)$/.test(S),Z=ie[F?"take"+(S=="last"?"Right":""):S],ue=F||/^find/.test(S);!Z||(ie.prototype[S]=function(){var Ce=this.__wrapped__,Le=F?[1]:arguments,Ne=Ce instanceof ni,at=Le[0],ct=Ne||Ln(Ce),ht=function(Jn){var si=Z.apply(ie,gm([Jn],Le));return F&&Lt?si[0]:si};ct&&I&&typeof at=="function"&&at.length!=1&&(Ne=ct=!1);var Lt=this.__chain__,Ut=!!this.__actions__.length,sn=ue&&!Lt,Wn=Ne&&!Ut;if(!ue&&ct){Ce=Wn?Ce:new ni(this);var an=C.apply(Ce,Le);return an.__actions__.push({func:n4,args:[ht],thisArg:t}),new Gc(an,Lt)}return sn&&Wn?C.apply(this,Le):(an=this.thru(ht),sn?F?an.value()[0]:an.value():an)})}),qc(["pop","push","shift","sort","splice","unshift"],function(C){var S=LP[C],I=/^(?:push|sort|unshift)$/.test(C)?"tap":"thru",F=/^(?:pop|shift)$/.test(C);ie.prototype[C]=function(){var Z=arguments;if(F&&!this.__chain__){var ue=this.value();return S.apply(Ln(ue)?ue:[],Z)}return this[I](function(Ce){return S.apply(Ln(Ce)?Ce:[],Z)})}}),xh(ni.prototype,function(C,S){var I=ie[S];if(I){var F=I.name+"";Bi.call(Hy,F)||(Hy[F]=[]),Hy[F].push({name:S,func:I})}}),Hy[YP(t,p).name]=[{name:"wrapper",func:t}],ni.prototype.clone=rTt,ni.prototype.reverse=oTt,ni.prototype.value=sTt,ie.prototype.at=MDt,ie.prototype.chain=PDt,ie.prototype.commit=FDt,ie.prototype.next=BDt,ie.prototype.plant=HDt,ie.prototype.reverse=$Dt,ie.prototype.toJSON=ie.prototype.valueOf=ie.prototype.value=VDt,ie.prototype.first=ie.prototype.head,DT&&(ie.prototype[DT]=WDt),ie},Fy=FEt();qu?((qu.exports=Fy)._=Fy,fb._=Fy):vr._=Fy}).call(Nt)})(o0,o0.exports);let OX;const Zxe=Tg(async()=>(await Promise.resolve().then(function(){return Fmt})).FileTree),Xxe=Tg(async()=>(await Promise.resolve().then(function(){return sme})).Editor),Qxe=Tg(async()=>(await Promise.resolve().then(function(){return x0t})).default),Jxe=Tg(async()=>(await Promise.resolve().then(function(){return L0t})).default),eke=Tg(async()=>(await Promise.resolve().then(function(){return D0t})).default),tke=Tg(async()=>await Promise.resolve().then(function(){return Q0t}));class nke{constructor({debug:e,ticket:t,tenantId:i,userInfo:r,components:o,paasDomain:s}){Wi(this,"onMessage");Wi(this,"onError");Wi(this,"userInfo");Wi(this,"ticket");Wi(this,"tenantId");Wi(this,"components");Wi(this,"componentHash");Wi(this,"editorDOM");Wi(this,"cmps",{});Wi(this,"paasDomain");this.ticket=t,this.tenantId=i,this.userInfo=this.generateDefaultAvatar(r),this.components=o,this.paasDomain=s,this.componentHash={Page:"",Tree:"",Editor:"",Console:"",Browser:"",Shell:""},this.init(),this.on=this.on.bind(this),this.trigger=this.trigger.bind(this)}get playgroundStatus(){return this.daoStore.playgroundInfo.status}get dockerStatus(){return this.daoStore.playgroundInfo.dockerInfo.runStatus}get ignoreReplayers(){return e3.getState().ignoreReplayers}get currentAgentUser(){const e=this.daoStore.playgroundInfo;return this.daoStore.playgroundInfo.agentUsers.find(t=>t.agentUserId===e.agentUserId)}get userColors(){return this.daoStore.playgroundInfo.agentUsers.map((e,t)=>J5(t))}async dispose(){var e;(e=Xt.getState().socket)==null||e.disconnect(),console.log("\u5373\u5C06\u9500\u6BC1\u7684\u7EC4\u4EF6\u8282\u70B9",this.componentHash);for(const t in this.componentHash)if(this.componentHash[t]){const i=document.querySelector(this.componentHash[t]);i&&lc.exports.unmountComponentAtNode(i)}return console.log("instance has disposed"),new Promise(t=>{t("instance has disposed")})}followUser(e){var l;const{playgroundInfo:t,setPlaygroundInfo:i}=this.daoStore,{agentUserId:r,agentUsers:o}=t,s=o.findIndex(c=>c.agentUserId===r),a=oD(e);if(s>-1){o[s]=rt(Ee({},o[s]),{followingAgentUserId:e,fileOpened:a==null?void 0:a.fileOpened}),i(rt(Ee({},t),{agentUsers:o})),this.trigger(!0,rt(Ee({},this.daoStore.playgroundInfo),{followingUser:o.find(u=>u.agentUserId===e)||{}}));const c={timestamp:Date.now(),agentUserId:r,file:{action:"Get",path:a==null?void 0:a.fileOpened}};(l=Xt.getState().socket)==null||l.emit("fileContent",c)}eSe(e)}unFollowUser(e){JZ(),e&&e()}replay(e){}setIgnoreReplayers(e){e3.getState().setIgnoreReplayer(e)}activePlayground(){var e;(e=Xt.getState().socket)==null||e.emit("active"),clearTimeout(OX)}runPlayground(){var e;(e=Xt.getState().socket)==null||e.emit("run")}stopPlayground(){var e;(e=Xt.getState().socket)==null||e.emit("stop")}onUploadFile(e){var t;(t=Xt.getState().socket)==null||t.emit("upload",e)}record(e){const{socket:t}=Xt.getState();if(e==="undefined"){this.daoStore.setGlobalData({isRecording:!!e}),t==null||t.emit("globalData",{isRecording:!!e});return}this.daoStore.setGlobalData({isRecording:!!e}),t==null||t.emit("globalData",{isRecording:!!e})}Page({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(tke,Ee({},t))}),this.editorDOM)}Editor({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Editor"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(Xxe,Ee({serviceWorkerOrigin:this.paasDomain},t))}),this.editorDOM)}Shell({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Shell"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(eke,Ee({},t))}),this.editorDOM)}Tree({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Tree"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(Zxe,Ee({},t))}),this.editorDOM)}Console({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Console"):this.editorDOM;const i=be(Qxe,Ee({ref:r=>{this.cmps.Console=r}},t));lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:i}),this.editorDOM)}Browser({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Browser"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(Jxe,Ee({},t))}),this.editorDOM)}get daoStore(){return jt.getState()}async init(){const e="0.8.4",{setSocket:t}=Xt.getState(),i=document.createElement("div");i.className="init-class",document.body.appendChild(i);let r={}.PAAS_MANAGER_API_ORIGIN||"https://www.1024paas.com";this.paasDomain&&(r=this.paasDomain),console.log(`${this.paasDomain} passDomain from sdk`);const s=await(await fetch(r+"/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:this.ticket,packageVersion:e})})).json();if(s.status==="failure")throw this.trigger("error",{message:{content:s.errors[0].errmsg}}),Error(s.errors[0].errmsg);const a=sessionStorage.getItem("agentUserId")||"",l=new qwe({debug:!0,ticket:this.ticket,userInfo:this.userInfo,tenantId:this.tenantId,agentUserId:a,ioPath:s.data});if(t(l),!this.ticket)throw"\u7F3A\u5C11ticket";xSe(),this.components&&this.mapRender(this.components),this.messageAndErrorInjection()}messageAndErrorInjection(){jt.subscribe(e=>e,e=>{if(e.playgroundInfo){e.playgroundInfo.status==="ACTIVE"&&clearTimeout(OX);const t=e.playgroundInfo.agentUsers.find(r=>r.agentUserId===this.daoStore.playgroundInfo.agentUserId)||{},i=t.followingAgentUserId?e.playgroundInfo.agentUsers.find(r=>r.agentUserId===t.followingAgentUserId):null;this.trigger(!0,rt(Ee(Ee({},this.daoStore.playgroundInfo),e.playgroundInfo),{followingUser:i,userColors:this.userColors}))}}),GZ.subscribe(e=>e,e=>{this.trigger("error",o0.exports.pick(e,"message"))}),Xwe.subscribe((e,t)=>{this.trigger({usersFollowYou:e.followingUsers},{usersFollowYou:e.followingUsers})})}trigger(e,t){if(e==="error"){this.on(t,e);return}this.on(t)}on(e,t){t==="error"?this.onError&&this.onError(e):this.onMessage&&this.onMessage(e)}mapRender(e){e==null||e.forEach((t,i)=>{const r=o0.exports.omit(Ee({},t),["item","container"]);switch(t.item){case"Page":this.Page({container:t.container,props:t.props||r});break;case"Tree":this.Tree({container:t.container,props:t.props||r});break;case"Editor":this.Editor({container:t.container,props:Ee({},t.props)});break;case"Console":this.Console({container:t.container,props:t.props||r});break;case"Shell":this.Shell({container:t.container,props:t.props||r});break;case"Browser":this.Browser({container:t.container,props:t.props||r});break}})}isHTMLElement(e,t){const i=/HTMLDivElement|HTMLElement/.test(Object.prototype.toString.call(e));return!i&&t&&(this.componentHash[t]=e),i?e:document.querySelector(e)}generateDefaultAvatar(e){return e.avatarUrl||(e.avatarUrl=`https://ui-avatars.com/api/?background=e9f3f0&rounded=true&uppercase=true&bold=true&length=1&name=${e.username}`),e}}var Ph;(function(n){n.DoubleClickItemToExpand="double-click-item-to-expand",n.ClickItemToExpand="click-item-to-expand",n.ClickArrowToExpand="click-arrow-to-expand"})(Ph||(Ph={}));var kD=globalThis&&globalThis.__assign||function(){return kD=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},kD.apply(this,arguments)},ike=function(n,e){return{mode:n.mode,createInteractiveElementProps:function(t,i,r,o){return kD(kD({},e.createInteractiveElementProps(t,i,r,o)),n.createInteractiveElementProps(t,i,r,o))}}},rke=function(){function n(e){this.mode=Ph.DoubleClickItemToExpand,this.environment=e}return n.prototype.createInteractiveElementProps=function(e,t,i,r){var o=this;return{onClick:function(s){i.focusItem(),s.shiftKey?i.selectUpTo():s.ctrlKey?r.isSelected?i.unselectItem():i.addToSelectedItems():i.selectItem()},onDoubleClick:function(){i.focusItem(),i.selectItem(),e.hasChildren&&i.toggleExpandedState(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction()},onFocus:function(){i.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:r.canDrag&&!r.isRenaming,tabIndex:r.isRenaming?void 0:r.isFocused?0:-1}},n}(),oke=function(){function n(e){this.mode=Ph.ClickItemToExpand,this.environment=e}return n.prototype.createInteractiveElementProps=function(e,t,i,r){var o=this;return{onClick:function(s){i.focusItem(),s.shiftKey?i.selectUpTo():s.ctrlKey?r.isSelected?i.unselectItem():i.addToSelectedItems():(e.hasChildren&&i.toggleExpandedState(),i.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:r.canDrag&&!r.isRenaming,tabIndex:r.isRenaming?void 0:r.isFocused?0:-1}},n}(),ske=function(){function n(e){this.mode=Ph.ClickItemToExpand,this.environment=e}return n.prototype.createInteractiveElementProps=function(e,t,i,r){var o=this;return{onClick:function(s){i.focusItem(),s.shiftKey?i.selectUpTo():s.ctrlKey?r.isSelected?i.unselectItem():i.addToSelectedItems():(i.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:r.canDrag&&!r.isRenaming,tabIndex:r.isRenaming?void 0:r.isFocused?0:-1}},n}(),MX=function(n,e){switch(n){case Ph.DoubleClickItemToExpand:return new rke(e);case Ph.ClickItemToExpand:return new oke(e);case Ph.ClickArrowToExpand:return new ske(e);default:throw Error("Unknown interaction mode "+n)}},PX=N.exports.createContext(null),ake=function(){return N.exports.useContext(PX)},lke=function(n){var e=ir(),t=e.defaultInteractionMode,i=N.exports.useMemo(function(){var r;return t&&typeof t!="string"?t.extends?ike(t,MX(t.extends,e)):t:MX((r=t)!==null&&r!==void 0?r:Ph.ClickItemToExpand,e)},[]);return N.exports.createElement(PX.Provider,{value:i},n.children)},FX=function(){var n=ir();return N.exports.useCallback(function(e,t){for(var i=n.linearItems[t],r=i[e].depth,o=e;!!i[o]&&i[o].depth!==r-1;o--);var s=i[o];return s||(s={item:n.trees[t].rootItem,depth:0},o=0),s},[n.linearItems,n.trees])},cke=function(n,e){return n.clientX<e.left||n.clientX>e.right||n.clientY<e.top||n.clientY>e.bottom},uke=function(n,e,t,i,r){var o=(n-e)/t,s=Math.floor(o),a=void 0,l=i||r?.2:.5;return o%1<l?a="top":o%1>1-l&&(a="bottom"),{linearIndex:s,offset:a}},dke=function(n,e,t,i,r){var o=ir(),s=o.canDropOnItemWithChildren,a=o.canDropOnItemWithoutChildren,l=o.canDragAndDrop,c=o.linearItems,u=o.items,d=o.canReorderItems,f=o.viewState,h=FX();return N.exports.useCallback(function(g,v,m){var p,_,b,y;if(!!l&&!!m.current&&!(g.clientX<0||g.clientY<0)){var w=m.current.getBoundingClientRect(),k=cke(g,w),x=uke(g.clientY,w.top,t,s,a),T=x.linearIndex,L=x.offset,D=k?"outside":""+v+T+(L!=null?L:"");if(n!==D){if(e(D),k){i(void 0);return}if(T<0||T>=c[v].length){i(void 0);return}var R=c[v][T],M=R.depth,A=u[R.item];if(!L&&!a&&!A.hasChildren){i(void 0);return}if(!L&&!s&&A.hasChildren){i(void 0);return}if(L&&!d){i(void 0);return}var X=h(T,v);if(!(!((_=(p=f[v])===null||p===void 0?void 0:p.selectedItems)===null||_===void 0)&&_.includes(R.item))){var H=u[X.item].children.indexOf(R.item)+(L==="top"?0:1);L==="top"&&M===((y=(b=c[v][T-1])===null||b===void 0?void 0:b.depth)!==null&&y!==void 0?y:-1)&&(L="bottom",T-=1);var O;L?O={targetType:"between-items",treeId:v,parentItem:X.item,depth:R.depth,linearIndex:T+(L==="top"?0:1),childIndex:H,linePosition:L}:O={targetType:"item",treeId:v,parentItem:X.item,targetItem:R.item,depth:R.depth,linearIndex:T},r(O)}}}},[l,s,a,d,h,t,u,n,c,i,r,e,f])},BX=function(){var n=ir();return N.exports.useCallback(function(e,t){if(e.targetType==="between-items"){if(!n.canReorderItems)return!1}else{var i=n.items[e.targetItem];if(!n.canDropOnItemWithChildren&&i.hasChildren||!n.canDropOnItemWithoutChildren&&!i.hasChildren)return!1}return!(n.canDropAt&&(!t||!n.canDropAt(t,e)))},[n])},WX=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},hke=function(){var n=ir(),e=FX(),t=BX();return N.exports.useCallback(function(i,r){var o=n.linearItems[i];return o.map(function(s,a){var l,c,u=s.item,d=s.depth,f=e(a,i),h=n.items[f.item].children.indexOf(u),g={targetType:"item",parentItem:f.item,targetItem:u,linearIndex:a,depth:d,treeId:i},v={targetType:"between-items",parentItem:f.item,linePosition:"top",childIndex:h,depth:d,treeId:i,linearIndex:a},m={targetType:"between-items",parentItem:f.item,linePosition:"bottom",linearIndex:a+1,childIndex:h+1,depth:d,treeId:i},p=d===((c=(l=o[a-1])===null||l===void 0?void 0:l.depth)!==null&&c!==void 0?c:-1);return p?[g,m]:[v,g,m]}).reduce(function(s,a){return WX(WX([],s),a)},[]).filter(function(s){return t(s,r)})},[t,n.items,n.linearItems,e])},ED=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},TD=function(n,e,t){var i=N.exports.useRef();N.exports.useEffect(function(){if(!i.current)i.current=ED([],t),n();else{var r=i.current.some(function(o,s){return o!==t[s]});r&&(i.current=ED([],t),n())}},ED(ED([],e),t))},LD=globalThis&&globalThis.__assign||function(){return LD=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},LD.apply(this,arguments)},HX=function(n,e){return n.map(function(t){return[t,e(t)]}).reduce(function(t,i){var r,o=i[0],s=i[1];return LD(LD({},t),(r={},r[o]=s,r))},{})};function s0(){var n=N.exports.useRef(new Array);N.exports.useEffect(function(){var t=n.current;return function(){return t.forEach(function(i){return cancelAnimationFrame(i)})}},[n]);var e=N.exports.useCallback(function(t){var i=requestAnimationFrame(function(){n.current.splice(n.current.indexOf(i),1),t()});n.current.push(i)},[n]);return e}var $X=N.exports.createContext(null),cd=function(){return N.exports.useContext($X)},fke=function(n){var e=ir(),t=N.exports.useState(!1),i=t[0],r=t[1],o=N.exports.useState(4),s=o[0],a=o[1],l=N.exports.useState({}),c=l[0],u=l[1],d=N.exports.useState(0),f=d[0],h=d[1],g=N.exports.useState(),v=g[0],m=g[1],p=N.exports.useState(),_=p[0],b=p[1],y=N.exports.useState("_nodrag"),w=y[0],k=y[1],x=hke(),T=s0();N.exports.useRef(!1);var L=N.exports.useCallback(function(ne,he){var De;if(e.activeTreeId&&((De=e.viewState[e.activeTreeId])===null||De===void 0?void 0:De.focusedItem)&&e.linearItems&&he){var j=e.viewState[e.activeTreeId].focusedItem,ge=x(e.activeTreeId,he),J=ge.findIndex(function(oe){if(oe.targetType==="item")return oe.targetItem===j;if(oe.targetType==="between-items")return e.items[oe.parentItem].children[oe.childIndex]===j});h(J?Math.min(J+1,ge.length-1):0)}else h(0)},[e.activeTreeId,e.items,e.linearItems,e.viewState,x]),D=N.exports.useCallback(function(){r(!1),a(4),u({}),h(0),m(void 0),b(void 0),k("_nodrag")},[]);TD(function(){e.activeTreeId&&e.linearItems[e.activeTreeId]&&c[e.activeTreeId]&&L(c[e.activeTreeId],v)},[v,e.activeTreeId,e.linearItems,L,c],[e.activeTreeId]),TD(function(){i&&e.activeTreeId&&b(c[e.activeTreeId][f])},[f,e.activeTreeId,i,c],[f,e.activeTreeId]);var R=BX(),M=function(ne){var he;v&&!R(ne,v)||(b(ne),e.setActiveTree(ne.treeId),v&&e.activeTreeId!==ne.treeId&&((he=e.onSelectItems)===null||he===void 0||he.call(e,v.map(function(De){return De.index}),ne.treeId)))},A=dke(w,k,s,b,M),X=N.exports.useCallback(function(){v&&_&&e.onDrop&&(e.onDrop(v,_),T(function(){var ne;(ne=e.onFocusItem)===null||ne===void 0||ne.call(e,v[0],_.treeId),D()}))},[v,_,e,D,T]),H=N.exports.useCallback(function(ne,he){var De,j,ge=HX(e.treeIds,function(oe){return x(oe,ne)}),J=(j=(De=document.querySelector('[data-rct-tree="'+he+'"] [data-rct-item-container="true"]'))===null||De===void 0?void 0:De.offsetHeight)!==null&&j!==void 0?j:5;a(J),m(ne),u(ge),e.activeTreeId&&L(ge[e.activeTreeId],ne)},[e.activeTreeId,e.treeIds,x,L]),O=N.exports.useCallback(function(){var ne,he,De;if(!!e.canDragAndDrop&&e.activeTreeId){var j=(he=(ne=e.viewState[e.activeTreeId])===null||ne===void 0?void 0:ne.selectedItems)!==null&&he!==void 0?he:[(De=e.viewState[e.activeTreeId])===null||De===void 0?void 0:De.focusedItem];if(j.length===0||j[0]===void 0)return;var ge=j.map(function(J){return e.items[J]});if(e.canDrag&&!e.canDrag(ge))return;H(ge,e.activeTreeId),setTimeout(function(){r(!0)})}},[H,e]),W=N.exports.useCallback(function(){D()},[D]),V=N.exports.useCallback(function(){X(),D()},[X,D]),G=N.exports.useCallback(function(){h(function(ne){return Math.max(0,ne-1)})},[]),pe=N.exports.useCallback(function(){e.activeTreeId&&h(function(ne){return Math.min(c[e.activeTreeId].length,ne+1)})},[e.activeTreeId,c]),q={onStartDraggingItems:H,startProgrammaticDrag:O,abortProgrammaticDrag:W,completeProgrammaticDrag:V,programmaticDragUp:G,programmaticDragDown:pe,draggingItems:v,draggingPosition:_,itemHeight:s,isProgrammaticallyDragging:i,onDragOverTreeHandler:A,viableDragPositions:c};return N.exports.useEffect(function(){return window.addEventListener("dragend",D),window.addEventListener("drop",X),function(){window.removeEventListener("dragend",D),window.removeEventListener("drop",X)}},[X,D]),N.exports.createElement($X.Provider,{value:q},n.children)},eS=globalThis&&globalThis.__assign||function(){return eS=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},eS.apply(this,arguments)},gke=function(n,e){var t=ir(),i=cd();N.exports.useImperativeHandle(n,function(){return eS(eS(eS({},e),t),{treeEnvironmentContext:t,dragAndDropContext:i})})},VX=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},zX=N.exports.createContext(null),pke=function(){return N.exports.useContext(zX)},mke=N.exports.forwardRef(function(n,e){var t=ir(),i=t.onCollapseItem,r=t.items;t.trees;var o=t.viewState,s=t.onExpandItem,a=t.onFocusItem,l=t.setActiveTree,c=t.onRenameItem,u=t.onSelectItems,d=t.onPrimaryAction,f=t.linearItems,h=cd(),g=h.abortProgrammaticDrag,v=h.completeProgrammaticDrag,m=h.programmaticDragDown,p=h.programmaticDragUp,_=h.startProgrammaticDrag,b={abortProgrammaticDrag:N.exports.useCallback(function(){g()},[g]),collapseItem:N.exports.useCallback(function(y,w){i==null||i(r[y],w)},[r,i]),completeProgrammaticDrag:N.exports.useCallback(function(){v()},[v]),expandItem:N.exports.useCallback(function(y,w){s==null||s(r[y],w)},[r,s]),focusItem:N.exports.useCallback(function(y,w){a==null||a(r[y],w)},[r,a]),focusTree:N.exports.useCallback(function(y,w){w===void 0&&(w=!0),l(y,w)},[l]),moveFocusDown:N.exports.useCallback(function(y){var w=f[y],k=w.findIndex(function(L){var D,R=L.item;return R===((D=o[y])===null||D===void 0?void 0:D.focusedItem)}),x=k!==void 0?Math.min(w.length-1,k+1):0,T=r[w[x].item];a==null||a(T,y)},[r,f,a,o]),moveFocusUp:N.exports.useCallback(function(y){var w=f[y],k=w.findIndex(function(L){var D,R=L.item;return R===((D=o[y])===null||D===void 0?void 0:D.focusedItem)}),x=k!==void 0?Math.max(0,k-1):0,T=r[w[x].item];a==null||a(T,y)},[r,f,a,o]),moveProgrammaticDragPositionDown:N.exports.useCallback(function(){m()},[m]),moveProgrammaticDragPositionUp:N.exports.useCallback(function(){p()},[p]),renameItem:N.exports.useCallback(function(y,w,k){c==null||c(r[y],w,k)},[r,c]),selectItems:N.exports.useCallback(function(y,w){u==null||u(y,w)},[u]),startProgrammaticDrag:N.exports.useCallback(function(){_()},[_]),toggleItemExpandedState:N.exports.useCallback(function(y,w){var k,x;!((x=(k=o[w])===null||k===void 0?void 0:k.expandedItems)===null||x===void 0)&&x.includes(y)?i==null||i(r[y],w):s==null||s(r[y],w)},[r,i,s,o]),toggleItemSelectStatus:N.exports.useCallback(function(y,w){var k,x,T,L,D;!((x=(k=o[w])===null||k===void 0?void 0:k.selectedItems)===null||x===void 0)&&x.includes(y)?u==null||u((L=(T=o[w].selectedItems)===null||T===void 0?void 0:T.filter(function(R){return R!==y}))!==null&&L!==void 0?L:[],w):u==null||u(VX(VX([],(D=o[w].selectedItems)!==null&&D!==void 0?D:[]),[y]),w)},[u,o]),invokePrimaryAction:N.exports.useCallback(function(y,w){d==null||d(r[y],w)},[r,d])};return gke(e,b),N.exports.createElement(zX.Provider,{value:b},n.children)}),_ke=function(n){if(!!n)if(n.scrollIntoViewIfNeeded)n.scrollIntoViewIfNeeded();else{var e=n.getBoundingClientRect(),t=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);t||n.scrollIntoView()}},kl=globalThis&&globalThis.__assign||function(){return kl=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},kl.apply(this,arguments)},Lg=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(function(t){return!!t}).join(" ")},vke=function(n){return{renderItemTitle:function(e){var t=e.title,i=e.context,r=e.info;if(!r.isSearching||!i.isSearchMatching)return Ve.createElement(Ve.Fragment,null,t);var o=t.toLowerCase().indexOf(r.search.toLowerCase());return Ve.createElement(Ve.Fragment,null,o>0&&Ve.createElement("span",null,t.slice(0,o)),Ve.createElement("span",{className:"rct-tree-item-search-highlight"},t.slice(o,o+r.search.length)),o+r.search.length<t.length&&Ve.createElement("span",null,t.slice(o+r.search.length,t.length)))},renderItemArrow:function(e){var t=e.item,i=e.context;return Ve.createElement("div",kl({className:Lg(t.hasChildren&&"rct-tree-item-arrow-hasChildren","rct-tree-item-arrow")},i.arrowProps),t.hasChildren&&(i.isExpanded?Ve.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Ve.createElement("g",null,Ve.createElement("g",null,Ve.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M12,5c-0.28,0-0.53,0.11-0.71,0.29L8,8.59L4.71,5.29C4.53,5.11,4.28,5,4,5
|
|
241
|
+
}`;var Wn=x1e(function(){return Ti(ue,Ut+"return "+ht).apply(t,Ce)});if(Wn.source=ht,Xq(Wn))throw Wn;return Wn}function QRt(C){return Ai(C).toLowerCase()}function JRt(C){return Ai(C).toUpperCase()}function eNt(C,S,I){if(C=Ai(C),C&&(I||S===t))return Abe(C);if(!C||!(S=rc(S)))return C;var F=Gu(C),Z=Gu(S),ue=Obe(F,Z),Ce=Mbe(F,Z)+1;return Cm(F,ue,Ce).join("")}function tNt(C,S,I){if(C=Ai(C),C&&(I||S===t))return C.slice(0,Fbe(C)+1);if(!C||!(S=rc(S)))return C;var F=Gu(C),Z=Mbe(F,Gu(S))+1;return Cm(F,0,Z).join("")}function nNt(C,S,I){if(C=Ai(C),C&&(I||S===t))return C.replace(ae,"");if(!C||!(S=rc(S)))return C;var F=Gu(C),Z=Obe(F,Gu(S));return Cm(F,Z).join("")}function iNt(C,S){var I=D,F=R;if(Fr(S)){var Z="separator"in S?S.separator:Z;I="length"in S?Pn(S.length):I,F="omission"in S?rc(S.omission):F}C=Ai(C);var ue=C.length;if(My(C)){var Ce=Gu(C);ue=Ce.length}if(I>=ue)return C;var Le=I-Py(F);if(Le<1)return F;var Ne=Ce?Cm(Ce,0,Le).join(""):C.slice(0,Le);if(Z===t)return Ne+F;if(Ce&&(Le+=Ne.length-Le),Qq(Z)){if(C.slice(Le).search(Z)){var at,ct=Ne;for(Z.global||(Z=gq(Z.source,Ai(Ht.exec(Z))+"g")),Z.lastIndex=0;at=Z.exec(ct);)var ht=at.index;Ne=Ne.slice(0,ht===t?Le:ht)}}else if(C.indexOf(rc(Z),Le)!=Le){var Lt=Ne.lastIndexOf(Z);Lt>-1&&(Ne=Ne.slice(0,Lt))}return Ne+F}function rNt(C){return C=Ai(C),C&&Fo.test(C)?C.replace(ra,AEt):C}var oNt=zy(function(C,S,I){return C+(I?" ":"")+S.toUpperCase()}),tK=k0e("toUpperCase");function S1e(C,S,I){return C=Ai(C),S=I?t:S,S===t?LEt(C)?PEt(C):bEt(C):C.match(S)||[]}var x1e=Vn(function(C,S){try{return nc(C,t,S)}catch(I){return Xq(I)?I:new kn(I)}}),sNt=Jf(function(C,S){return qc(S,function(I){I=Eh(I),Xf(C,I,Yq(C[I],C))}),C});function aNt(C){var S=C==null?0:C.length,I=nn();return C=S?Tr(C,function(F){if(typeof F[1]!="function")throw new Kc(s);return[I(F[0]),F[1]]}):[],Vn(function(F){for(var Z=-1;++Z<S;){var ue=C[Z];if(nc(ue[0],this,F))return nc(ue[1],this,F)}})}function lNt(C){return ATt(Yc(C,d))}function nK(C){return function(){return C}}function cNt(C,S){return C==null||C!==C?S:C}var uNt=T0e(),dNt=T0e(!0);function Cl(C){return C}function iK(C){return i0e(typeof C=="function"?C:Yc(C,d))}function hNt(C){return o0e(Yc(C,d))}function fNt(C,S){return s0e(C,Yc(S,d))}var gNt=Vn(function(C,S){return function(I){return PT(I,C,S)}}),pNt=Vn(function(C,S){return function(I){return PT(C,I,S)}});function rK(C,S,I){var F=ms(S),Z=UP(S,F);I==null&&!(Fr(S)&&(Z.length||!F.length))&&(I=S,S=C,C=this,Z=UP(S,ms(S)));var ue=!(Fr(I)&&"chain"in I)||!!I.chain,Ce=tg(C);return qc(Z,function(Le){var Ne=S[Le];C[Le]=Ne,Ce&&(C.prototype[Le]=function(){var at=this.__chain__;if(ue||at){var ct=C(this.__wrapped__),ht=ct.__actions__=_l(this.__actions__);return ht.push({func:Ne,args:arguments,thisArg:C}),ct.__chain__=at,ct}return Ne.apply(C,gm([this.value()],arguments))})}),C}function mNt(){return vr._===this&&(vr._=VEt),this}function oK(){}function _Nt(C){return C=Pn(C),Vn(function(S){return a0e(S,C)})}var vNt=Pq(Tr),bNt=Pq(Lbe),CNt=Pq(aq);function k1e(C){return zq(C)?lq(Eh(C)):ZTt(C)}function yNt(C){return function(S){return C==null?t:vb(C,S)}}var wNt=D0e(),SNt=D0e(!0);function sK(){return[]}function aK(){return!1}function xNt(){return{}}function kNt(){return""}function ENt(){return!0}function TNt(C,S){if(C=Pn(C),C<1||C>V)return[];var I=q,F=aa(C,q);S=nn(S),C-=q;for(var Z=dq(F,S);++I<C;)S(I);return Z}function LNt(C){return Ln(C)?Tr(C,Eh):oc(C)?[C]:_l(j0e(Ai(C)))}function DNt(C){var S=++HEt;return Ai(C)+S}var INt=ZP(function(C,S){return C+S},0),RNt=Fq("ceil"),NNt=ZP(function(C,S){return C/S},1),ANt=Fq("floor");function ONt(C){return C&&C.length?zP(C,Cl,wq):t}function MNt(C,S){return C&&C.length?zP(C,nn(S,2),wq):t}function PNt(C){return Rbe(C,Cl)}function FNt(C,S){return Rbe(C,nn(S,2))}function BNt(C){return C&&C.length?zP(C,Cl,Eq):t}function WNt(C,S){return C&&C.length?zP(C,nn(S,2),Eq):t}var HNt=ZP(function(C,S){return C*S},1),$Nt=Fq("round"),VNt=ZP(function(C,S){return C-S},0);function zNt(C){return C&&C.length?uq(C,Cl):0}function UNt(C,S){return C&&C.length?uq(C,nn(S,2)):0}return ie.after=hIt,ie.ary=n1e,ie.assign=JIt,ie.assignIn=m1e,ie.assignInWith=c4,ie.assignWith=eRt,ie.at=tRt,ie.before=i1e,ie.bind=Yq,ie.bindAll=sNt,ie.bindKey=r1e,ie.castArray=xIt,ie.chain=J0e,ie.chunk=ALt,ie.compact=OLt,ie.concat=MLt,ie.cond=aNt,ie.conforms=lNt,ie.constant=nK,ie.countBy=zDt,ie.create=nRt,ie.curry=o1e,ie.curryRight=s1e,ie.debounce=a1e,ie.defaults=iRt,ie.defaultsDeep=rRt,ie.defer=fIt,ie.delay=gIt,ie.difference=PLt,ie.differenceBy=FLt,ie.differenceWith=BLt,ie.drop=WLt,ie.dropRight=HLt,ie.dropRightWhile=$Lt,ie.dropWhile=VLt,ie.fill=zLt,ie.filter=jDt,ie.flatMap=GDt,ie.flatMapDeep=YDt,ie.flatMapDepth=ZDt,ie.flatten=Y0e,ie.flattenDeep=ULt,ie.flattenDepth=jLt,ie.flip=pIt,ie.flow=uNt,ie.flowRight=dNt,ie.fromPairs=qLt,ie.functions=dRt,ie.functionsIn=hRt,ie.groupBy=XDt,ie.initial=GLt,ie.intersection=YLt,ie.intersectionBy=ZLt,ie.intersectionWith=XLt,ie.invert=gRt,ie.invertBy=pRt,ie.invokeMap=JDt,ie.iteratee=iK,ie.keyBy=eIt,ie.keys=ms,ie.keysIn=bl,ie.map=i4,ie.mapKeys=_Rt,ie.mapValues=vRt,ie.matches=hNt,ie.matchesProperty=fNt,ie.memoize=o4,ie.merge=bRt,ie.mergeWith=_1e,ie.method=gNt,ie.methodOf=pNt,ie.mixin=rK,ie.negate=s4,ie.nthArg=_Nt,ie.omit=CRt,ie.omitBy=yRt,ie.once=mIt,ie.orderBy=tIt,ie.over=vNt,ie.overArgs=_It,ie.overEvery=bNt,ie.overSome=CNt,ie.partial=Zq,ie.partialRight=l1e,ie.partition=nIt,ie.pick=wRt,ie.pickBy=v1e,ie.property=k1e,ie.propertyOf=yNt,ie.pull=tDt,ie.pullAll=X0e,ie.pullAllBy=nDt,ie.pullAllWith=iDt,ie.pullAt=rDt,ie.range=wNt,ie.rangeRight=SNt,ie.rearg=vIt,ie.reject=oIt,ie.remove=oDt,ie.rest=bIt,ie.reverse=Kq,ie.sampleSize=aIt,ie.set=xRt,ie.setWith=kRt,ie.shuffle=lIt,ie.slice=sDt,ie.sortBy=dIt,ie.sortedUniq=fDt,ie.sortedUniqBy=gDt,ie.split=GRt,ie.spread=CIt,ie.tail=pDt,ie.take=mDt,ie.takeRight=_Dt,ie.takeRightWhile=vDt,ie.takeWhile=bDt,ie.tap=ODt,ie.throttle=yIt,ie.thru=n4,ie.toArray=f1e,ie.toPairs=b1e,ie.toPairsIn=C1e,ie.toPath=LNt,ie.toPlainObject=p1e,ie.transform=ERt,ie.unary=wIt,ie.union=CDt,ie.unionBy=yDt,ie.unionWith=wDt,ie.uniq=SDt,ie.uniqBy=xDt,ie.uniqWith=kDt,ie.unset=TRt,ie.unzip=Gq,ie.unzipWith=Q0e,ie.update=LRt,ie.updateWith=DRt,ie.values=qy,ie.valuesIn=IRt,ie.without=EDt,ie.words=S1e,ie.wrap=SIt,ie.xor=TDt,ie.xorBy=LDt,ie.xorWith=DDt,ie.zip=IDt,ie.zipObject=RDt,ie.zipObjectDeep=NDt,ie.zipWith=ADt,ie.entries=b1e,ie.entriesIn=C1e,ie.extend=m1e,ie.extendWith=c4,rK(ie,ie),ie.add=INt,ie.attempt=x1e,ie.camelCase=ORt,ie.capitalize=y1e,ie.ceil=RNt,ie.clamp=RRt,ie.clone=kIt,ie.cloneDeep=TIt,ie.cloneDeepWith=LIt,ie.cloneWith=EIt,ie.conformsTo=DIt,ie.deburr=w1e,ie.defaultTo=cNt,ie.divide=NNt,ie.endsWith=MRt,ie.eq=Zu,ie.escape=PRt,ie.escapeRegExp=FRt,ie.every=UDt,ie.find=qDt,ie.findIndex=K0e,ie.findKey=oRt,ie.findLast=KDt,ie.findLastIndex=G0e,ie.findLastKey=sRt,ie.floor=ANt,ie.forEach=e1e,ie.forEachRight=t1e,ie.forIn=aRt,ie.forInRight=lRt,ie.forOwn=cRt,ie.forOwnRight=uRt,ie.get=Jq,ie.gt=IIt,ie.gte=RIt,ie.has=fRt,ie.hasIn=eK,ie.head=Z0e,ie.identity=Cl,ie.includes=QDt,ie.indexOf=KLt,ie.inRange=NRt,ie.invoke=mRt,ie.isArguments=yb,ie.isArray=Ln,ie.isArrayBuffer=NIt,ie.isArrayLike=vl,ie.isArrayLikeObject=_o,ie.isBoolean=AIt,ie.isBuffer=ym,ie.isDate=OIt,ie.isElement=MIt,ie.isEmpty=PIt,ie.isEqual=FIt,ie.isEqualWith=BIt,ie.isError=Xq,ie.isFinite=WIt,ie.isFunction=tg,ie.isInteger=c1e,ie.isLength=a4,ie.isMap=u1e,ie.isMatch=HIt,ie.isMatchWith=$It,ie.isNaN=VIt,ie.isNative=zIt,ie.isNil=jIt,ie.isNull=UIt,ie.isNumber=d1e,ie.isObject=Fr,ie.isObjectLike=so,ie.isPlainObject=VT,ie.isRegExp=Qq,ie.isSafeInteger=qIt,ie.isSet=h1e,ie.isString=l4,ie.isSymbol=oc,ie.isTypedArray=jy,ie.isUndefined=KIt,ie.isWeakMap=GIt,ie.isWeakSet=YIt,ie.join=QLt,ie.kebabCase=BRt,ie.last=Xc,ie.lastIndexOf=JLt,ie.lowerCase=WRt,ie.lowerFirst=HRt,ie.lt=ZIt,ie.lte=XIt,ie.max=ONt,ie.maxBy=MNt,ie.mean=PNt,ie.meanBy=FNt,ie.min=BNt,ie.minBy=WNt,ie.stubArray=sK,ie.stubFalse=aK,ie.stubObject=xNt,ie.stubString=kNt,ie.stubTrue=ENt,ie.multiply=HNt,ie.nth=eDt,ie.noConflict=mNt,ie.noop=oK,ie.now=r4,ie.pad=$Rt,ie.padEnd=VRt,ie.padStart=zRt,ie.parseInt=URt,ie.random=ARt,ie.reduce=iIt,ie.reduceRight=rIt,ie.repeat=jRt,ie.replace=qRt,ie.result=SRt,ie.round=$Nt,ie.runInContext=Re,ie.sample=sIt,ie.size=cIt,ie.snakeCase=KRt,ie.some=uIt,ie.sortedIndex=aDt,ie.sortedIndexBy=lDt,ie.sortedIndexOf=cDt,ie.sortedLastIndex=uDt,ie.sortedLastIndexBy=dDt,ie.sortedLastIndexOf=hDt,ie.startCase=YRt,ie.startsWith=ZRt,ie.subtract=VNt,ie.sum=zNt,ie.sumBy=UNt,ie.template=XRt,ie.times=TNt,ie.toFinite=ng,ie.toInteger=Pn,ie.toLength=g1e,ie.toLower=QRt,ie.toNumber=Qc,ie.toSafeInteger=QIt,ie.toString=Ai,ie.toUpper=JRt,ie.trim=eNt,ie.trimEnd=tNt,ie.trimStart=nNt,ie.truncate=iNt,ie.unescape=rNt,ie.uniqueId=DNt,ie.upperCase=oNt,ie.upperFirst=tK,ie.each=e1e,ie.eachRight=t1e,ie.first=Z0e,rK(ie,function(){var C={};return xh(ie,function(S,I){Bi.call(ie.prototype,I)||(C[I]=S)}),C}(),{chain:!1}),ie.VERSION=i,qc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(C){ie[C].placeholder=ie}),qc(["drop","take"],function(C,S){ni.prototype[C]=function(I){I=I===t?1:Qo(Pn(I),0);var F=this.__filtered__&&!S?new ni(this):this.clone();return F.__filtered__?F.__takeCount__=aa(I,F.__takeCount__):F.__views__.push({size:aa(I,q),type:C+(F.__dir__<0?"Right":"")}),F},ni.prototype[C+"Right"]=function(I){return this.reverse()[C](I).reverse()}}),qc(["filter","map","takeWhile"],function(C,S){var I=S+1,F=I==X||I==O;ni.prototype[C]=function(Z){var ue=this.clone();return ue.__iteratees__.push({iteratee:nn(Z,3),type:I}),ue.__filtered__=ue.__filtered__||F,ue}}),qc(["head","last"],function(C,S){var I="take"+(S?"Right":"");ni.prototype[C]=function(){return this[I](1).value()[0]}}),qc(["initial","tail"],function(C,S){var I="drop"+(S?"":"Right");ni.prototype[C]=function(){return this.__filtered__?new ni(this):this[I](1)}}),ni.prototype.compact=function(){return this.filter(Cl)},ni.prototype.find=function(C){return this.filter(C).head()},ni.prototype.findLast=function(C){return this.reverse().find(C)},ni.prototype.invokeMap=Vn(function(C,S){return typeof C=="function"?new ni(this):this.map(function(I){return PT(I,C,S)})}),ni.prototype.reject=function(C){return this.filter(s4(nn(C)))},ni.prototype.slice=function(C,S){C=Pn(C);var I=this;return I.__filtered__&&(C>0||S<0)?new ni(I):(C<0?I=I.takeRight(-C):C&&(I=I.drop(C)),S!==t&&(S=Pn(S),I=S<0?I.dropRight(-S):I.take(S-C)),I)},ni.prototype.takeRightWhile=function(C){return this.reverse().takeWhile(C).reverse()},ni.prototype.toArray=function(){return this.take(q)},xh(ni.prototype,function(C,S){var I=/^(?:filter|find|map|reject)|While$/.test(S),F=/^(?:head|last)$/.test(S),Z=ie[F?"take"+(S=="last"?"Right":""):S],ue=F||/^find/.test(S);!Z||(ie.prototype[S]=function(){var Ce=this.__wrapped__,Le=F?[1]:arguments,Ne=Ce instanceof ni,at=Le[0],ct=Ne||Ln(Ce),ht=function(Jn){var si=Z.apply(ie,gm([Jn],Le));return F&&Lt?si[0]:si};ct&&I&&typeof at=="function"&&at.length!=1&&(Ne=ct=!1);var Lt=this.__chain__,Ut=!!this.__actions__.length,sn=ue&&!Lt,Wn=Ne&&!Ut;if(!ue&&ct){Ce=Wn?Ce:new ni(this);var an=C.apply(Ce,Le);return an.__actions__.push({func:n4,args:[ht],thisArg:t}),new Gc(an,Lt)}return sn&&Wn?C.apply(this,Le):(an=this.thru(ht),sn?F?an.value()[0]:an.value():an)})}),qc(["pop","push","shift","sort","splice","unshift"],function(C){var S=LP[C],I=/^(?:push|sort|unshift)$/.test(C)?"tap":"thru",F=/^(?:pop|shift)$/.test(C);ie.prototype[C]=function(){var Z=arguments;if(F&&!this.__chain__){var ue=this.value();return S.apply(Ln(ue)?ue:[],Z)}return this[I](function(Ce){return S.apply(Ln(Ce)?Ce:[],Z)})}}),xh(ni.prototype,function(C,S){var I=ie[S];if(I){var F=I.name+"";Bi.call(Hy,F)||(Hy[F]=[]),Hy[F].push({name:S,func:I})}}),Hy[YP(t,p).name]=[{name:"wrapper",func:t}],ni.prototype.clone=rTt,ni.prototype.reverse=oTt,ni.prototype.value=sTt,ie.prototype.at=MDt,ie.prototype.chain=PDt,ie.prototype.commit=FDt,ie.prototype.next=BDt,ie.prototype.plant=HDt,ie.prototype.reverse=$Dt,ie.prototype.toJSON=ie.prototype.valueOf=ie.prototype.value=VDt,ie.prototype.first=ie.prototype.head,DT&&(ie.prototype[DT]=WDt),ie},Fy=FEt();qu?((qu.exports=Fy)._=Fy,fb._=Fy):vr._=Fy}).call(Nt)})(o0,o0.exports);let OX;const Zxe=Tg(async()=>(await Promise.resolve().then(function(){return Fmt})).FileTree),Xxe=Tg(async()=>(await Promise.resolve().then(function(){return sme})).Editor),Qxe=Tg(async()=>(await Promise.resolve().then(function(){return x0t})).default),Jxe=Tg(async()=>(await Promise.resolve().then(function(){return L0t})).default),eke=Tg(async()=>(await Promise.resolve().then(function(){return D0t})).default),tke=Tg(async()=>await Promise.resolve().then(function(){return Q0t}));class nke{constructor({debug:e,ticket:t,tenantId:i,userInfo:r,components:o,paasDomain:s}){Wi(this,"onMessage");Wi(this,"onError");Wi(this,"userInfo");Wi(this,"ticket");Wi(this,"tenantId");Wi(this,"components");Wi(this,"componentHash");Wi(this,"editorDOM");Wi(this,"cmps",{});Wi(this,"paasDomain");this.ticket=t,this.tenantId=i,this.userInfo=this.generateDefaultAvatar(r),this.components=o,this.paasDomain=s,this.componentHash={Page:"",Tree:"",Editor:"",Console:"",Browser:"",Shell:""},this.init(),this.on=this.on.bind(this),this.trigger=this.trigger.bind(this)}get playgroundStatus(){return this.daoStore.playgroundInfo.status}get dockerStatus(){return this.daoStore.playgroundInfo.dockerInfo.runStatus}get ignoreReplayers(){return e3.getState().ignoreReplayers}get currentAgentUser(){const e=this.daoStore.playgroundInfo;return this.daoStore.playgroundInfo.agentUsers.find(t=>t.agentUserId===e.agentUserId)}get userColors(){return this.daoStore.playgroundInfo.agentUsers.map((e,t)=>J5(t))}async dispose(){var e;(e=Xt.getState().socket)==null||e.disconnect(),console.log("\u5373\u5C06\u9500\u6BC1\u7684\u7EC4\u4EF6\u8282\u70B9",this.componentHash);for(const t in this.componentHash)if(this.componentHash[t]){const i=document.querySelector(this.componentHash[t]);i&&lc.exports.unmountComponentAtNode(i)}return console.log("instance has disposed"),new Promise(t=>{t("instance has disposed")})}followUser(e){var l;const{playgroundInfo:t,setPlaygroundInfo:i}=this.daoStore,{agentUserId:r,agentUsers:o}=t,s=o.findIndex(c=>c.agentUserId===r),a=oD(e);if(s>-1){o[s]=rt(Ee({},o[s]),{followingAgentUserId:e,fileOpened:a==null?void 0:a.fileOpened}),i(rt(Ee({},t),{agentUsers:o})),this.trigger(!0,rt(Ee({},this.daoStore.playgroundInfo),{followingUser:o.find(u=>u.agentUserId===e)||{}}));const c={timestamp:Date.now(),agentUserId:r,file:{action:"Get",path:a==null?void 0:a.fileOpened}};(l=Xt.getState().socket)==null||l.emit("fileContent",c)}eSe(e)}unFollowUser(e){JZ(),e&&e()}replay(e){}setIgnoreReplayers(e){e3.getState().setIgnoreReplayer(e)}activePlayground(){var e;(e=Xt.getState().socket)==null||e.emit("active"),clearTimeout(OX)}runPlayground(){var e;(e=Xt.getState().socket)==null||e.emit("run")}stopPlayground(){var e;(e=Xt.getState().socket)==null||e.emit("stop")}onUploadFile(e){var t;(t=Xt.getState().socket)==null||t.emit("upload",e)}record(e){const{socket:t}=Xt.getState();if(e==="undefined"){this.daoStore.setGlobalData({isRecording:!!e}),t==null||t.emit("globalData",{isRecording:!!e});return}this.daoStore.setGlobalData({isRecording:!!e}),t==null||t.emit("globalData",{isRecording:!!e})}Page({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(tke,Ee({},t))}),this.editorDOM)}Editor({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Editor"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(Xxe,Ee({serviceWorkerOrigin:this.paasDomain},t))}),this.editorDOM)}Shell({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Shell"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(eke,Ee({},t))}),this.editorDOM)}Tree({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Tree"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(Zxe,Ee({},t))}),this.editorDOM)}Console({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Console"):this.editorDOM;const i=be(Qxe,Ee({ref:r=>{this.cmps.Console=r}},t));lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:i}),this.editorDOM)}Browser({container:e,props:t}){this.editorDOM=e?this.isHTMLElement(e,"Browser"):this.editorDOM,lc.exports.render(be(N.exports.Suspense,{fallback:be(r0,{}),children:be(Jxe,Ee({},t))}),this.editorDOM)}get daoStore(){return jt.getState()}async init(){const e="0.8.6",{setSocket:t}=Xt.getState(),i=document.createElement("div");i.className="init-class",document.body.appendChild(i);let r={}.PAAS_MANAGER_API_ORIGIN||"https://www.1024paas.com";this.paasDomain&&(r=this.paasDomain),console.log(`${this.paasDomain} passDomain from sdk`);const s=await(await fetch(r+"/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:this.ticket,packageVersion:e})})).json();if(s.status==="failure")throw this.trigger("error",{message:{content:s.errors[0].errmsg}}),Error(s.errors[0].errmsg);const a=sessionStorage.getItem("agentUserId")||"",l=new qwe({debug:!0,ticket:this.ticket,userInfo:this.userInfo,tenantId:this.tenantId,agentUserId:a,ioPath:s.data});if(t(l),!this.ticket)throw"\u7F3A\u5C11ticket";xSe(),this.components&&this.mapRender(this.components),this.messageAndErrorInjection()}messageAndErrorInjection(){jt.subscribe(e=>e,e=>{if(e.playgroundInfo){e.playgroundInfo.status==="ACTIVE"&&clearTimeout(OX);const t=e.playgroundInfo.agentUsers.find(r=>r.agentUserId===this.daoStore.playgroundInfo.agentUserId)||{},i=t.followingAgentUserId?e.playgroundInfo.agentUsers.find(r=>r.agentUserId===t.followingAgentUserId):null;this.trigger(!0,rt(Ee(Ee({},this.daoStore.playgroundInfo),e.playgroundInfo),{followingUser:i,userColors:this.userColors}))}}),GZ.subscribe(e=>e,e=>{this.trigger("error",o0.exports.pick(e,"message"))}),Xwe.subscribe((e,t)=>{this.trigger({usersFollowYou:e.followingUsers},{usersFollowYou:e.followingUsers})})}trigger(e,t){if(e==="error"){this.on(t,e);return}this.on(t)}on(e,t){t==="error"?this.onError&&this.onError(e):this.onMessage&&this.onMessage(e)}mapRender(e){e==null||e.forEach((t,i)=>{const r=o0.exports.omit(Ee({},t),["item","container"]);switch(t.item){case"Page":this.Page({container:t.container,props:t.props||r});break;case"Tree":this.Tree({container:t.container,props:t.props||r});break;case"Editor":this.Editor({container:t.container,props:Ee({},t.props)});break;case"Console":this.Console({container:t.container,props:t.props||r});break;case"Shell":this.Shell({container:t.container,props:t.props||r});break;case"Browser":this.Browser({container:t.container,props:t.props||r});break}})}isHTMLElement(e,t){const i=/HTMLDivElement|HTMLElement/.test(Object.prototype.toString.call(e));return!i&&t&&(this.componentHash[t]=e),i?e:document.querySelector(e)}generateDefaultAvatar(e){return e.avatarUrl||(e.avatarUrl=`https://ui-avatars.com/api/?background=e9f3f0&rounded=true&uppercase=true&bold=true&length=1&name=${e.username}`),e}}var Ph;(function(n){n.DoubleClickItemToExpand="double-click-item-to-expand",n.ClickItemToExpand="click-item-to-expand",n.ClickArrowToExpand="click-arrow-to-expand"})(Ph||(Ph={}));var kD=globalThis&&globalThis.__assign||function(){return kD=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},kD.apply(this,arguments)},ike=function(n,e){return{mode:n.mode,createInteractiveElementProps:function(t,i,r,o){return kD(kD({},e.createInteractiveElementProps(t,i,r,o)),n.createInteractiveElementProps(t,i,r,o))}}},rke=function(){function n(e){this.mode=Ph.DoubleClickItemToExpand,this.environment=e}return n.prototype.createInteractiveElementProps=function(e,t,i,r){var o=this;return{onClick:function(s){i.focusItem(),s.shiftKey?i.selectUpTo():s.ctrlKey?r.isSelected?i.unselectItem():i.addToSelectedItems():i.selectItem()},onDoubleClick:function(){i.focusItem(),i.selectItem(),e.hasChildren&&i.toggleExpandedState(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction()},onFocus:function(){i.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:r.canDrag&&!r.isRenaming,tabIndex:r.isRenaming?void 0:r.isFocused?0:-1}},n}(),oke=function(){function n(e){this.mode=Ph.ClickItemToExpand,this.environment=e}return n.prototype.createInteractiveElementProps=function(e,t,i,r){var o=this;return{onClick:function(s){i.focusItem(),s.shiftKey?i.selectUpTo():s.ctrlKey?r.isSelected?i.unselectItem():i.addToSelectedItems():(e.hasChildren&&i.toggleExpandedState(),i.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:r.canDrag&&!r.isRenaming,tabIndex:r.isRenaming?void 0:r.isFocused?0:-1}},n}(),ske=function(){function n(e){this.mode=Ph.ClickItemToExpand,this.environment=e}return n.prototype.createInteractiveElementProps=function(e,t,i,r){var o=this;return{onClick:function(s){i.focusItem(),s.shiftKey?i.selectUpTo():s.ctrlKey?r.isSelected?i.unselectItem():i.addToSelectedItems():(i.selectItem(),(!e.hasChildren||o.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(s){s.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(s){s.preventDefault()},draggable:r.canDrag&&!r.isRenaming,tabIndex:r.isRenaming?void 0:r.isFocused?0:-1}},n}(),MX=function(n,e){switch(n){case Ph.DoubleClickItemToExpand:return new rke(e);case Ph.ClickItemToExpand:return new oke(e);case Ph.ClickArrowToExpand:return new ske(e);default:throw Error("Unknown interaction mode "+n)}},PX=N.exports.createContext(null),ake=function(){return N.exports.useContext(PX)},lke=function(n){var e=ir(),t=e.defaultInteractionMode,i=N.exports.useMemo(function(){var r;return t&&typeof t!="string"?t.extends?ike(t,MX(t.extends,e)):t:MX((r=t)!==null&&r!==void 0?r:Ph.ClickItemToExpand,e)},[]);return N.exports.createElement(PX.Provider,{value:i},n.children)},FX=function(){var n=ir();return N.exports.useCallback(function(e,t){for(var i=n.linearItems[t],r=i[e].depth,o=e;!!i[o]&&i[o].depth!==r-1;o--);var s=i[o];return s||(s={item:n.trees[t].rootItem,depth:0},o=0),s},[n.linearItems,n.trees])},cke=function(n,e){return n.clientX<e.left||n.clientX>e.right||n.clientY<e.top||n.clientY>e.bottom},uke=function(n,e,t,i,r){var o=(n-e)/t,s=Math.floor(o),a=void 0,l=i||r?.2:.5;return o%1<l?a="top":o%1>1-l&&(a="bottom"),{linearIndex:s,offset:a}},dke=function(n,e,t,i,r){var o=ir(),s=o.canDropOnItemWithChildren,a=o.canDropOnItemWithoutChildren,l=o.canDragAndDrop,c=o.linearItems,u=o.items,d=o.canReorderItems,f=o.viewState,h=FX();return N.exports.useCallback(function(g,v,m){var p,_,b,y;if(!!l&&!!m.current&&!(g.clientX<0||g.clientY<0)){var w=m.current.getBoundingClientRect(),k=cke(g,w),x=uke(g.clientY,w.top,t,s,a),T=x.linearIndex,L=x.offset,D=k?"outside":""+v+T+(L!=null?L:"");if(n!==D){if(e(D),k){i(void 0);return}if(T<0||T>=c[v].length){i(void 0);return}var R=c[v][T],M=R.depth,A=u[R.item];if(!L&&!a&&!A.hasChildren){i(void 0);return}if(!L&&!s&&A.hasChildren){i(void 0);return}if(L&&!d){i(void 0);return}var X=h(T,v);if(!(!((_=(p=f[v])===null||p===void 0?void 0:p.selectedItems)===null||_===void 0)&&_.includes(R.item))){var H=u[X.item].children.indexOf(R.item)+(L==="top"?0:1);L==="top"&&M===((y=(b=c[v][T-1])===null||b===void 0?void 0:b.depth)!==null&&y!==void 0?y:-1)&&(L="bottom",T-=1);var O;L?O={targetType:"between-items",treeId:v,parentItem:X.item,depth:R.depth,linearIndex:T+(L==="top"?0:1),childIndex:H,linePosition:L}:O={targetType:"item",treeId:v,parentItem:X.item,targetItem:R.item,depth:R.depth,linearIndex:T},r(O)}}}},[l,s,a,d,h,t,u,n,c,i,r,e,f])},BX=function(){var n=ir();return N.exports.useCallback(function(e,t){if(e.targetType==="between-items"){if(!n.canReorderItems)return!1}else{var i=n.items[e.targetItem];if(!n.canDropOnItemWithChildren&&i.hasChildren||!n.canDropOnItemWithoutChildren&&!i.hasChildren)return!1}return!(n.canDropAt&&(!t||!n.canDropAt(t,e)))},[n])},WX=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},hke=function(){var n=ir(),e=FX(),t=BX();return N.exports.useCallback(function(i,r){var o=n.linearItems[i];return o.map(function(s,a){var l,c,u=s.item,d=s.depth,f=e(a,i),h=n.items[f.item].children.indexOf(u),g={targetType:"item",parentItem:f.item,targetItem:u,linearIndex:a,depth:d,treeId:i},v={targetType:"between-items",parentItem:f.item,linePosition:"top",childIndex:h,depth:d,treeId:i,linearIndex:a},m={targetType:"between-items",parentItem:f.item,linePosition:"bottom",linearIndex:a+1,childIndex:h+1,depth:d,treeId:i},p=d===((c=(l=o[a-1])===null||l===void 0?void 0:l.depth)!==null&&c!==void 0?c:-1);return p?[g,m]:[v,g,m]}).reduce(function(s,a){return WX(WX([],s),a)},[]).filter(function(s){return t(s,r)})},[t,n.items,n.linearItems,e])},ED=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},TD=function(n,e,t){var i=N.exports.useRef();N.exports.useEffect(function(){if(!i.current)i.current=ED([],t),n();else{var r=i.current.some(function(o,s){return o!==t[s]});r&&(i.current=ED([],t),n())}},ED(ED([],e),t))},LD=globalThis&&globalThis.__assign||function(){return LD=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},LD.apply(this,arguments)},HX=function(n,e){return n.map(function(t){return[t,e(t)]}).reduce(function(t,i){var r,o=i[0],s=i[1];return LD(LD({},t),(r={},r[o]=s,r))},{})};function s0(){var n=N.exports.useRef(new Array);N.exports.useEffect(function(){var t=n.current;return function(){return t.forEach(function(i){return cancelAnimationFrame(i)})}},[n]);var e=N.exports.useCallback(function(t){var i=requestAnimationFrame(function(){n.current.splice(n.current.indexOf(i),1),t()});n.current.push(i)},[n]);return e}var $X=N.exports.createContext(null),cd=function(){return N.exports.useContext($X)},fke=function(n){var e=ir(),t=N.exports.useState(!1),i=t[0],r=t[1],o=N.exports.useState(4),s=o[0],a=o[1],l=N.exports.useState({}),c=l[0],u=l[1],d=N.exports.useState(0),f=d[0],h=d[1],g=N.exports.useState(),v=g[0],m=g[1],p=N.exports.useState(),_=p[0],b=p[1],y=N.exports.useState("_nodrag"),w=y[0],k=y[1],x=hke(),T=s0();N.exports.useRef(!1);var L=N.exports.useCallback(function(ne,he){var De;if(e.activeTreeId&&((De=e.viewState[e.activeTreeId])===null||De===void 0?void 0:De.focusedItem)&&e.linearItems&&he){var j=e.viewState[e.activeTreeId].focusedItem,ge=x(e.activeTreeId,he),J=ge.findIndex(function(oe){if(oe.targetType==="item")return oe.targetItem===j;if(oe.targetType==="between-items")return e.items[oe.parentItem].children[oe.childIndex]===j});h(J?Math.min(J+1,ge.length-1):0)}else h(0)},[e.activeTreeId,e.items,e.linearItems,e.viewState,x]),D=N.exports.useCallback(function(){r(!1),a(4),u({}),h(0),m(void 0),b(void 0),k("_nodrag")},[]);TD(function(){e.activeTreeId&&e.linearItems[e.activeTreeId]&&c[e.activeTreeId]&&L(c[e.activeTreeId],v)},[v,e.activeTreeId,e.linearItems,L,c],[e.activeTreeId]),TD(function(){i&&e.activeTreeId&&b(c[e.activeTreeId][f])},[f,e.activeTreeId,i,c],[f,e.activeTreeId]);var R=BX(),M=function(ne){var he;v&&!R(ne,v)||(b(ne),e.setActiveTree(ne.treeId),v&&e.activeTreeId!==ne.treeId&&((he=e.onSelectItems)===null||he===void 0||he.call(e,v.map(function(De){return De.index}),ne.treeId)))},A=dke(w,k,s,b,M),X=N.exports.useCallback(function(){v&&_&&e.onDrop&&(e.onDrop(v,_),T(function(){var ne;(ne=e.onFocusItem)===null||ne===void 0||ne.call(e,v[0],_.treeId),D()}))},[v,_,e,D,T]),H=N.exports.useCallback(function(ne,he){var De,j,ge=HX(e.treeIds,function(oe){return x(oe,ne)}),J=(j=(De=document.querySelector('[data-rct-tree="'+he+'"] [data-rct-item-container="true"]'))===null||De===void 0?void 0:De.offsetHeight)!==null&&j!==void 0?j:5;a(J),m(ne),u(ge),e.activeTreeId&&L(ge[e.activeTreeId],ne)},[e.activeTreeId,e.treeIds,x,L]),O=N.exports.useCallback(function(){var ne,he,De;if(!!e.canDragAndDrop&&e.activeTreeId){var j=(he=(ne=e.viewState[e.activeTreeId])===null||ne===void 0?void 0:ne.selectedItems)!==null&&he!==void 0?he:[(De=e.viewState[e.activeTreeId])===null||De===void 0?void 0:De.focusedItem];if(j.length===0||j[0]===void 0)return;var ge=j.map(function(J){return e.items[J]});if(e.canDrag&&!e.canDrag(ge))return;H(ge,e.activeTreeId),setTimeout(function(){r(!0)})}},[H,e]),W=N.exports.useCallback(function(){D()},[D]),V=N.exports.useCallback(function(){X(),D()},[X,D]),G=N.exports.useCallback(function(){h(function(ne){return Math.max(0,ne-1)})},[]),pe=N.exports.useCallback(function(){e.activeTreeId&&h(function(ne){return Math.min(c[e.activeTreeId].length,ne+1)})},[e.activeTreeId,c]),q={onStartDraggingItems:H,startProgrammaticDrag:O,abortProgrammaticDrag:W,completeProgrammaticDrag:V,programmaticDragUp:G,programmaticDragDown:pe,draggingItems:v,draggingPosition:_,itemHeight:s,isProgrammaticallyDragging:i,onDragOverTreeHandler:A,viableDragPositions:c};return N.exports.useEffect(function(){return window.addEventListener("dragend",D),window.addEventListener("drop",X),function(){window.removeEventListener("dragend",D),window.removeEventListener("drop",X)}},[X,D]),N.exports.createElement($X.Provider,{value:q},n.children)},eS=globalThis&&globalThis.__assign||function(){return eS=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},eS.apply(this,arguments)},gke=function(n,e){var t=ir(),i=cd();N.exports.useImperativeHandle(n,function(){return eS(eS(eS({},e),t),{treeEnvironmentContext:t,dragAndDropContext:i})})},VX=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},zX=N.exports.createContext(null),pke=function(){return N.exports.useContext(zX)},mke=N.exports.forwardRef(function(n,e){var t=ir(),i=t.onCollapseItem,r=t.items;t.trees;var o=t.viewState,s=t.onExpandItem,a=t.onFocusItem,l=t.setActiveTree,c=t.onRenameItem,u=t.onSelectItems,d=t.onPrimaryAction,f=t.linearItems,h=cd(),g=h.abortProgrammaticDrag,v=h.completeProgrammaticDrag,m=h.programmaticDragDown,p=h.programmaticDragUp,_=h.startProgrammaticDrag,b={abortProgrammaticDrag:N.exports.useCallback(function(){g()},[g]),collapseItem:N.exports.useCallback(function(y,w){i==null||i(r[y],w)},[r,i]),completeProgrammaticDrag:N.exports.useCallback(function(){v()},[v]),expandItem:N.exports.useCallback(function(y,w){s==null||s(r[y],w)},[r,s]),focusItem:N.exports.useCallback(function(y,w){a==null||a(r[y],w)},[r,a]),focusTree:N.exports.useCallback(function(y,w){w===void 0&&(w=!0),l(y,w)},[l]),moveFocusDown:N.exports.useCallback(function(y){var w=f[y],k=w.findIndex(function(L){var D,R=L.item;return R===((D=o[y])===null||D===void 0?void 0:D.focusedItem)}),x=k!==void 0?Math.min(w.length-1,k+1):0,T=r[w[x].item];a==null||a(T,y)},[r,f,a,o]),moveFocusUp:N.exports.useCallback(function(y){var w=f[y],k=w.findIndex(function(L){var D,R=L.item;return R===((D=o[y])===null||D===void 0?void 0:D.focusedItem)}),x=k!==void 0?Math.max(0,k-1):0,T=r[w[x].item];a==null||a(T,y)},[r,f,a,o]),moveProgrammaticDragPositionDown:N.exports.useCallback(function(){m()},[m]),moveProgrammaticDragPositionUp:N.exports.useCallback(function(){p()},[p]),renameItem:N.exports.useCallback(function(y,w,k){c==null||c(r[y],w,k)},[r,c]),selectItems:N.exports.useCallback(function(y,w){u==null||u(y,w)},[u]),startProgrammaticDrag:N.exports.useCallback(function(){_()},[_]),toggleItemExpandedState:N.exports.useCallback(function(y,w){var k,x;!((x=(k=o[w])===null||k===void 0?void 0:k.expandedItems)===null||x===void 0)&&x.includes(y)?i==null||i(r[y],w):s==null||s(r[y],w)},[r,i,s,o]),toggleItemSelectStatus:N.exports.useCallback(function(y,w){var k,x,T,L,D;!((x=(k=o[w])===null||k===void 0?void 0:k.selectedItems)===null||x===void 0)&&x.includes(y)?u==null||u((L=(T=o[w].selectedItems)===null||T===void 0?void 0:T.filter(function(R){return R!==y}))!==null&&L!==void 0?L:[],w):u==null||u(VX(VX([],(D=o[w].selectedItems)!==null&&D!==void 0?D:[]),[y]),w)},[u,o]),invokePrimaryAction:N.exports.useCallback(function(y,w){d==null||d(r[y],w)},[r,d])};return gke(e,b),N.exports.createElement(zX.Provider,{value:b},n.children)}),_ke=function(n){if(!!n)if(n.scrollIntoViewIfNeeded)n.scrollIntoViewIfNeeded();else{var e=n.getBoundingClientRect(),t=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);t||n.scrollIntoView()}},kl=globalThis&&globalThis.__assign||function(){return kl=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},kl.apply(this,arguments)},Lg=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(function(t){return!!t}).join(" ")},vke=function(n){return{renderItemTitle:function(e){var t=e.title,i=e.context,r=e.info;if(!r.isSearching||!i.isSearchMatching)return Ve.createElement(Ve.Fragment,null,t);var o=t.toLowerCase().indexOf(r.search.toLowerCase());return Ve.createElement(Ve.Fragment,null,o>0&&Ve.createElement("span",null,t.slice(0,o)),Ve.createElement("span",{className:"rct-tree-item-search-highlight"},t.slice(o,o+r.search.length)),o+r.search.length<t.length&&Ve.createElement("span",null,t.slice(o+r.search.length,t.length)))},renderItemArrow:function(e){var t=e.item,i=e.context;return Ve.createElement("div",kl({className:Lg(t.hasChildren&&"rct-tree-item-arrow-hasChildren","rct-tree-item-arrow")},i.arrowProps),t.hasChildren&&(i.isExpanded?Ve.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Ve.createElement("g",null,Ve.createElement("g",null,Ve.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M12,5c-0.28,0-0.53,0.11-0.71,0.29L8,8.59L4.71,5.29C4.53,5.11,4.28,5,4,5
|
|
242
242
|
C3.45,5,3,5.45,3,6c0,0.28,0.11,0.53,0.29,0.71l4,4C7.47,10.89,7.72,11,8,11s0.53-0.11,0.71-0.29l4-4C12.89,6.53,13,6.28,13,6
|
|
243
243
|
C13,5.45,12.55,5,12,5z`,className:"rct-tree-item-arrow-path"})))):Ve.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},Ve.createElement("g",null,Ve.createElement("g",null,Ve.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M10.71,7.29l-4-4C6.53,3.11,6.28,3,6,3C5.45,3,5,3.45,5,4
|
|
244
244
|
c0,0.28,0.11,0.53,0.29,0.71L8.59,8l-3.29,3.29C5.11,11.47,5,11.72,5,12c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l4-4
|