@platforma-sdk/ui-vue 1.4.2 → 1.4.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @platforma-sdk/ui-vue
2
2
 
3
+ ## 1.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - ae39723: fix for ReactiveFileContent
8
+
3
9
  ## 1.4.2
4
10
 
5
11
  ### Patch Changes
package/dist/lib.js CHANGED
@@ -50322,7 +50322,7 @@ const Nn = class Nn {
50322
50322
  return this.fileContentBytes.set(t, s), (async () => {
50323
50323
  try {
50324
50324
  const n = await VD().blobDriver.getContent(t);
50325
- s.value = JSON.parse(new TextDecoder().decode(n));
50325
+ s.value = n;
50326
50326
  } catch (n) {
50327
50327
  console.error(n);
50328
50328
  }
package/dist/lib.umd.cjs CHANGED
@@ -246,4 +246,4 @@ __p += '`),Be&&(Y+=`' +
246
246
  function print() { __p += __j.call(arguments, '') }
247
247
  `:`;
248
248
  `)+Y+`return __p
249
- }`;var Me=Nw(function(){return ze(F,de+"return "+Y).apply(i,E)});if(Me.source=Y,$h(Me))throw Me;return Me}function SK(l){return Ue(l).toLowerCase()}function yK(l){return Ue(l).toUpperCase()}function bK(l,u,p){if(l=Ue(l),l&&(p||u===i))return jC(l);if(!l||!(u=Xt(u)))return l;var C=Mi(l),S=Mi(u),F=ZC(C,S),E=qC(C,S)+1;return Ys(C,F,E).join("")}function RK(l,u,p){if(l=Ue(l),l&&(p||u===i))return l.slice(0,QC(l)+1);if(!l||!(u=Xt(u)))return l;var C=Mi(l),S=qC(C,Mi(u))+1;return Ys(C,0,S).join("")}function FK(l,u,p){if(l=Ue(l),l&&(p||u===i))return l.replace($u,"");if(!l||!(u=Xt(u)))return l;var C=Mi(l),S=ZC(C,Mi(u));return Ys(C,S).join("")}function xK(l,u){var p=z,C=H;if(it(u)){var S="separator"in u?u.separator:S;p="length"in u?De(u.length):p,C="omission"in u?Xt(u.omission):C}l=Ue(l);var F=l.length;if(Co(l)){var E=Mi(l);F=E.length}if(p>=F)return l;var D=p-vo(C);if(D<1)return C;var L=E?Ys(E,0,D).join(""):l.slice(0,D);if(S===i)return L+C;if(E&&(D+=L.length-D),Kh(S)){if(l.slice(D).search(S)){var $,K=L;for(S.global||(S=ah(S.source,Ue(fC.exec(S))+"g")),S.lastIndex=0;$=S.exec(K);)var Y=$.index;L=L.slice(0,Y===i?D:Y)}}else if(l.indexOf(Xt(S),D)!=D){var te=L.lastIndexOf(S);te>-1&&(L=L.slice(0,te))}return L+C}function EK(l){return l=Ue(l),l&&VH.test(l)?l.replace(hC,tz):l}var PK=xo(function(l,u,p){return l+(p?" ":"")+u.toUpperCase()}),qh=Bv("toUpperCase");function Vw(l,u,p){return l=Ue(l),u=p?i:u,u===i?YW(l)?nz(l):HW(l):l.match(u)||[]}var Nw=Ie(function(l,u){try{return Yt(l,i,u)}catch(p){return $h(p)?p:new be(p)}}),DK=ps(function(l,u){return di(u,function(p){p=qi(p),us(l,p,zh(l[p],l))}),l});function TK(l){var u=l==null?0:l.length,p=fe();return l=u?Je(l,function(C){if(typeof C[1]!="function")throw new ui(r);return[p(C[0]),C[1]]}):[],Ie(function(C){for(var S=-1;++S<u;){var F=l[S];if(Yt(F[0],this,C))return Yt(F[1],this,C)}})}function AK(l){return t2(pi(l,f))}function Yh(l){return function(){return l}}function MK(l,u){return l==null||l!==l?u:l}var kK=Hv(),IK=Hv(!0);function Ut(l){return l}function Qh(l){return Cv(typeof l=="function"?l:pi(l,f))}function LK(l){return wv(pi(l,f))}function OK(l,u){return Sv(l,pi(u,f))}var _K=Ie(function(l,u){return function(p){return Jr(p,l,u)}}),VK=Ie(function(l,u){return function(p){return Jr(l,p,u)}});function Xh(l,u,p){var C=pt(u),S=ja(u,C);p==null&&!(it(u)&&(S.length||!C.length))&&(p=u,u=l,l=this,S=ja(u,pt(u)));var F=!(it(p)&&"chain"in p)||!!p.chain,E=fs(l);return di(S,function(D){var L=u[D];l[D]=L,E&&(l.prototype[D]=function(){var $=this.__chain__;if(F||$){var K=l(this.__wrapped__),Y=K.__actions__=Ht(this.__actions__);return Y.push({func:L,args:arguments,thisArg:l}),K.__chain__=$,K}return L.apply(l,Us([this.value()],arguments))})}),l}function NK(){return ft._===this&&(ft._=dz),this}function Jh(){}function BK(l){return l=De(l),Ie(function(u){return yv(u,l)})}var GK=Ah(Je),HK=Ah(WC),WK=Ah(th);function Bw(l){return Vh(l)?ih(qi(l)):v2(l)}function zK(l){return function(u){return l==null?i:Dn(l,u)}}var UK=zv(),$K=zv(!0);function ep(){return[]}function tp(){return!1}function KK(){return{}}function jK(){return""}function ZK(){return!0}function qK(l,u){if(l=De(l),l<1||l>Oe)return[];var p=Gt,C=Ft(l,Gt);u=fe(u),l-=Gt;for(var S=oh(C,u);++p<l;)u(p);return S}function YK(l){return Re(l)?Je(l,qi):Jt(l)?[l]:Ht(ow(Ue(l)))}function QK(l){var u=++az;return Ue(l)+u}var XK=Ja(function(l,u){return l+u},0),JK=Mh("ceil"),e4=Ja(function(l,u){return l/u},1),t4=Mh("floor");function i4(l){return l&&l.length?Ka(l,Ut,mh):i}function s4(l,u){return l&&l.length?Ka(l,fe(u,2),mh):i}function n4(l){return $C(l,Ut)}function o4(l,u){return $C(l,fe(u,2))}function r4(l){return l&&l.length?Ka(l,Ut,Sh):i}function l4(l,u){return l&&l.length?Ka(l,fe(u,2),Sh):i}var a4=Ja(function(l,u){return l*u},1),c4=Mh("round"),d4=Ja(function(l,u){return l-u},0);function u4(l){return l&&l.length?nh(l,Ut):0}function h4(l,u){return l&&l.length?nh(l,fe(u,2)):0}return R.after=L$,R.ary=mw,R.assign=y3,R.assignIn=Aw,R.assignInWith=hc,R.assignWith=b3,R.at=R3,R.before=Cw,R.bind=zh,R.bindAll=DK,R.bindKey=vw,R.castArray=K$,R.chain=pw,R.chunk=tU,R.compact=iU,R.concat=sU,R.cond=TK,R.conforms=AK,R.constant=Yh,R.countBy=u$,R.create=F3,R.curry=ww,R.curryRight=Sw,R.debounce=yw,R.defaults=x3,R.defaultsDeep=E3,R.defer=O$,R.delay=_$,R.difference=nU,R.differenceBy=oU,R.differenceWith=rU,R.drop=lU,R.dropRight=aU,R.dropRightWhile=cU,R.dropWhile=dU,R.fill=uU,R.filter=p$,R.flatMap=m$,R.flatMapDeep=C$,R.flatMapDepth=v$,R.flatten=cw,R.flattenDeep=hU,R.flattenDepth=pU,R.flip=V$,R.flow=kK,R.flowRight=IK,R.fromPairs=gU,R.functions=I3,R.functionsIn=L3,R.groupBy=w$,R.initial=mU,R.intersection=CU,R.intersectionBy=vU,R.intersectionWith=wU,R.invert=_3,R.invertBy=V3,R.invokeMap=y$,R.iteratee=Qh,R.keyBy=b$,R.keys=pt,R.keysIn=zt,R.map=rc,R.mapKeys=B3,R.mapValues=G3,R.matches=LK,R.matchesProperty=OK,R.memoize=ac,R.merge=H3,R.mergeWith=Mw,R.method=_K,R.methodOf=VK,R.mixin=Xh,R.negate=cc,R.nthArg=BK,R.omit=W3,R.omitBy=z3,R.once=N$,R.orderBy=R$,R.over=GK,R.overArgs=B$,R.overEvery=HK,R.overSome=WK,R.partial=Uh,R.partialRight=bw,R.partition=F$,R.pick=U3,R.pickBy=kw,R.property=Bw,R.propertyOf=zK,R.pull=RU,R.pullAll=uw,R.pullAllBy=FU,R.pullAllWith=xU,R.pullAt=EU,R.range=UK,R.rangeRight=$K,R.rearg=G$,R.reject=P$,R.remove=PU,R.rest=H$,R.reverse=Hh,R.sampleSize=T$,R.set=K3,R.setWith=j3,R.shuffle=A$,R.slice=DU,R.sortBy=I$,R.sortedUniq=OU,R.sortedUniqBy=_U,R.split=mK,R.spread=W$,R.tail=VU,R.take=NU,R.takeRight=BU,R.takeRightWhile=GU,R.takeWhile=HU,R.tap=i$,R.throttle=z$,R.thru=oc,R.toArray=Pw,R.toPairs=Iw,R.toPairsIn=Lw,R.toPath=YK,R.toPlainObject=Tw,R.transform=Z3,R.unary=U$,R.union=WU,R.unionBy=zU,R.unionWith=UU,R.uniq=$U,R.uniqBy=KU,R.uniqWith=jU,R.unset=q3,R.unzip=Wh,R.unzipWith=hw,R.update=Y3,R.updateWith=Q3,R.values=Do,R.valuesIn=X3,R.without=ZU,R.words=Vw,R.wrap=$$,R.xor=qU,R.xorBy=YU,R.xorWith=QU,R.zip=XU,R.zipObject=JU,R.zipObjectDeep=e$,R.zipWith=t$,R.entries=Iw,R.entriesIn=Lw,R.extend=Aw,R.extendWith=hc,Xh(R,R),R.add=XK,R.attempt=Nw,R.camelCase=iK,R.capitalize=Ow,R.ceil=JK,R.clamp=J3,R.clone=j$,R.cloneDeep=q$,R.cloneDeepWith=Y$,R.cloneWith=Z$,R.conformsTo=Q$,R.deburr=_w,R.defaultTo=MK,R.divide=e4,R.endsWith=sK,R.eq=Ii,R.escape=nK,R.escapeRegExp=oK,R.every=h$,R.find=g$,R.findIndex=lw,R.findKey=P3,R.findLast=f$,R.findLastIndex=aw,R.findLastKey=D3,R.floor=t4,R.forEach=gw,R.forEachRight=fw,R.forIn=T3,R.forInRight=A3,R.forOwn=M3,R.forOwnRight=k3,R.get=jh,R.gt=X$,R.gte=J$,R.has=O3,R.hasIn=Zh,R.head=dw,R.identity=Ut,R.includes=S$,R.indexOf=fU,R.inRange=eK,R.invoke=N3,R.isArguments=Mn,R.isArray=Re,R.isArrayBuffer=e3,R.isArrayLike=Wt,R.isArrayLikeObject=rt,R.isBoolean=t3,R.isBuffer=Qs,R.isDate=i3,R.isElement=s3,R.isEmpty=n3,R.isEqual=o3,R.isEqualWith=r3,R.isError=$h,R.isFinite=l3,R.isFunction=fs,R.isInteger=Rw,R.isLength=dc,R.isMap=Fw,R.isMatch=a3,R.isMatchWith=c3,R.isNaN=d3,R.isNative=u3,R.isNil=p3,R.isNull=h3,R.isNumber=xw,R.isObject=it,R.isObjectLike=nt,R.isPlainObject=ol,R.isRegExp=Kh,R.isSafeInteger=g3,R.isSet=Ew,R.isString=uc,R.isSymbol=Jt,R.isTypedArray=Po,R.isUndefined=f3,R.isWeakMap=m3,R.isWeakSet=C3,R.join=SU,R.kebabCase=rK,R.last=fi,R.lastIndexOf=yU,R.lowerCase=lK,R.lowerFirst=aK,R.lt=v3,R.lte=w3,R.max=i4,R.maxBy=s4,R.mean=n4,R.meanBy=o4,R.min=r4,R.minBy=l4,R.stubArray=ep,R.stubFalse=tp,R.stubObject=KK,R.stubString=jK,R.stubTrue=ZK,R.multiply=a4,R.nth=bU,R.noConflict=NK,R.noop=Jh,R.now=lc,R.pad=cK,R.padEnd=dK,R.padStart=uK,R.parseInt=hK,R.random=tK,R.reduce=x$,R.reduceRight=E$,R.repeat=pK,R.replace=gK,R.result=$3,R.round=c4,R.runInContext=k,R.sample=D$,R.size=M$,R.snakeCase=fK,R.some=k$,R.sortedIndex=TU,R.sortedIndexBy=AU,R.sortedIndexOf=MU,R.sortedLastIndex=kU,R.sortedLastIndexBy=IU,R.sortedLastIndexOf=LU,R.startCase=CK,R.startsWith=vK,R.subtract=d4,R.sum=u4,R.sumBy=h4,R.template=wK,R.times=qK,R.toFinite=ms,R.toInteger=De,R.toLength=Dw,R.toLower=SK,R.toNumber=mi,R.toSafeInteger=S3,R.toString=Ue,R.toUpper=yK,R.trim=bK,R.trimEnd=RK,R.trimStart=FK,R.truncate=xK,R.unescape=EK,R.uniqueId=QK,R.upperCase=PK,R.upperFirst=qh,R.each=gw,R.eachRight=fw,R.first=dw,Xh(R,function(){var l={};return ji(R,function(u,p){$e.call(R.prototype,p)||(l[p]=u)}),l}(),{chain:!1}),R.VERSION=s,di(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){R[l].placeholder=R}),di(["drop","take"],function(l,u){Ne.prototype[l]=function(p){p=p===i?1:ct(De(p),0);var C=this.__filtered__&&!u?new Ne(this):this.clone();return C.__filtered__?C.__takeCount__=Ft(p,C.__takeCount__):C.__views__.push({size:Ft(p,Gt),type:l+(C.__dir__<0?"Right":"")}),C},Ne.prototype[l+"Right"]=function(p){return this.reverse()[l](p).reverse()}}),di(["filter","map","takeWhile"],function(l,u){var p=u+1,C=p==pe||p==ee;Ne.prototype[l]=function(S){var F=this.clone();return F.__iteratees__.push({iteratee:fe(S,3),type:p}),F.__filtered__=F.__filtered__||C,F}}),di(["head","last"],function(l,u){var p="take"+(u?"Right":"");Ne.prototype[l]=function(){return this[p](1).value()[0]}}),di(["initial","tail"],function(l,u){var p="drop"+(u?"":"Right");Ne.prototype[l]=function(){return this.__filtered__?new Ne(this):this[p](1)}}),Ne.prototype.compact=function(){return this.filter(Ut)},Ne.prototype.find=function(l){return this.filter(l).head()},Ne.prototype.findLast=function(l){return this.reverse().find(l)},Ne.prototype.invokeMap=Ie(function(l,u){return typeof l=="function"?new Ne(this):this.map(function(p){return Jr(p,l,u)})}),Ne.prototype.reject=function(l){return this.filter(cc(fe(l)))},Ne.prototype.slice=function(l,u){l=De(l);var p=this;return p.__filtered__&&(l>0||u<0)?new Ne(p):(l<0?p=p.takeRight(-l):l&&(p=p.drop(l)),u!==i&&(u=De(u),p=u<0?p.dropRight(-u):p.take(u-l)),p)},Ne.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ne.prototype.toArray=function(){return this.take(Gt)},ji(Ne.prototype,function(l,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),C=/^(?:head|last)$/.test(u),S=R[C?"take"+(u=="last"?"Right":""):u],F=C||/^find/.test(u);S&&(R.prototype[u]=function(){var E=this.__wrapped__,D=C?[1]:arguments,L=E instanceof Ne,$=D[0],K=L||Re(E),Y=function(_e){var Be=S.apply(R,Us([_e],D));return C&&te?Be[0]:Be};K&&p&&typeof $=="function"&&$.length!=1&&(L=K=!1);var te=this.__chain__,de=!!this.__actions__.length,me=F&&!te,Me=L&&!de;if(!F&&K){E=Me?E:new Ne(this);var Ce=l.apply(E,D);return Ce.__actions__.push({func:oc,args:[Y],thisArg:i}),new hi(Ce,te)}return me&&Me?l.apply(this,D):(Ce=this.thru(Y),me?C?Ce.value()[0]:Ce.value():Ce)})}),di(["pop","push","shift","sort","splice","unshift"],function(l){var u=Ma[l],p=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",C=/^(?:pop|shift)$/.test(l);R.prototype[l]=function(){var S=arguments;if(C&&!this.__chain__){var F=this.value();return u.apply(Re(F)?F:[],S)}return this[p](function(E){return u.apply(Re(E)?E:[],S)})}}),ji(Ne.prototype,function(l,u){var p=R[u];if(p){var C=p.name+"";$e.call(bo,C)||(bo[C]=[]),bo[C].push({name:u,func:p})}}),bo[Xa(i,x).name]=[{name:"wrapper",func:i}],Ne.prototype.clone=Ez,Ne.prototype.reverse=Pz,Ne.prototype.value=Dz,R.prototype.at=s$,R.prototype.chain=n$,R.prototype.commit=o$,R.prototype.next=r$,R.prototype.plant=a$,R.prototype.reverse=c$,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=d$,R.prototype.first=R.prototype.head,Kr&&(R.prototype[Kr]=l$),R},wo=oz();Rn?((Rn.exports=wo)._=wo,Qu._=wo):ft._=wo}).call(To)}(wa,wa.exports);var ai=wa.exports;function lH(e){return ll({type:e.type,id:e.id})}function aH(e){return JSON.parse(e)}function cH(e,t){var i,s;return{colId:lH(t),field:e.toString(),headerName:((s=(i=t.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:s.trim())??"Unlabeled "+t.type+" "+e.toString(),lockPosition:t.type==="axis",valueFormatter:n=>n?n.value===void 0?"NULL":n.value===null?"NA":n.value.toString():"ERROR",cellDataType:(n=>{switch(n){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${n}`)}})(t.type==="axis"?t.spec.type:t.spec.valueType)}}function dH(e,t){switch(t){case"Int":return e===ny;case"Long":return e===oy;case"Float":return e===ry;case"Double":return e===ly;case"String":return e===ay;case"Bytes":return e===cy;default:throw Error(`unsupported data type: ${t}`)}}function uH(e,t){const i=Math.floor(t/8),s=1<<7-t%8;return(e[i]&s)>0}function hH(e,t){switch(t){case"Int":return e;case"Long":return Number(e);case"Float":return e;case"Double":return e;case"String":return e;case"Bytes":return Buffer.from(e).toString("hex");default:throw Error(`unsupported data type: ${t}`)}}function pH(e,t){const i=t.length,s=[];for(let n=0;n<t[0].data.length;++n){const o={},r=[];for(let c=0;c<i;++c){const d=e[c].toString(),h=t[c].data[n],g=t[c].type;uH(t[c].absent,n)?o[d]=void 0:dH(h,g)||h===null?o[d]=null:o[d]=hH(h,g),r.push(g==="Long"?Number(h):h)}o.id=JSON.stringify(r),s.push(o)}return s}async function gH(e,t,i,s){const n=await t.getSpec(i),o=n.map((m,v)=>ai.find(s,w=>ai.isEqual(w.axis,m.id))?null:v).filter(m=>m!==null),r=ai.cloneDeep(o);for(let m=o.length-1;m>=0;--m){const v=o[m];if(n[v].type!=="column"||n[v].spec.name!=="pl7.app/label")continue;const w=dy(n[v].spec.axesSpec).map(ai.cloneDeep)[0],b=ai.findIndex(o,y=>ai.isEqual(n[y].id,w));b!==-1&&(o[b]=v,o.splice(v,1),r.splice(v,1))}const c=r.map(m=>cH(m,n[m])),d=await t.getShape(i),h=d.rows;let g;return{columnDefs:c,datasource:{rowCount:h,getRows:async m=>{e.setGridOption("loading",!0);try{if(h==0){m.successCallback([],h),e.setGridOption("loading",!1),e.showNoRowsOverlay();return}if(g&&!ai.isEqual(g.sortModel,m.sortModel)){g=void 0,m.failCallback();return}g=m;const v=m.endRow-m.startRow;let w=[];if(v>0){const b=await t.getData(i,o,{offset:m.startRow,length:v});w=pH(r,b)}m.successCallback(w,d.rows),e.setGridOption("loading",!1),e.autoSizeAllColumns()}catch{m.failCallback()}}}}}const fH={class:"ap-ag-data-table-container"},mH={key:0,class:"ap-ag-data-table-sheets"},CH=bu(a.defineComponent({__name:"PlAgDataTable",props:a.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(e){os.registerModules([iG,UG,uG,JG]);const t=a.useModel(e,"modelValue"),i=e,{settings:s}=a.toRefs(i);function n(v){if(s.value.sourceType==="ptable")return(v==null?void 0:v.sortModel.map(w=>({column:aH(w.colId),ascending:w.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const o=a.computed({get:()=>{const v=t.value;return{columnOrder:v.gridState.columnOrder,sort:v.gridState.sort}},set:v=>{const w=n(v.sort),b=t.value;b.gridState.columnOrder=v.columnOrder,b.gridState.sort=v.sort,s.value.sourceType==="ptable"&&(b.pTableParams||(b.pTableParams={sorting:[],filters:[]}),b.pTableParams.sorting=w),t.value=b}}),r=v=>ll(v);function c(v){var w;if(s.value.sourceType==="ptable")return((w=s.value.sheets)==null?void 0:w.map(b=>({type:"bySingleColumn",column:b.column?{type:"column",id:b.column}:{type:"axis",id:b.axis},predicate:{operator:"Equal",reference:v[r(b.axis)]}})))??[]}const d=a.computed({get:()=>t.value.gridState.sheets??{},set:v=>{const w=c(v),b=t.value;b.gridState.sheets=v,s.value.sourceType==="ptable"&&(b.pTableParams||(b.pTableParams={sorting:[],filters:[]}),b.pTableParams.filters=w),t.value=b}});a.watch(()=>s.value,(v,w)=>{if(v.sourceType==="ptable"&&(w==null?void 0:w.sourceType)==="ptable"&&ai.isEqual(v.sheets,w.sheets))return;if(v.sourceType!=="ptable"){d.value={};return}const b=d.value,y=v.sheets??[];for(const x of y){const P=r(x.axis);b[P]||(b[P]=x.defaultValue??x.options[0].value)}d.value=b},{immediate:!0});const h=a.shallowRef(),g={animateRows:!1,suppressColumnMoveAnimation:!0,enableRangeSelection:!0,initialState:t.value.gridState,onGridReady:v=>{h.value=v.api},onStateUpdated:v=>{o.value={columnOrder:v.state.columnOrder,sort:v.state.sort}},autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:v=>{v.api.autoSizeAllColumns()},rowModelType:"infinite",maxBlocksInCache:1e4,cacheBlockSize:100,getRowId:v=>v.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:tH,noRowsOverlayComponent:oH},f=a.ref(0);a.watch(()=>[h.value,o.value],(v,w)=>{if(ai.isEqual(v,w))return;const[b,y]=v;if(!b)return;const x=b.getState();ai.isEqual(y.columnOrder,x.columnOrder)&&ai.isEqual(y.sort,x.sort)||(g.initialState=y,++f.value)});const m=(v,w)=>{const b=d.value;b[v]!==w&&(b[v]=w,d.value=b)};return a.watch(()=>[h.value,s.value],async(v,w)=>{if(ai.isEqual(v,w))return;const[b,y]=v;if(!b)return;const x=window.platforma;if(!x)throw Error("platforma not set");const P=y.sourceType;switch(P){case"ptable":{const T=x.pFrameDriver;if(!T)throw Error("platforma.pFrameDriver not set");const I=y.pTable;if(!(I!=null&&I.ok)||!I.value)return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const V=await gH(b,T,I.value,y.sheets??[]);return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...V})}case"xsv":{const T=x.blobDriver;if(!T)throw Error("platforma.blobDriver not set");const I=y.xsvFile;if(!(I!=null&&I.ok)||!I.value)return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const V=await rH(b,T,I.value);return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...V})}default:throw Error(`unsupported source type: ${P}`)}}),(v,w)=>{var b;return a.openBlock(),a.createElementBlock("div",fH,[a.unref(s).sourceType==="ptable"&&(((b=a.unref(s).sheets)==null?void 0:b.length)??0)>0?(a.openBlock(),a.createElementBlock("div",mH,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(s).sheets,(y,x)=>(a.openBlock(),a.createBlock(a.unref(km),{key:x,"model-value":d.value[r(y.axis)],options:y.options,"onUpdate:modelValue":P=>m(r(y.axis),P)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):a.createCommentVNode("",!0),a.createVNode(a.unref(xG),{class:"ap-ag-data-table-grid","grid-options":g})])}}}),[["__scopeId","data-v-0e3c393f"]]),vH={key:1,class:"alert-error"},wH={key:2},SH=a.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(e){const t=e,i=a.computed(()=>t.valueOrError&&t.valueOrError.ok?t.valueOrError.value:void 0),s=a.computed(()=>t.valueOrError&&!t.valueOrError.ok?t.valueOrError.errors:void 0),n=a.computed(()=>i.value===void 0&&s.value===void 0);return(o,r)=>(a.openBlock(),a.createElementBlock("div",null,[i.value!==void 0?a.renderSlot(o.$slots,"default",a.normalizeProps(a.mergeProps({key:0},{value:i.value}))):a.createCommentVNode("",!0),s.value?(a.openBlock(),a.createElementBlock("div",vH,a.toDisplayString(s.value),1)):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createElementBlock("div",wH,"Unresolved")):a.createCommentVNode("",!0)]))}}),Sa=new Map;function yH(e,t){const i=a.getCurrentScope()??a.effectScope(),s=i.run(()=>(a.onScopeDispose(()=>{Sa.delete(e)}),a.reactive(t())));return s[Symbol.dispose]=()=>{i.stop()},s}function bH(e){const t=Symbol();return()=>(Sa.has(t)||Sa.set(t,yH(t,e)),Sa.get(t))}function RH(e){return a.computed(()=>{try{return lp(e())}catch(t){return{errors:[String(t)],value:void 0}}})}function FH(e,t){const i=a.reactive({value:void 0,errors:void 0}),s={version:0},n=async(o,r)=>({value:await t(o),version:r});return a.watch(e,async o=>{i.errors=void 0,i.value=void 0;try{const{value:r,version:c}=await n(o,++s.version);c===s.version&&(i.value=r)}catch(r){i.errors=[String(r)]}},{immediate:!0,deep:!0}),i}const yn=class yn{constructor(){ip(this,"fileContentBytes",new Map)}getContentBytes(t){if(t===void 0)return;const i=this.fileContentBytes.get(t);if(i!==void 0)return i;const s=a.shallowRef();return this.fileContentBytes.set(t,s),(async()=>{try{const n=await hy().blobDriver.getContent(t);s.value=JSON.parse(new TextDecoder().decode(n))}catch(n){console.error(n)}})(),s}getContentString(t){if(t===void 0)return;const i=this.getContentBytes(t);return a.computed(()=>{if(i.value!==void 0)try{return new TextDecoder().decode(i.value)}catch(s){console.error(s)}})}getContentJson(t,i){if(t===void 0)return;const s=this.getContentString(t);return a.computed(()=>{if(s.value!==void 0)try{let n=JSON.parse(s.value);return i&&(n=i.parse(n)),n}catch(n){console.error(n)}})}static getContentBytes(t){return yn.globalInstance.getContentBytes(t)}static getContentString(t){return yn.globalInstance.getContentString(t)}static getContentJson(t,i){return yn.globalInstance.getContentJson(t,i)}};ip(yn,"globalInstance",new yn);let Lu=yn;j.BlockLayout=O1,j.ContextProvider=UV,j.DataTable=SI,j.DemoData=E1,j.DropdownListItem=aa,j.GridTable=Rk,j.LongText=Am,j.MaskIcon16=wr,j.MaskIcon24=Cn,j.MultiError=Cc,j.PlAgDataTable=CH,j.PlAlert=ZI,j.PlBlockPage=II,j.PlBtnAccent=JI,j.PlBtnGhost=wm,j.PlBtnGroup=yL,j.PlBtnLink=sL,j.PlBtnPrimary=vm,j.PlBtnSecondary=lu,j.PlCheckbox=YO,j.PlCheckboxGroup=e_,j.PlChip=pu,j.PlContainer=OI,j.PlDialogModal=Im,j.PlDropdown=Mm,j.PlDropdownLine=km,j.PlDropdownMulti=ZO,j.PlFileDialog=Lm,j.PlFileInput=zV,j.PlGrid=WI,j.PlLogView=p_,j.PlNumberField=IO,j.PlProgressBar=EO,j.PlRow=VI,j.PlSlideModal=l_,j.PlSpacer=GI,j.PlTextArea=UL,j.PlTextField=Em,j.PlToggleSwitch=d_,j.PlTooltip=li,j.ReactiveFileContent=Lu,j.Scrollable=ON,j.Slider=tN,j.SliderRange=MN,j.SliderRangeTriple=wN,j.ThemeSwitcher=EI,j.UnresolvedError=mc,j.ValueOrErrorsComponent=SH,j.animate=cm,j.animateInfinite=yk,j.call=nm,j.computedResult=RH,j.createModel=al,j.debounce=dm,j.defineApp=zA,j.defineStore=bH,j.delay=om,j.detectOutside=$L,j.eventListener=uu,j.getElementScrollPosition=Dm,j.isDefined=eS,j.isElementVisible=Pm,j.isJsonEqual=ap,j.listToOptions=bk,j.makeEaseInOut=Sk,j.makeEaseOut=am,j.maskIcons16=F1,j.maskIcons24=x1,j.normalizeListOptions=no,j.notEmpty=Yd,j.randomInt=lm,j.randomString=wk,j.requestTick=Qd,j.scrollIntoView=la,j.showContextMenu=eu,j.throttle=Xd,j.timeout=rm,j.unwrapOptionalResult=Jw,j.unwrapValueOrErrors=rp,j.useClickOutside=ra,j.useDraggable=aN,j.useEventListener=st,j.useFormState=rN,j.useHover=qd,j.useInterval=oN,j.useLabelNotch=mn,j.useLocalStorage=gm,j.useMouse=Zd,j.useMouseCapture=Ls,j.usePosition=Sm,j.useQuery=lN,j.useResizeObserver=qm,j.useScroll=iN,j.useSdkPlugin=Gd,j.useSortable=nN,j.useTheme=mm,j.useWatchResult=FH,j.wrapOptionalResult=lp,j.wrapValueOrErrors=Xw,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
249
+ }`;var Me=Nw(function(){return ze(F,de+"return "+Y).apply(i,E)});if(Me.source=Y,$h(Me))throw Me;return Me}function SK(l){return Ue(l).toLowerCase()}function yK(l){return Ue(l).toUpperCase()}function bK(l,u,p){if(l=Ue(l),l&&(p||u===i))return jC(l);if(!l||!(u=Xt(u)))return l;var C=Mi(l),S=Mi(u),F=ZC(C,S),E=qC(C,S)+1;return Ys(C,F,E).join("")}function RK(l,u,p){if(l=Ue(l),l&&(p||u===i))return l.slice(0,QC(l)+1);if(!l||!(u=Xt(u)))return l;var C=Mi(l),S=qC(C,Mi(u))+1;return Ys(C,0,S).join("")}function FK(l,u,p){if(l=Ue(l),l&&(p||u===i))return l.replace($u,"");if(!l||!(u=Xt(u)))return l;var C=Mi(l),S=ZC(C,Mi(u));return Ys(C,S).join("")}function xK(l,u){var p=z,C=H;if(it(u)){var S="separator"in u?u.separator:S;p="length"in u?De(u.length):p,C="omission"in u?Xt(u.omission):C}l=Ue(l);var F=l.length;if(Co(l)){var E=Mi(l);F=E.length}if(p>=F)return l;var D=p-vo(C);if(D<1)return C;var L=E?Ys(E,0,D).join(""):l.slice(0,D);if(S===i)return L+C;if(E&&(D+=L.length-D),Kh(S)){if(l.slice(D).search(S)){var $,K=L;for(S.global||(S=ah(S.source,Ue(fC.exec(S))+"g")),S.lastIndex=0;$=S.exec(K);)var Y=$.index;L=L.slice(0,Y===i?D:Y)}}else if(l.indexOf(Xt(S),D)!=D){var te=L.lastIndexOf(S);te>-1&&(L=L.slice(0,te))}return L+C}function EK(l){return l=Ue(l),l&&VH.test(l)?l.replace(hC,tz):l}var PK=xo(function(l,u,p){return l+(p?" ":"")+u.toUpperCase()}),qh=Bv("toUpperCase");function Vw(l,u,p){return l=Ue(l),u=p?i:u,u===i?YW(l)?nz(l):HW(l):l.match(u)||[]}var Nw=Ie(function(l,u){try{return Yt(l,i,u)}catch(p){return $h(p)?p:new be(p)}}),DK=ps(function(l,u){return di(u,function(p){p=qi(p),us(l,p,zh(l[p],l))}),l});function TK(l){var u=l==null?0:l.length,p=fe();return l=u?Je(l,function(C){if(typeof C[1]!="function")throw new ui(r);return[p(C[0]),C[1]]}):[],Ie(function(C){for(var S=-1;++S<u;){var F=l[S];if(Yt(F[0],this,C))return Yt(F[1],this,C)}})}function AK(l){return t2(pi(l,f))}function Yh(l){return function(){return l}}function MK(l,u){return l==null||l!==l?u:l}var kK=Hv(),IK=Hv(!0);function Ut(l){return l}function Qh(l){return Cv(typeof l=="function"?l:pi(l,f))}function LK(l){return wv(pi(l,f))}function OK(l,u){return Sv(l,pi(u,f))}var _K=Ie(function(l,u){return function(p){return Jr(p,l,u)}}),VK=Ie(function(l,u){return function(p){return Jr(l,p,u)}});function Xh(l,u,p){var C=pt(u),S=ja(u,C);p==null&&!(it(u)&&(S.length||!C.length))&&(p=u,u=l,l=this,S=ja(u,pt(u)));var F=!(it(p)&&"chain"in p)||!!p.chain,E=fs(l);return di(S,function(D){var L=u[D];l[D]=L,E&&(l.prototype[D]=function(){var $=this.__chain__;if(F||$){var K=l(this.__wrapped__),Y=K.__actions__=Ht(this.__actions__);return Y.push({func:L,args:arguments,thisArg:l}),K.__chain__=$,K}return L.apply(l,Us([this.value()],arguments))})}),l}function NK(){return ft._===this&&(ft._=dz),this}function Jh(){}function BK(l){return l=De(l),Ie(function(u){return yv(u,l)})}var GK=Ah(Je),HK=Ah(WC),WK=Ah(th);function Bw(l){return Vh(l)?ih(qi(l)):v2(l)}function zK(l){return function(u){return l==null?i:Dn(l,u)}}var UK=zv(),$K=zv(!0);function ep(){return[]}function tp(){return!1}function KK(){return{}}function jK(){return""}function ZK(){return!0}function qK(l,u){if(l=De(l),l<1||l>Oe)return[];var p=Gt,C=Ft(l,Gt);u=fe(u),l-=Gt;for(var S=oh(C,u);++p<l;)u(p);return S}function YK(l){return Re(l)?Je(l,qi):Jt(l)?[l]:Ht(ow(Ue(l)))}function QK(l){var u=++az;return Ue(l)+u}var XK=Ja(function(l,u){return l+u},0),JK=Mh("ceil"),e4=Ja(function(l,u){return l/u},1),t4=Mh("floor");function i4(l){return l&&l.length?Ka(l,Ut,mh):i}function s4(l,u){return l&&l.length?Ka(l,fe(u,2),mh):i}function n4(l){return $C(l,Ut)}function o4(l,u){return $C(l,fe(u,2))}function r4(l){return l&&l.length?Ka(l,Ut,Sh):i}function l4(l,u){return l&&l.length?Ka(l,fe(u,2),Sh):i}var a4=Ja(function(l,u){return l*u},1),c4=Mh("round"),d4=Ja(function(l,u){return l-u},0);function u4(l){return l&&l.length?nh(l,Ut):0}function h4(l,u){return l&&l.length?nh(l,fe(u,2)):0}return R.after=L$,R.ary=mw,R.assign=y3,R.assignIn=Aw,R.assignInWith=hc,R.assignWith=b3,R.at=R3,R.before=Cw,R.bind=zh,R.bindAll=DK,R.bindKey=vw,R.castArray=K$,R.chain=pw,R.chunk=tU,R.compact=iU,R.concat=sU,R.cond=TK,R.conforms=AK,R.constant=Yh,R.countBy=u$,R.create=F3,R.curry=ww,R.curryRight=Sw,R.debounce=yw,R.defaults=x3,R.defaultsDeep=E3,R.defer=O$,R.delay=_$,R.difference=nU,R.differenceBy=oU,R.differenceWith=rU,R.drop=lU,R.dropRight=aU,R.dropRightWhile=cU,R.dropWhile=dU,R.fill=uU,R.filter=p$,R.flatMap=m$,R.flatMapDeep=C$,R.flatMapDepth=v$,R.flatten=cw,R.flattenDeep=hU,R.flattenDepth=pU,R.flip=V$,R.flow=kK,R.flowRight=IK,R.fromPairs=gU,R.functions=I3,R.functionsIn=L3,R.groupBy=w$,R.initial=mU,R.intersection=CU,R.intersectionBy=vU,R.intersectionWith=wU,R.invert=_3,R.invertBy=V3,R.invokeMap=y$,R.iteratee=Qh,R.keyBy=b$,R.keys=pt,R.keysIn=zt,R.map=rc,R.mapKeys=B3,R.mapValues=G3,R.matches=LK,R.matchesProperty=OK,R.memoize=ac,R.merge=H3,R.mergeWith=Mw,R.method=_K,R.methodOf=VK,R.mixin=Xh,R.negate=cc,R.nthArg=BK,R.omit=W3,R.omitBy=z3,R.once=N$,R.orderBy=R$,R.over=GK,R.overArgs=B$,R.overEvery=HK,R.overSome=WK,R.partial=Uh,R.partialRight=bw,R.partition=F$,R.pick=U3,R.pickBy=kw,R.property=Bw,R.propertyOf=zK,R.pull=RU,R.pullAll=uw,R.pullAllBy=FU,R.pullAllWith=xU,R.pullAt=EU,R.range=UK,R.rangeRight=$K,R.rearg=G$,R.reject=P$,R.remove=PU,R.rest=H$,R.reverse=Hh,R.sampleSize=T$,R.set=K3,R.setWith=j3,R.shuffle=A$,R.slice=DU,R.sortBy=I$,R.sortedUniq=OU,R.sortedUniqBy=_U,R.split=mK,R.spread=W$,R.tail=VU,R.take=NU,R.takeRight=BU,R.takeRightWhile=GU,R.takeWhile=HU,R.tap=i$,R.throttle=z$,R.thru=oc,R.toArray=Pw,R.toPairs=Iw,R.toPairsIn=Lw,R.toPath=YK,R.toPlainObject=Tw,R.transform=Z3,R.unary=U$,R.union=WU,R.unionBy=zU,R.unionWith=UU,R.uniq=$U,R.uniqBy=KU,R.uniqWith=jU,R.unset=q3,R.unzip=Wh,R.unzipWith=hw,R.update=Y3,R.updateWith=Q3,R.values=Do,R.valuesIn=X3,R.without=ZU,R.words=Vw,R.wrap=$$,R.xor=qU,R.xorBy=YU,R.xorWith=QU,R.zip=XU,R.zipObject=JU,R.zipObjectDeep=e$,R.zipWith=t$,R.entries=Iw,R.entriesIn=Lw,R.extend=Aw,R.extendWith=hc,Xh(R,R),R.add=XK,R.attempt=Nw,R.camelCase=iK,R.capitalize=Ow,R.ceil=JK,R.clamp=J3,R.clone=j$,R.cloneDeep=q$,R.cloneDeepWith=Y$,R.cloneWith=Z$,R.conformsTo=Q$,R.deburr=_w,R.defaultTo=MK,R.divide=e4,R.endsWith=sK,R.eq=Ii,R.escape=nK,R.escapeRegExp=oK,R.every=h$,R.find=g$,R.findIndex=lw,R.findKey=P3,R.findLast=f$,R.findLastIndex=aw,R.findLastKey=D3,R.floor=t4,R.forEach=gw,R.forEachRight=fw,R.forIn=T3,R.forInRight=A3,R.forOwn=M3,R.forOwnRight=k3,R.get=jh,R.gt=X$,R.gte=J$,R.has=O3,R.hasIn=Zh,R.head=dw,R.identity=Ut,R.includes=S$,R.indexOf=fU,R.inRange=eK,R.invoke=N3,R.isArguments=Mn,R.isArray=Re,R.isArrayBuffer=e3,R.isArrayLike=Wt,R.isArrayLikeObject=rt,R.isBoolean=t3,R.isBuffer=Qs,R.isDate=i3,R.isElement=s3,R.isEmpty=n3,R.isEqual=o3,R.isEqualWith=r3,R.isError=$h,R.isFinite=l3,R.isFunction=fs,R.isInteger=Rw,R.isLength=dc,R.isMap=Fw,R.isMatch=a3,R.isMatchWith=c3,R.isNaN=d3,R.isNative=u3,R.isNil=p3,R.isNull=h3,R.isNumber=xw,R.isObject=it,R.isObjectLike=nt,R.isPlainObject=ol,R.isRegExp=Kh,R.isSafeInteger=g3,R.isSet=Ew,R.isString=uc,R.isSymbol=Jt,R.isTypedArray=Po,R.isUndefined=f3,R.isWeakMap=m3,R.isWeakSet=C3,R.join=SU,R.kebabCase=rK,R.last=fi,R.lastIndexOf=yU,R.lowerCase=lK,R.lowerFirst=aK,R.lt=v3,R.lte=w3,R.max=i4,R.maxBy=s4,R.mean=n4,R.meanBy=o4,R.min=r4,R.minBy=l4,R.stubArray=ep,R.stubFalse=tp,R.stubObject=KK,R.stubString=jK,R.stubTrue=ZK,R.multiply=a4,R.nth=bU,R.noConflict=NK,R.noop=Jh,R.now=lc,R.pad=cK,R.padEnd=dK,R.padStart=uK,R.parseInt=hK,R.random=tK,R.reduce=x$,R.reduceRight=E$,R.repeat=pK,R.replace=gK,R.result=$3,R.round=c4,R.runInContext=k,R.sample=D$,R.size=M$,R.snakeCase=fK,R.some=k$,R.sortedIndex=TU,R.sortedIndexBy=AU,R.sortedIndexOf=MU,R.sortedLastIndex=kU,R.sortedLastIndexBy=IU,R.sortedLastIndexOf=LU,R.startCase=CK,R.startsWith=vK,R.subtract=d4,R.sum=u4,R.sumBy=h4,R.template=wK,R.times=qK,R.toFinite=ms,R.toInteger=De,R.toLength=Dw,R.toLower=SK,R.toNumber=mi,R.toSafeInteger=S3,R.toString=Ue,R.toUpper=yK,R.trim=bK,R.trimEnd=RK,R.trimStart=FK,R.truncate=xK,R.unescape=EK,R.uniqueId=QK,R.upperCase=PK,R.upperFirst=qh,R.each=gw,R.eachRight=fw,R.first=dw,Xh(R,function(){var l={};return ji(R,function(u,p){$e.call(R.prototype,p)||(l[p]=u)}),l}(),{chain:!1}),R.VERSION=s,di(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){R[l].placeholder=R}),di(["drop","take"],function(l,u){Ne.prototype[l]=function(p){p=p===i?1:ct(De(p),0);var C=this.__filtered__&&!u?new Ne(this):this.clone();return C.__filtered__?C.__takeCount__=Ft(p,C.__takeCount__):C.__views__.push({size:Ft(p,Gt),type:l+(C.__dir__<0?"Right":"")}),C},Ne.prototype[l+"Right"]=function(p){return this.reverse()[l](p).reverse()}}),di(["filter","map","takeWhile"],function(l,u){var p=u+1,C=p==pe||p==ee;Ne.prototype[l]=function(S){var F=this.clone();return F.__iteratees__.push({iteratee:fe(S,3),type:p}),F.__filtered__=F.__filtered__||C,F}}),di(["head","last"],function(l,u){var p="take"+(u?"Right":"");Ne.prototype[l]=function(){return this[p](1).value()[0]}}),di(["initial","tail"],function(l,u){var p="drop"+(u?"":"Right");Ne.prototype[l]=function(){return this.__filtered__?new Ne(this):this[p](1)}}),Ne.prototype.compact=function(){return this.filter(Ut)},Ne.prototype.find=function(l){return this.filter(l).head()},Ne.prototype.findLast=function(l){return this.reverse().find(l)},Ne.prototype.invokeMap=Ie(function(l,u){return typeof l=="function"?new Ne(this):this.map(function(p){return Jr(p,l,u)})}),Ne.prototype.reject=function(l){return this.filter(cc(fe(l)))},Ne.prototype.slice=function(l,u){l=De(l);var p=this;return p.__filtered__&&(l>0||u<0)?new Ne(p):(l<0?p=p.takeRight(-l):l&&(p=p.drop(l)),u!==i&&(u=De(u),p=u<0?p.dropRight(-u):p.take(u-l)),p)},Ne.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ne.prototype.toArray=function(){return this.take(Gt)},ji(Ne.prototype,function(l,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),C=/^(?:head|last)$/.test(u),S=R[C?"take"+(u=="last"?"Right":""):u],F=C||/^find/.test(u);S&&(R.prototype[u]=function(){var E=this.__wrapped__,D=C?[1]:arguments,L=E instanceof Ne,$=D[0],K=L||Re(E),Y=function(_e){var Be=S.apply(R,Us([_e],D));return C&&te?Be[0]:Be};K&&p&&typeof $=="function"&&$.length!=1&&(L=K=!1);var te=this.__chain__,de=!!this.__actions__.length,me=F&&!te,Me=L&&!de;if(!F&&K){E=Me?E:new Ne(this);var Ce=l.apply(E,D);return Ce.__actions__.push({func:oc,args:[Y],thisArg:i}),new hi(Ce,te)}return me&&Me?l.apply(this,D):(Ce=this.thru(Y),me?C?Ce.value()[0]:Ce.value():Ce)})}),di(["pop","push","shift","sort","splice","unshift"],function(l){var u=Ma[l],p=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",C=/^(?:pop|shift)$/.test(l);R.prototype[l]=function(){var S=arguments;if(C&&!this.__chain__){var F=this.value();return u.apply(Re(F)?F:[],S)}return this[p](function(E){return u.apply(Re(E)?E:[],S)})}}),ji(Ne.prototype,function(l,u){var p=R[u];if(p){var C=p.name+"";$e.call(bo,C)||(bo[C]=[]),bo[C].push({name:u,func:p})}}),bo[Xa(i,x).name]=[{name:"wrapper",func:i}],Ne.prototype.clone=Ez,Ne.prototype.reverse=Pz,Ne.prototype.value=Dz,R.prototype.at=s$,R.prototype.chain=n$,R.prototype.commit=o$,R.prototype.next=r$,R.prototype.plant=a$,R.prototype.reverse=c$,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=d$,R.prototype.first=R.prototype.head,Kr&&(R.prototype[Kr]=l$),R},wo=oz();Rn?((Rn.exports=wo)._=wo,Qu._=wo):ft._=wo}).call(To)}(wa,wa.exports);var ai=wa.exports;function lH(e){return ll({type:e.type,id:e.id})}function aH(e){return JSON.parse(e)}function cH(e,t){var i,s;return{colId:lH(t),field:e.toString(),headerName:((s=(i=t.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:s.trim())??"Unlabeled "+t.type+" "+e.toString(),lockPosition:t.type==="axis",valueFormatter:n=>n?n.value===void 0?"NULL":n.value===null?"NA":n.value.toString():"ERROR",cellDataType:(n=>{switch(n){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${n}`)}})(t.type==="axis"?t.spec.type:t.spec.valueType)}}function dH(e,t){switch(t){case"Int":return e===ny;case"Long":return e===oy;case"Float":return e===ry;case"Double":return e===ly;case"String":return e===ay;case"Bytes":return e===cy;default:throw Error(`unsupported data type: ${t}`)}}function uH(e,t){const i=Math.floor(t/8),s=1<<7-t%8;return(e[i]&s)>0}function hH(e,t){switch(t){case"Int":return e;case"Long":return Number(e);case"Float":return e;case"Double":return e;case"String":return e;case"Bytes":return Buffer.from(e).toString("hex");default:throw Error(`unsupported data type: ${t}`)}}function pH(e,t){const i=t.length,s=[];for(let n=0;n<t[0].data.length;++n){const o={},r=[];for(let c=0;c<i;++c){const d=e[c].toString(),h=t[c].data[n],g=t[c].type;uH(t[c].absent,n)?o[d]=void 0:dH(h,g)||h===null?o[d]=null:o[d]=hH(h,g),r.push(g==="Long"?Number(h):h)}o.id=JSON.stringify(r),s.push(o)}return s}async function gH(e,t,i,s){const n=await t.getSpec(i),o=n.map((m,v)=>ai.find(s,w=>ai.isEqual(w.axis,m.id))?null:v).filter(m=>m!==null),r=ai.cloneDeep(o);for(let m=o.length-1;m>=0;--m){const v=o[m];if(n[v].type!=="column"||n[v].spec.name!=="pl7.app/label")continue;const w=dy(n[v].spec.axesSpec).map(ai.cloneDeep)[0],b=ai.findIndex(o,y=>ai.isEqual(n[y].id,w));b!==-1&&(o[b]=v,o.splice(v,1),r.splice(v,1))}const c=r.map(m=>cH(m,n[m])),d=await t.getShape(i),h=d.rows;let g;return{columnDefs:c,datasource:{rowCount:h,getRows:async m=>{e.setGridOption("loading",!0);try{if(h==0){m.successCallback([],h),e.setGridOption("loading",!1),e.showNoRowsOverlay();return}if(g&&!ai.isEqual(g.sortModel,m.sortModel)){g=void 0,m.failCallback();return}g=m;const v=m.endRow-m.startRow;let w=[];if(v>0){const b=await t.getData(i,o,{offset:m.startRow,length:v});w=pH(r,b)}m.successCallback(w,d.rows),e.setGridOption("loading",!1),e.autoSizeAllColumns()}catch{m.failCallback()}}}}}const fH={class:"ap-ag-data-table-container"},mH={key:0,class:"ap-ag-data-table-sheets"},CH=bu(a.defineComponent({__name:"PlAgDataTable",props:a.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(e){os.registerModules([iG,UG,uG,JG]);const t=a.useModel(e,"modelValue"),i=e,{settings:s}=a.toRefs(i);function n(v){if(s.value.sourceType==="ptable")return(v==null?void 0:v.sortModel.map(w=>({column:aH(w.colId),ascending:w.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const o=a.computed({get:()=>{const v=t.value;return{columnOrder:v.gridState.columnOrder,sort:v.gridState.sort}},set:v=>{const w=n(v.sort),b=t.value;b.gridState.columnOrder=v.columnOrder,b.gridState.sort=v.sort,s.value.sourceType==="ptable"&&(b.pTableParams||(b.pTableParams={sorting:[],filters:[]}),b.pTableParams.sorting=w),t.value=b}}),r=v=>ll(v);function c(v){var w;if(s.value.sourceType==="ptable")return((w=s.value.sheets)==null?void 0:w.map(b=>({type:"bySingleColumn",column:b.column?{type:"column",id:b.column}:{type:"axis",id:b.axis},predicate:{operator:"Equal",reference:v[r(b.axis)]}})))??[]}const d=a.computed({get:()=>t.value.gridState.sheets??{},set:v=>{const w=c(v),b=t.value;b.gridState.sheets=v,s.value.sourceType==="ptable"&&(b.pTableParams||(b.pTableParams={sorting:[],filters:[]}),b.pTableParams.filters=w),t.value=b}});a.watch(()=>s.value,(v,w)=>{if(v.sourceType==="ptable"&&(w==null?void 0:w.sourceType)==="ptable"&&ai.isEqual(v.sheets,w.sheets))return;if(v.sourceType!=="ptable"){d.value={};return}const b=d.value,y=v.sheets??[];for(const x of y){const P=r(x.axis);b[P]||(b[P]=x.defaultValue??x.options[0].value)}d.value=b},{immediate:!0});const h=a.shallowRef(),g={animateRows:!1,suppressColumnMoveAnimation:!0,enableRangeSelection:!0,initialState:t.value.gridState,onGridReady:v=>{h.value=v.api},onStateUpdated:v=>{o.value={columnOrder:v.state.columnOrder,sort:v.state.sort}},autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:v=>{v.api.autoSizeAllColumns()},rowModelType:"infinite",maxBlocksInCache:1e4,cacheBlockSize:100,getRowId:v=>v.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:tH,noRowsOverlayComponent:oH},f=a.ref(0);a.watch(()=>[h.value,o.value],(v,w)=>{if(ai.isEqual(v,w))return;const[b,y]=v;if(!b)return;const x=b.getState();ai.isEqual(y.columnOrder,x.columnOrder)&&ai.isEqual(y.sort,x.sort)||(g.initialState=y,++f.value)});const m=(v,w)=>{const b=d.value;b[v]!==w&&(b[v]=w,d.value=b)};return a.watch(()=>[h.value,s.value],async(v,w)=>{if(ai.isEqual(v,w))return;const[b,y]=v;if(!b)return;const x=window.platforma;if(!x)throw Error("platforma not set");const P=y.sourceType;switch(P){case"ptable":{const T=x.pFrameDriver;if(!T)throw Error("platforma.pFrameDriver not set");const I=y.pTable;if(!(I!=null&&I.ok)||!I.value)return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const V=await gH(b,T,I.value,y.sheets??[]);return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...V})}case"xsv":{const T=x.blobDriver;if(!T)throw Error("platforma.blobDriver not set");const I=y.xsvFile;if(!(I!=null&&I.ok)||!I.value)return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const V=await rH(b,T,I.value);return b.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...V})}default:throw Error(`unsupported source type: ${P}`)}}),(v,w)=>{var b;return a.openBlock(),a.createElementBlock("div",fH,[a.unref(s).sourceType==="ptable"&&(((b=a.unref(s).sheets)==null?void 0:b.length)??0)>0?(a.openBlock(),a.createElementBlock("div",mH,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(s).sheets,(y,x)=>(a.openBlock(),a.createBlock(a.unref(km),{key:x,"model-value":d.value[r(y.axis)],options:y.options,"onUpdate:modelValue":P=>m(r(y.axis),P)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):a.createCommentVNode("",!0),a.createVNode(a.unref(xG),{class:"ap-ag-data-table-grid","grid-options":g})])}}}),[["__scopeId","data-v-0e3c393f"]]),vH={key:1,class:"alert-error"},wH={key:2},SH=a.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(e){const t=e,i=a.computed(()=>t.valueOrError&&t.valueOrError.ok?t.valueOrError.value:void 0),s=a.computed(()=>t.valueOrError&&!t.valueOrError.ok?t.valueOrError.errors:void 0),n=a.computed(()=>i.value===void 0&&s.value===void 0);return(o,r)=>(a.openBlock(),a.createElementBlock("div",null,[i.value!==void 0?a.renderSlot(o.$slots,"default",a.normalizeProps(a.mergeProps({key:0},{value:i.value}))):a.createCommentVNode("",!0),s.value?(a.openBlock(),a.createElementBlock("div",vH,a.toDisplayString(s.value),1)):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createElementBlock("div",wH,"Unresolved")):a.createCommentVNode("",!0)]))}}),Sa=new Map;function yH(e,t){const i=a.getCurrentScope()??a.effectScope(),s=i.run(()=>(a.onScopeDispose(()=>{Sa.delete(e)}),a.reactive(t())));return s[Symbol.dispose]=()=>{i.stop()},s}function bH(e){const t=Symbol();return()=>(Sa.has(t)||Sa.set(t,yH(t,e)),Sa.get(t))}function RH(e){return a.computed(()=>{try{return lp(e())}catch(t){return{errors:[String(t)],value:void 0}}})}function FH(e,t){const i=a.reactive({value:void 0,errors:void 0}),s={version:0},n=async(o,r)=>({value:await t(o),version:r});return a.watch(e,async o=>{i.errors=void 0,i.value=void 0;try{const{value:r,version:c}=await n(o,++s.version);c===s.version&&(i.value=r)}catch(r){i.errors=[String(r)]}},{immediate:!0,deep:!0}),i}const yn=class yn{constructor(){ip(this,"fileContentBytes",new Map)}getContentBytes(t){if(t===void 0)return;const i=this.fileContentBytes.get(t);if(i!==void 0)return i;const s=a.shallowRef();return this.fileContentBytes.set(t,s),(async()=>{try{const n=await hy().blobDriver.getContent(t);s.value=n}catch(n){console.error(n)}})(),s}getContentString(t){if(t===void 0)return;const i=this.getContentBytes(t);return a.computed(()=>{if(i.value!==void 0)try{return new TextDecoder().decode(i.value)}catch(s){console.error(s)}})}getContentJson(t,i){if(t===void 0)return;const s=this.getContentString(t);return a.computed(()=>{if(s.value!==void 0)try{let n=JSON.parse(s.value);return i&&(n=i.parse(n)),n}catch(n){console.error(n)}})}static getContentBytes(t){return yn.globalInstance.getContentBytes(t)}static getContentString(t){return yn.globalInstance.getContentString(t)}static getContentJson(t,i){return yn.globalInstance.getContentJson(t,i)}};ip(yn,"globalInstance",new yn);let Lu=yn;j.BlockLayout=O1,j.ContextProvider=UV,j.DataTable=SI,j.DemoData=E1,j.DropdownListItem=aa,j.GridTable=Rk,j.LongText=Am,j.MaskIcon16=wr,j.MaskIcon24=Cn,j.MultiError=Cc,j.PlAgDataTable=CH,j.PlAlert=ZI,j.PlBlockPage=II,j.PlBtnAccent=JI,j.PlBtnGhost=wm,j.PlBtnGroup=yL,j.PlBtnLink=sL,j.PlBtnPrimary=vm,j.PlBtnSecondary=lu,j.PlCheckbox=YO,j.PlCheckboxGroup=e_,j.PlChip=pu,j.PlContainer=OI,j.PlDialogModal=Im,j.PlDropdown=Mm,j.PlDropdownLine=km,j.PlDropdownMulti=ZO,j.PlFileDialog=Lm,j.PlFileInput=zV,j.PlGrid=WI,j.PlLogView=p_,j.PlNumberField=IO,j.PlProgressBar=EO,j.PlRow=VI,j.PlSlideModal=l_,j.PlSpacer=GI,j.PlTextArea=UL,j.PlTextField=Em,j.PlToggleSwitch=d_,j.PlTooltip=li,j.ReactiveFileContent=Lu,j.Scrollable=ON,j.Slider=tN,j.SliderRange=MN,j.SliderRangeTriple=wN,j.ThemeSwitcher=EI,j.UnresolvedError=mc,j.ValueOrErrorsComponent=SH,j.animate=cm,j.animateInfinite=yk,j.call=nm,j.computedResult=RH,j.createModel=al,j.debounce=dm,j.defineApp=zA,j.defineStore=bH,j.delay=om,j.detectOutside=$L,j.eventListener=uu,j.getElementScrollPosition=Dm,j.isDefined=eS,j.isElementVisible=Pm,j.isJsonEqual=ap,j.listToOptions=bk,j.makeEaseInOut=Sk,j.makeEaseOut=am,j.maskIcons16=F1,j.maskIcons24=x1,j.normalizeListOptions=no,j.notEmpty=Yd,j.randomInt=lm,j.randomString=wk,j.requestTick=Qd,j.scrollIntoView=la,j.showContextMenu=eu,j.throttle=Xd,j.timeout=rm,j.unwrapOptionalResult=Jw,j.unwrapValueOrErrors=rp,j.useClickOutside=ra,j.useDraggable=aN,j.useEventListener=st,j.useFormState=rN,j.useHover=qd,j.useInterval=oN,j.useLabelNotch=mn,j.useLocalStorage=gm,j.useMouse=Zd,j.useMouseCapture=Ls,j.usePosition=Sm,j.useQuery=lN,j.useResizeObserver=qm,j.useScroll=iN,j.useSdkPlugin=Gd,j.useSortable=nN,j.useTheme=mm,j.useWatchResult=FH,j.wrapOptionalResult=lp,j.wrapValueOrErrors=Xw,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});