@deck.gl/json
Advanced tools
Comparing version 9.0.0-beta.2 to 9.0.0-beta.3
@@ -7,7 +7,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
else root['deck'] = factory();})(globalThis, function () { | ||
"use strict";var __exports__=(()=>{var hr=Object.create;var te=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var Fe=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Or=(e,r)=>{for(var t in r)te(e,t,{get:r[t],enumerable:!0})},re=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of dr(r))!gr.call(e,i)&&i!==t&&te(e,i,{get:()=>r[i],enumerable:!(n=vr(r,i))||n.enumerable});return e},x=(e,r,t)=>(re(e,r,"default"),t&&re(t,r,"default")),ne=(e,r,t)=>(t=e!=null?hr(br(e)):{},re(r||!e||!e.__esModule?te(t,"default",{value:e,enumerable:!0}):t,e)),Er=e=>re(te({},"__esModule",{value:!0}),e);var me=Fe((Wr,Me)=>{Me.exports=globalThis.deck});var he=Fe((Q,ie)=>{(function(e){"use strict";var r="Compound",t="Identifier",n="MemberExpression",i="Literal",f="ThisExpression",c="CallExpression",O="UnaryExpression",g="BinaryExpression",E="LogicalExpression",er="ConditionalExpression",rr="ArrayExpression",L=46,Pe=44,tr=39,nr=34,H=40,xe=41,ce=91,we=93,or=63,ir=59,sr=58,d=function(a,o){var _=new Error(a+" at character "+o);throw _.index=o,_.description=a,_},j=!0,N={"-":j,"!":j,"~":j,"+":j},P={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},G=function(a){var o=0,_;for(var T in a)(_=T.length)>o&&a.hasOwnProperty(T)&&(o=_);return o},I=G(N),A=G(P),z={true:!0,false:!1,null:null},ar="this",Ne=function(a){return P[a]||0},Ie=function(a,o,_){var T=a==="||"||a==="&&"?E:g;return{type:T,operator:a,left:o,right:_}},K=function(a){return a>=48&&a<=57},k=function(a){return a===36||a===95||a>=65&&a<=90||a>=97&&a<=122||a>=128&&!P[String.fromCharCode(a)]},pe=function(a){return a===36||a===95||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a>=128&&!P[String.fromCharCode(a)]},y=function(a){for(var o=0,_=a.charAt,T=a.charCodeAt,b=function(s){return _.call(a,s)},p=function(s){return T.call(a,s)},Y=a.length,S=function(){for(var s=p(o);s===32||s===9||s===10||s===13;)s=p(++o)},J=function(){var s=fr(),u,l;if(S(),p(o)===or){if(o++,u=J(),u||d("Expected expression",o),S(),p(o)===sr)return o++,l=J(),l||d("Expected expression",o),{type:er,test:s,consequent:u,alternate:l};d("Expected :",o)}else return s},Ae=function(){S();for(var s,u=a.substr(o,A),l=u.length;l>0;){if(P.hasOwnProperty(u)&&(!k(p(o))||o+u.length<a.length&&!pe(p(o+u.length))))return o+=l,u;u=u.substr(0,--l)}return!1},fr=function(){var s,u,l,h,v,ee,q,X,D;if(q=Z(),l=Ae(),!l)return q;for(ee={value:l,prec:Ne(l)},X=Z(),X||d("Expected expression after "+l,o),v=[q,ee,X];(l=Ae())&&(h=Ne(l),h!==0);){for(ee={value:l,prec:h};v.length>2&&h<=v[v.length-2].prec;)X=v.pop(),l=v.pop().value,q=v.pop(),u=Ie(l,q,X),v.push(u);u=Z(),u||d("Expected expression after "+l,o),v.push(ee,u)}for(D=v.length-1,u=v[D];D>1;)u=Ie(v[D-1].value,v[D-2],u),D-=2;return u},Z=function(){var s,u,l;if(S(),s=p(o),K(s)||s===L)return lr();if(s===tr||s===nr)return cr();if(s===ce)return mr();for(u=a.substr(o,I),l=u.length;l>0;){if(N.hasOwnProperty(u)&&(!k(p(o))||o+u.length<a.length&&!pe(p(o+u.length))))return o+=l,{type:O,operator:u,argument:Z(),prefix:!0};u=u.substr(0,--l)}return k(s)||s===H?pr():!1},lr=function(){for(var s="",u,l;K(p(o));)s+=b(o++);if(p(o)===L)for(s+=b(o++);K(p(o));)s+=b(o++);if(u=b(o),u==="e"||u==="E"){for(s+=b(o++),u=b(o),(u==="+"||u==="-")&&(s+=b(o++));K(p(o));)s+=b(o++);K(p(o-1))||d("Expected exponent ("+s+b(o)+")",o)}return l=p(o),k(l)?d("Variable names cannot start with a number ("+s+b(o)+")",o):l===L&&d("Unexpected period",o),{type:i,value:parseFloat(s),raw:s}},cr=function(){for(var s="",u=b(o++),l=!1,h;o<Y;)if(h=b(o++),h===u){l=!0;break}else if(h==="\\")switch(h=b(o++),h){case"n":s+=` | ||
`;break;case"r":s+="\r";break;case"t":s+=" ";break;case"b":s+="\b";break;case"f":s+="\f";break;case"v":s+="\v";break;default:s+=h}else s+=h;return l||d('Unclosed quote after "'+s+'"',o),{type:i,value:s,raw:u+s+u}},Te=function(){var s=p(o),u=o,l;for(k(s)?o++:d("Unexpected "+b(o),o);o<Y&&(s=p(o),pe(s));)o++;return l=a.slice(u,o),z.hasOwnProperty(l)?{type:i,value:z[l],raw:l}:l===ar?{type:f}:{type:t,name:l}},Je=function(s){for(var u,l=[],h,v=!1;o<Y;)if(S(),u=p(o),u===s){v=!0,o++;break}else u===Pe?o++:(h=J(),(!h||h.type===r)&&d("Expected comma",o),l.push(h));return v||d("Expected "+String.fromCharCode(s),o),l},pr=function(){var s,u;for(s=p(o),s===H?u=yr():u=Te(),S(),s=p(o);s===L||s===ce||s===H;)o++,s===L?(S(),u={type:n,computed:!1,object:u,property:Te()}):s===ce?(u={type:n,computed:!0,object:u,property:J()},S(),s=p(o),s!==we&&d("Unclosed [",o),o++):s===H&&(u={type:c,arguments:Je(xe),callee:u}),S(),s=p(o);return u},yr=function(){o++;var s=J();if(S(),p(o)===xe)return o++,s;d("Unclosed (",o)},mr=function(){return o++,{type:rr,elements:Je(we)}},V=[],ye,De;o<Y;)ye=p(o),ye===ir||ye===Pe?o++:(De=J())?V.push(De):o<Y&&d('Unexpected "'+b(o)+'"',o);return V.length===1?V[0]:{type:r,body:V}};if(y.version="0.3.4",y.toString=function(){return"JavaScript Expression Parser (JSEP) v"+y.version},y.addUnaryOp=function(a){return I=Math.max(a.length,I),N[a]=j,this},y.addBinaryOp=function(a,o){return A=Math.max(a.length,A),P[a]=o,this},y.addLiteral=function(a,o){return z[a]=o,this},y.removeUnaryOp=function(a){return delete N[a],a.length===I&&(I=G(N)),this},y.removeAllUnaryOps=function(){return N={},I=0,this},y.removeBinaryOp=function(a){return delete P[a],a.length===A&&(A=G(P)),this},y.removeAllBinaryOps=function(){return P={},A=0,this},y.removeLiteral=function(a){return delete z[a],this},y.removeAllLiterals=function(){return z={},this},typeof Q>"u"){var ur=e.jsep;e.jsep=y,y.noConflict=function(){return e.jsep===y&&(e.jsep=ur),y}}else typeof ie<"u"&&ie.exports?Q=ie.exports=y:Q.parse=y})(Q)});var $={};Or($,{JSONConfiguration:()=>R,JSONConverter:()=>He,Transport:()=>Ze,_convertFunctions:()=>U,_parseExpressionString:()=>w,_shallowEqualObjects:()=>Ve});var C={},Re=ne(me());x(C,ne(me()));if(!Re.Layer)throw new Error("@deck.gl/core is not found");x($,C);function F(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(!e)throw new Error("JSON conversion error ".concat(r))}function oe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oe=function(t){return typeof t}:oe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(e)}function _r(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Sr(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(E){throw E},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. | ||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,c=!1,O;return{s:function(){t=t.call(e)},n:function(){var E=t.next();return f=E.done,E},e:function(E){c=!0,O=E},f:function(){try{!f&&t.return!=null&&t.return()}finally{if(c)throw O}}}}function Sr(e,r){if(e){if(typeof e=="string")return Ue(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ue(e,r)}}function Ue(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Le(e,r){var t=Pr(r),n=e,i=_r(t),f;try{for(i.s();!(f=i.n()).done;){var c=f.value;n=Cr(n)?n[c]:void 0}}catch(O){i.e(O)}finally{i.f()}return n}function Cr(e){return e!==null&&oe(e)==="object"}var Be={};function Pr(e){if(typeof e=="string"){var r=Be[e];return r||(r=e.split("."),Be[e]=r),r}return Array.isArray(e)?e:[e]}var xr=ne(he()),ve=ne(he());var je={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},wr={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function ze(e,r){return e.map(function(t){return m(t,r)})}function Ke(e,r){var t,n=m(e.object,r);if(t=e.computed?m(e.property,r):e.property.name,/^__proto__|prototype|constructor$/.test(t))throw Error('Access to member "'+t+'" disallowed.');return[n,n[t]]}function m(e,r){var t=e;switch(t.type){case"ArrayExpression":return ze(t.elements,r);case"BinaryExpression":return je[t.operator](m(t.left,r),m(t.right,r));case"CallExpression":var n,i,f;return t.callee.type==="MemberExpression"?(n=(f=Ke(t.callee,r))[0],i=f[1]):i=m(t.callee,r),typeof i!="function"?void 0:i.apply(n,ze(t.arguments,r));case"ConditionalExpression":return m(t.test,r)?m(t.consequent,r):m(t.alternate,r);case"Identifier":return r[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?m(t.left,r)||m(t.right,r):t.operator==="&&"?m(t.left,r)&&m(t.right,r):je[t.operator](m(t.left,r),m(t.right,r));case"MemberExpression":return Ke(t,r)[1];case"ThisExpression":return r;case"UnaryExpression":return wr[t.operator](m(t.argument,r));default:return}}function se(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?se=function(t){return typeof t}:se=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(e)}var de={"-":function(r){return r}};function w(e,r){if(e in de)return de[e];var t,n=(0,ve.default)(e);return n.type==="Identifier"?t=function(f){return Le(f,e)}:(be(n,function(i){if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=function(f){return m(n,f)}),de[e]=t,t}function be(e,r){if(Array.isArray(e))e.forEach(function(n){return be(n,r)});else if(e&&se(e)==="object"){e.type&&r(e);for(var t in e)be(e[t],r)}}var M="@@=",ge="@@#",ke="@@type",ae="@@function";function Nr(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function ue(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ue=function(t){return typeof t}:ue=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ue(e)}var Ye=function(r){return r&&ue(r)==="object"},R=function(){function e(){Nr(this,e),this.typeKey=ke,this.functionKey=ae,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=w,this.preProcessClassProps=function(g,E){return E},this.postProcessConvertedJson=function(g){return g};for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var f=0,c=n;f<c.length;f++){var O=c[f];this.merge(O)}}var r=e.prototype;return r.merge=function(n){for(var i in n)switch(i){case"layers":case"views":Object.assign(this.classes,n[i]);break;default:if(i in this){var f=n[i];this[i]=Ye(this[i])?Object.assign(this[i],f):f}}},r.validate=function(n){return F(!this.typeKey||typeof this.typeKey=="string"),F(Ye(this.classes)),!0},e}();function Ir(e){return typeof e=="string"&&e.startsWith(M)}function Ar(e){return e.replace(M,"")}function U(e,r){var t={};for(var n in e){var i=e[n],f=Ir(i);f&&(i=Ar(i),i=w(i,r)),t[n]=i}return t}function qe(e,r,t){var n=t.classes[e],i=t.reactComponents[e];if(!n&&!i){var f=t.log;if(f){var c=JSON.stringify(r,null,0).slice(0,40);f.warn("JSON converter: No registered class of type ".concat(e,"(").concat(c,"...) "))}return null}return n?Tr(n,r,t):Jr(i,r,t)}function Tr(e,r,t){return t.preProcessClassProps&&(r=t.preProcessClassProps(e,r,t)),r=U(r,t),new e(r)}function Jr(e,r,t){var n=t.React,i=r,f=i.children,c=f===void 0?[]:f;return delete r.children,t.preProcessClassProps&&(r=t.preProcessClassProps(e,r,t)),r=U(r,t),n.createElement(e,r,c)}function Xe(e,r,t){var n=t.functions[e];if(!n){var i=t.log;if(i){var f=JSON.stringify(r,null,0).slice(0,40);i.warn("JSON converter: No registered function ".concat(e,"(").concat(f,"...) "))}return null}return n(r)}function Oe(e){return typeof e=="string"?JSON.parse(e):e}function Dr(e,r){return Ur(e)||Rr(e,r)||Mr(e,r)||Fr()}function Fr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. | ||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mr(e,r){if(e){if(typeof e=="string")return Qe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qe(e,r)}}function Qe(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Rr(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,f=!1,c,O;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(g){f=!0,O=g}finally{try{!i&&t.return!=null&&t.return()}finally{if(f)throw O}}return n}}function Ur(e){if(Array.isArray(e))return e}function We(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function $e(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?We(Object(t),!0).forEach(function(n){Br(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):We(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Br(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Lr(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function fe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(t){return typeof t}:fe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(e)}var Ee=function(r){return r&&fe(r)==="object"},He=function(){function e(t){Lr(this,e),this.log=console,this.configuration=void 0,this.onJSONChange=function(){},this.json=null,this.convertedJson=null,this.setProps(t)}var r=e.prototype;return r.finalize=function(){},r.setProps=function(n){"configuration"in n&&(this.configuration=n.configuration instanceof R?n.configuration:new R(n.configuration)),"onJSONChange"in n&&(this.onJSONChange=n.onJSONChange)},r.mergeConfiguration=function(n){this.configuration.merge(n)},r.convert=function(n){if(!n||n===this.json)return this.convertedJson;this.json=n;var i=Oe(n),f=jr(i,this.configuration);return f=this.configuration.postProcessConvertedJson(f),this.convertedJson=f,f},r.convertJson=function(n){return this.convert(n)},e}();function jr(e,r){return r=new R(r),_e(e,"",r)}function _e(e,r,t){return Array.isArray(e)?e.map(function(n,i){return _e(n,String(i),t)}):zr(e,t)?Kr(e,t):Ee(e)?ae in e?kr(e,t):Se(e,t):typeof e=="string"?Yr(e,r,t):e}function zr(e,r){var t=r.typeKey,n=Ee(e)&&Boolean(e[t]);return n}function Kr(e,r){var t=r.typeKey,n=e[t],i=$e({},e);return delete i[t],i=Se(i,r),qe(n,i,r)}function kr(e,r){var t=r.functionKey,n=e[t],i=$e({},e);return delete i[t],i=Se(i,r),Xe(n,i,r)}function Se(e,r){F(Ee(e));var t={};for(var n in e){var i=e[n];t[n]=_e(i,n,r)}return t}function Yr(e,r,t){if(e.startsWith(M)&&t.convertFunction)return e=e.replace(M,""),t.convertFunction(e,t);if(e.startsWith(ge)){if(e=e.replace(ge,""),t.constants[e])return t.constants[e];var n=e.split("."),i=Dr(n,2),f=i[0],c=i[1];return t.enumerations[f][c]}return e}function le(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?le=function(t){return typeof t}:le=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(e)}function Ge(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ce(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ge(Object(t),!0).forEach(function(n){qr(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ge(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function qr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Xr(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var B={onInitialize:function(r){return r},onFinalize:function(r){return r},onMessage:function(r){return r}},Ze=function(){e.setCallbacks=function(n){var i=n.onInitialize,f=n.onFinalize,c=n.onMessage;i&&(B.onInitialize=i),f&&(B.onFinalize=f),c&&(B.onMessage=c)};function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"Transport";Xr(this,e),this.name=void 0,this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=t}var r=e.prototype;return r.getRootDOMElement=function(){return typeof document<"u"?document.body:null},r.sendJSONMessage=function(){console.error("Back-channel not implemented for this transport")},r.sendBinaryMessage=function(){console.error("Back-channel not implemented for this transport")},r._initialize=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Ce({transport:this},n);B.onInitialize(i)},r._finalize=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Ce({transport:this},n);B.onFinalize(i),this._destroyed=!0},r._messageReceived=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n=Ce({transport:this},n),console.debug("Delivering transport message",n),B.onMessage(n)},e._stringifyJSONSafe=function(n){var i=new Set;return JSON.stringify(n,function(f,c){if(le(c)==="object"&&c!==null){if(i.has(c))try{return JSON.parse(JSON.stringify(c))}catch{return}i.add(c)}return c})},e}();function W(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?W=function(t){return typeof t}:W=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function Ve(e,r){if(e===r)return!0;if(W(e)!=="object"||e===null||W(r)!=="object"||r===null||Object.keys(e).length!==Object.keys(r).length)return!1;for(var t in e)if(!(t in r)||e[t]!==r[t])return!1;for(var n in r)if(!(n in e))return!1;return!0}return Er($);})(); | ||
"use strict";var __exports__=(()=>{var lr=Object.create;var le=Object.defineProperty;var fr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var hr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var Ue=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Le=(e,r)=>{for(var t in r)le(e,t,{get:r[t],enumerable:!0})},ce=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of pr(r))!mr.call(e,n)&&n!==t&&le(e,n,{get:()=>r[n],enumerable:!(i=fr(r,n))||i.enumerable});return e},N=(e,r,t)=>(ce(e,r,"default"),t&&ce(t,r,"default")),fe=(e,r,t)=>(t=e!=null?lr(hr(e)):{},ce(r||!e||!e.__esModule?le(t,"default",{value:e,enumerable:!0}):t,e)),dr=e=>ce(le({},"__esModule",{value:!0}),e);var Oe=Ue((Dr,Me)=>{Me.exports=globalThis.deck});var ge=Ue((H,pe)=>{(function(e){"use strict";var r="Compound",t="Identifier",i="MemberExpression",n="Literal",p="ThisExpression",O="CallExpression",te="UnaryExpression",ne="BinaryExpression",Y="LogicalExpression",se="ConditionalExpression",S="ArrayExpression",_=46,l=44,I=39,de=34,A=40,Ie=41,ye=91,Ae=93,Ze=63,er=59,rr=58,E=function(a,s){var g=new Error(a+" at character "+s);throw g.index=s,g.description=a,g},q=!0,J={"-":q,"!":q,"~":q,"+":q},C={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},oe=function(a){var s=0,g;for(var T in a)(g=T.length)>s&&a.hasOwnProperty(T)&&(s=g);return s},k=oe(J),F=oe(C),X={true:!0,false:!1,null:null},tr="this",Je=function(a){return C[a]||0},ke=function(a,s,g){var T=a==="||"||a==="&&"?Y:ne;return{type:T,operator:a,left:s,right:g}},z=function(a){return a>=48&&a<=57},$=function(a){return a===36||a===95||a>=65&&a<=90||a>=97&&a<=122||a>=128&&!C[String.fromCharCode(a)]},Ee=function(a){return a===36||a===95||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a>=128&&!C[String.fromCharCode(a)]},h=function(a){for(var s=0,g=a.charAt,T=a.charCodeAt,v=function(o){return g.call(a,o)},f=function(o){return T.call(a,o)},Q=a.length,x=function(){for(var o=f(s);o===32||o===9||o===10||o===13;)o=f(++s)},D=function(){var o=sr(),u,c;if(x(),f(s)===Ze){if(s++,u=D(),u||E("Expected expression",s),x(),f(s)===rr)return s++,c=D(),c||E("Expected expression",s),{type:se,test:o,consequent:u,alternate:c};E("Expected :",s)}else return o},Fe=function(){x();for(var o,u=a.substr(s,F),c=u.length;c>0;){if(C.hasOwnProperty(u)&&(!$(f(s))||s+u.length<a.length&&!Ee(f(s+u.length))))return s+=c,u;u=u.substr(0,--c)}return!1},sr=function(){var o,u,c,d,y,ue,W,G,R;if(W=ie(),c=Fe(),!c)return W;for(ue={value:c,prec:Je(c)},G=ie(),G||E("Expected expression after "+c,s),y=[W,ue,G];(c=Fe())&&(d=Je(c),d!==0);){for(ue={value:c,prec:d};y.length>2&&d<=y[y.length-2].prec;)G=y.pop(),c=y.pop().value,W=y.pop(),u=ke(c,W,G),y.push(u);u=ie(),u||E("Expected expression after "+c,s),y.push(ue,u)}for(R=y.length-1,u=y[R];R>1;)u=ke(y[R-1].value,y[R-2],u),R-=2;return u},ie=function(){var o,u,c;if(x(),o=f(s),z(o)||o===_)return or();if(o===I||o===de)return ir();if(o===ye)return cr();for(u=a.substr(s,k),c=u.length;c>0;){if(J.hasOwnProperty(u)&&(!$(f(s))||s+u.length<a.length&&!Ee(f(s+u.length))))return s+=c,{type:te,operator:u,argument:ie(),prefix:!0};u=u.substr(0,--c)}return $(o)||o===A?ar():!1},or=function(){for(var o="",u,c;z(f(s));)o+=v(s++);if(f(s)===_)for(o+=v(s++);z(f(s));)o+=v(s++);if(u=v(s),u==="e"||u==="E"){for(o+=v(s++),u=v(s),(u==="+"||u==="-")&&(o+=v(s++));z(f(s));)o+=v(s++);z(f(s-1))||E("Expected exponent ("+o+v(s)+")",s)}return c=f(s),$(c)?E("Variable names cannot start with a number ("+o+v(s)+")",s):c===_&&E("Unexpected period",s),{type:n,value:parseFloat(o),raw:o}},ir=function(){for(var o="",u=v(s++),c=!1,d;s<Q;)if(d=v(s++),d===u){c=!0;break}else if(d==="\\")switch(d=v(s++),d){case"n":o+=` | ||
`;break;case"r":o+="\r";break;case"t":o+=" ";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;default:o+=d}else o+=d;return c||E('Unclosed quote after "'+o+'"',s),{type:n,value:o,raw:u+o+u}},Te=function(){var o=f(s),u=s,c;for($(o)?s++:E("Unexpected "+v(s),s);s<Q&&(o=f(s),Ee(o));)s++;return c=a.slice(u,s),X.hasOwnProperty(c)?{type:n,value:X[c],raw:c}:c===tr?{type:p}:{type:t,name:c}},De=function(o){for(var u,c=[],d,y=!1;s<Q;)if(x(),u=f(s),u===o){y=!0,s++;break}else u===l?s++:(d=D(),(!d||d.type===r)&&E("Expected comma",s),c.push(d));return y||E("Expected "+String.fromCharCode(o),s),c},ar=function(){var o,u;for(o=f(s),o===A?u=ur():u=Te(),x(),o=f(s);o===_||o===ye||o===A;)s++,o===_?(x(),u={type:i,computed:!1,object:u,property:Te()}):o===ye?(u={type:i,computed:!0,object:u,property:D()},x(),o=f(s),o!==Ae&&E("Unclosed [",s),s++):o===A&&(u={type:O,arguments:De(Ie),callee:u}),x(),o=f(s);return u},ur=function(){s++;var o=D();if(x(),f(s)===Ie)return s++,o;E("Unclosed (",s)},cr=function(){return s++,{type:S,elements:De(Ae)}},ae=[],ve,Re;s<Q;)ve=f(s),ve===er||ve===l?s++:(Re=D())?ae.push(Re):s<Q&&E('Unexpected "'+v(s)+'"',s);return ae.length===1?ae[0]:{type:r,body:ae}};if(h.version="0.3.4",h.toString=function(){return"JavaScript Expression Parser (JSEP) v"+h.version},h.addUnaryOp=function(a){return k=Math.max(a.length,k),J[a]=q,this},h.addBinaryOp=function(a,s){return F=Math.max(a.length,F),C[a]=s,this},h.addLiteral=function(a,s){return X[a]=s,this},h.removeUnaryOp=function(a){return delete J[a],a.length===k&&(k=oe(J)),this},h.removeAllUnaryOps=function(){return J={},k=0,this},h.removeBinaryOp=function(a){return delete C[a],a.length===F&&(F=oe(C)),this},h.removeAllBinaryOps=function(){return C={},F=0,this},h.removeLiteral=function(a){return delete X[a],this},h.removeAllLiterals=function(){return X={},this},typeof H>"u"){var nr=e.jsep;e.jsep=h,h.noConflict=function(){return e.jsep===h&&(e.jsep=nr),h}}else typeof pe<"u"&&pe.exports?H=pe.exports=h:H.parse=h})(H)});var re={};Le(re,{JSONConfiguration:()=>P,JSONConverter:()=>Z,Transport:()=>ee,_convertFunctions:()=>j,_parseExpressionString:()=>w,_shallowEqualObjects:()=>Ve});var b={},Be=fe(Oe(),1);N(b,fe(Oe(),1));if(!Be.Layer)throw new Error("@deck.gl/core is not found");N(re,b);function U(e,r=""){if(!e)throw new Error(`JSON conversion error ${r}`)}function Ke(e,r){let t=Er(r),i=e;for(let n of t)i=yr(i)?i[n]:void 0;return i}function yr(e){return e!==null&&typeof e=="object"}var je={};function Er(e){if(typeof e=="string"){let r=je[e];return r||(r=e.split("."),je[e]=r),r}return Array.isArray(e)?e:[e]}var xe={};Le(xe,{addBinaryOp:()=>br,addUnaryOp:()=>xr,compile:()=>Or,compileAsync:()=>gr,eval:()=>m,evalAsync:()=>V,parse:()=>$e.default});var L=fe(ge()),$e=fe(ge()),V=function e(r,t){try{var i,n=r;switch(n.type){case"ArrayExpression":return Promise.resolve(qe(n.elements,t));case"BinaryExpression":return Promise.resolve(Promise.all([e(n.left,t),e(n.right,t)])).then(function(l){return M[n.operator](l[0],l[1])});case"CallExpression":var p,O,te,ne=function(){if(typeof O=="function"){var l=O,I=l.apply,de=p;return Promise.resolve(qe(n.arguments,t)).then(function(A){return Promise.resolve(I.call(l,de,A))})}},Y=n.callee.type==="MemberExpression"?Promise.resolve(Ye(n.callee,t)).then(function(l){p=(te=l)[0],O=te[1]}):Promise.resolve(e(n.callee,t)).then(function(l){O=l});return Promise.resolve(Y&&Y.then?Y.then(ne):ne());case"ConditionalExpression":return Promise.resolve(e(n.test,t)).then(function(l){return Promise.resolve(e(l?n.consequent:n.alternate,t))});case"Identifier":return Promise.resolve(t[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var se=function(l){return i?l:Promise.resolve(Promise.all([e(n.left,t),e(n.right,t)])).then(function(I){return M[n.operator](I[0],I[1])})},S=n.operator==="||"?(i=1,Promise.resolve(e(n.left,t)).then(function(l){return l||Promise.resolve(e(n.right,t))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(e(n.left,t)).then(function(l){return l&&Promise.resolve(e(n.right,t))})}();return Promise.resolve(S&&S.then?S.then(se):se(S));case"MemberExpression":return Promise.resolve(Ye(n,t)).then(function(l){return l[1]});case"ThisExpression":return Promise.resolve(t);case"UnaryExpression":var _=he[n.operator];return Promise.resolve(e(n.argument,t)).then(function(l){return _.call(he,l)});default:return Promise.resolve(void 0)}}catch(l){return Promise.reject(l)}},Ye=function(e,r){try{return Promise.resolve(V(e.object,r)).then(function(t){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[t,t[n]]}var n,p=function(){if(e.computed)return Promise.resolve(V(e.property,r)).then(function(O){n=O});n=e.property.name}();return p&&p.then?p.then(i):i()})}catch(t){return Promise.reject(t)}},qe=function(e,r){try{return Promise.resolve(Promise.all(e.map(function(t){return V(t,r)})))}catch(t){return Promise.reject(t)}},vr={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},M={"||":function(e,r){return e||r},"&&":function(e,r){return e&&r},"|":function(e,r){return e|r},"^":function(e,r){return e^r},"&":function(e,r){return e&r},"==":function(e,r){return e==r},"!=":function(e,r){return e!=r},"===":function(e,r){return e===r},"!==":function(e,r){return e!==r},"<":function(e,r){return e<r},">":function(e,r){return e>r},"<=":function(e,r){return e<=r},">=":function(e,r){return e>=r},"<<":function(e,r){return e<<r},">>":function(e,r){return e>>r},">>>":function(e,r){return e>>>r},"+":function(e,r){return e+r},"-":function(e,r){return e-r},"*":function(e,r){return e*r},"/":function(e,r){return e/r},"%":function(e,r){return e%r}},he={"-":function(e){return-e},"+":function(e){return+e},"~":function(e){return~e},"!":function(e){return!e}};function Xe(e,r){return e.map(function(t){return m(t,r)})}function ze(e,r){var t,i=m(e.object,r);if(t=e.computed?m(e.property,r):e.property.name,/^__proto__|prototype|constructor$/.test(t))throw Error('Access to member "'+t+'" disallowed.');return[i,i[t]]}function m(e,r){var t=e;switch(t.type){case"ArrayExpression":return Xe(t.elements,r);case"BinaryExpression":return M[t.operator](m(t.left,r),m(t.right,r));case"CallExpression":var i,n,p;return t.callee.type==="MemberExpression"?(i=(p=ze(t.callee,r))[0],n=p[1]):n=m(t.callee,r),typeof n!="function"?void 0:n.apply(i,Xe(t.arguments,r));case"ConditionalExpression":return m(t.test,r)?m(t.consequent,r):m(t.alternate,r);case"Identifier":return r[t.name];case"Literal":return t.value;case"LogicalExpression":return t.operator==="||"?m(t.left,r)||m(t.right,r):t.operator==="&&"?m(t.left,r)&&m(t.right,r):M[t.operator](m(t.left,r),m(t.right,r));case"MemberExpression":return ze(t,r)[1];case"ThisExpression":return r;case"UnaryExpression":return he[t.operator](m(t.argument,r));default:return}}function Or(e){return m.bind(null,(0,L.default)(e))}function gr(e){return V.bind(null,(0,L.default)(e))}function xr(e,r){L.default.addUnaryOp(e),he[e]=r}function br(e,r,t){t?(L.default.addBinaryOp(e,r),M[e]=t):(L.default.addBinaryOp(e,vr[e]||1),M[e]=r)}var{parse:Cr,eval:Pr}=xe,be={"-":e=>e};function w(e,r){if(e in be)return be[e];let t,i=Cr(e);return i.type==="Identifier"?t=n=>Ke(n,e):(Ce(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),t=n=>Pr(i,n)),be[e]=t,t}function Ce(e,r){if(Array.isArray(e))e.forEach(t=>Ce(t,r));else if(e&&typeof e=="object"){e.type&&r(e);for(let t in e)Ce(e[t],r)}}var B="@@=",Pe="@@#",Qe="@@type",me="@@function";var We=e=>e&&typeof e=="object",P=class{constructor(...r){this.typeKey=Qe;this.functionKey=me;this.log=console;this.classes={};this.reactComponents={};this.enumerations={};this.constants={};this.functions={};this.React=null;this.convertFunction=w;this.preProcessClassProps=(r,t)=>t;this.postProcessConvertedJson=r=>r;for(let t of r)this.merge(t)}merge(r){for(let t in r)switch(t){case"layers":case"views":Object.assign(this.classes,r[t]);break;default:if(t in this){let i=r[t];this[t]=We(this[t])?Object.assign(this[t],i):i}}}validate(r){return U(!this.typeKey||typeof this.typeKey=="string"),U(We(this.classes)),!0}};function Nr(e){return typeof e=="string"&&e.startsWith(B)}function _r(e){return e.replace(B,"")}function j(e,r){let t={};for(let i in e){let n=e[i];Nr(n)&&(n=_r(n),n=w(n,r)),t[i]=n}return t}function Ge(e,r,t){let i=t.classes[e],n=t.reactComponents[e];if(!i&&!n){let{log:p}=t;if(p){let O=JSON.stringify(r,null,0).slice(0,40);p.warn(`JSON converter: No registered class of type ${e}(${O}...) `)}return null}return i?wr(i,r,t):Sr(n,r,t)}function wr(e,r,t){return t.preProcessClassProps&&(r=t.preProcessClassProps(e,r,t)),r=j(r,t),new e(r)}function Sr(e,r,t){let{React:i}=t,{children:n=[]}=r;return delete r.children,t.preProcessClassProps&&(r=t.preProcessClassProps(e,r,t)),r=j(r,t),i.createElement(e,r,n)}function He(e,r,t){let i=t.functions[e];if(!i){let{log:n}=t;if(n){let p=JSON.stringify(r,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${e}(${p}...) `)}return null}return i(r)}function Ne(e){return typeof e=="string"?JSON.parse(e):e}var _e=e=>e&&typeof e=="object",Z=class{constructor(r){this.log=console;this.onJSONChange=()=>{};this.json=null;this.convertedJson=null;this.setProps(r)}finalize(){}setProps(r){"configuration"in r&&(this.configuration=r.configuration instanceof P?r.configuration:new P(r.configuration)),"onJSONChange"in r&&(this.onJSONChange=r.onJSONChange)}mergeConfiguration(r){this.configuration.merge(r)}convert(r){if(!r||r===this.json)return this.convertedJson;this.json=r;let t=Ne(r),i=Ir(t,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(r){return this.convert(r)}};function Ir(e,r){return r=new P(r),we(e,"",r)}function we(e,r,t){return Array.isArray(e)?e.map((i,n)=>we(i,String(n),t)):Ar(e,t)?Jr(e,t):_e(e)?me in e?kr(e,t):Se(e,t):typeof e=="string"?Fr(e,r,t):e}function Ar(e,r){let{typeKey:t}=r;return _e(e)&&Boolean(e[t])}function Jr(e,r){let{typeKey:t}=r,i=e[t],n={...e};return delete n[t],n=Se(n,r),Ge(i,n,r)}function kr(e,r){let{functionKey:t}=r,i=e[t],n={...e};return delete n[t],n=Se(n,r),He(i,n,r)}function Se(e,r){U(_e(e));let t={};for(let i in e){let n=e[i];t[i]=we(n,i,r)}return t}function Fr(e,r,t){if(e.startsWith(B)&&t.convertFunction)return e=e.replace(B,""),t.convertFunction(e,t);if(e.startsWith(Pe)){if(e=e.replace(Pe,""),t.constants[e])return t.constants[e];let[i,n]=e.split(".");return t.enumerations[i][n]}return e}var K={onInitialize:e=>e,onFinalize:e=>e,onMessage:e=>e},ee=class{constructor(r="Transport"){this._messageQueue=[];this.userData={};this._destroyed=!1;this.name=r}static setCallbacks({onInitialize:r,onFinalize:t,onMessage:i}){r&&(K.onInitialize=r),t&&(K.onFinalize=t),i&&(K.onMessage=i)}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(r={}){let t={transport:this,...r};K.onInitialize(t)}_finalize(r={}){let t={transport:this,...r};K.onFinalize(t),this._destroyed=!0}_messageReceived(r={}){r={transport:this,...r},console.debug("Delivering transport message",r),K.onMessage(r)}static _stringifyJSONSafe(r){let t=new Set;return JSON.stringify(r,(i,n)=>{if(typeof n=="object"&&n!==null){if(t.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}t.add(n)}return n})}};function Ve(e,r){if(e===r)return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null||Object.keys(e).length!==Object.keys(r).length)return!1;for(let t in e)if(!(t in r)||e[t]!==r[t])return!1;for(let t in r)if(!(t in e))return!1;return!0}return dr(re);})(); | ||
return __exports__; | ||
}); |
@@ -54,3 +54,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
throw error; | ||
}, t = true, unary_ops = { "-": t, "!": t, "~": t, "+": t }, binary_ops = { | ||
}, t2 = true, unary_ops = { "-": t2, "!": t2, "~": t2, "+": t2 }, binary_ops = { | ||
"||": 1, | ||
@@ -443,3 +443,3 @@ "&&": 2, | ||
max_unop_len = Math.max(op_name.length, max_unop_len); | ||
unary_ops[op_name] = t; | ||
unary_ops[op_name] = t2; | ||
return this; | ||
@@ -521,4 +521,4 @@ }; | ||
var peer_dependency_exports = {}; | ||
var import_core = __toESM(require_core()); | ||
__reExport(peer_dependency_exports, __toESM(require_core())); | ||
var import_core = __toESM(require_core(), 1); | ||
__reExport(peer_dependency_exports, __toESM(require_core(), 1)); | ||
if (!import_core.Layer) { | ||
@@ -564,93 +564,198 @@ throw new Error("@deck.gl/core is not found"); | ||
// ../../node_modules/expression-eval/dist/expression-eval.module.js | ||
var expression_eval_module_exports = {}; | ||
__export(expression_eval_module_exports, { | ||
addBinaryOp: () => m, | ||
addUnaryOp: () => p, | ||
compile: () => l, | ||
compileAsync: () => f, | ||
eval: () => a, | ||
evalAsync: () => e, | ||
parse: () => import_jsep2.default | ||
}); | ||
var import_jsep = __toESM(require_jsep()); | ||
var import_jsep2 = __toESM(require_jsep()); | ||
var u = { "||": function(r2, e) { | ||
return r2 || e; | ||
}, "&&": function(r2, e) { | ||
return r2 && e; | ||
}, "|": function(r2, e) { | ||
return r2 | e; | ||
}, "^": function(r2, e) { | ||
return r2 ^ e; | ||
}, "&": function(r2, e) { | ||
return r2 & e; | ||
}, "==": function(r2, e) { | ||
return r2 == e; | ||
}, "!=": function(r2, e) { | ||
return r2 != e; | ||
}, "===": function(r2, e) { | ||
return r2 === e; | ||
}, "!==": function(r2, e) { | ||
return r2 !== e; | ||
}, "<": function(r2, e) { | ||
return r2 < e; | ||
}, ">": function(r2, e) { | ||
return r2 > e; | ||
}, "<=": function(r2, e) { | ||
return r2 <= e; | ||
}, ">=": function(r2, e) { | ||
return r2 >= e; | ||
}, "<<": function(r2, e) { | ||
return r2 << e; | ||
}, ">>": function(r2, e) { | ||
return r2 >> e; | ||
}, ">>>": function(r2, e) { | ||
return r2 >>> e; | ||
}, "+": function(r2, e) { | ||
return r2 + e; | ||
}, "-": function(r2, e) { | ||
return r2 - e; | ||
}, "*": function(r2, e) { | ||
return r2 * e; | ||
}, "/": function(r2, e) { | ||
return r2 / e; | ||
}, "%": function(r2, e) { | ||
return r2 % e; | ||
var e = function r2(e2, o2) { | ||
try { | ||
var s2, c2 = e2; | ||
switch (c2.type) { | ||
case "ArrayExpression": | ||
return Promise.resolve(t(c2.elements, o2)); | ||
case "BinaryExpression": | ||
return Promise.resolve(Promise.all([r2(c2.left, o2), r2(c2.right, o2)])).then(function(r3) { | ||
return u[c2.operator](r3[0], r3[1]); | ||
}); | ||
case "CallExpression": | ||
var a2, l2, f2, p2 = function() { | ||
if ("function" == typeof l2) { | ||
var r3 = l2, e3 = r3.apply, n2 = a2; | ||
return Promise.resolve(t(c2.arguments, o2)).then(function(t2) { | ||
return Promise.resolve(e3.call(r3, n2, t2)); | ||
}); | ||
} | ||
}, m2 = "MemberExpression" === c2.callee.type ? Promise.resolve(n(c2.callee, o2)).then(function(r3) { | ||
a2 = (f2 = r3)[0], l2 = f2[1]; | ||
}) : Promise.resolve(r2(c2.callee, o2)).then(function(r3) { | ||
l2 = r3; | ||
}); | ||
return Promise.resolve(m2 && m2.then ? m2.then(p2) : p2()); | ||
case "ConditionalExpression": | ||
return Promise.resolve(r2(c2.test, o2)).then(function(e3) { | ||
return Promise.resolve(r2(e3 ? c2.consequent : c2.alternate, o2)); | ||
}); | ||
case "Identifier": | ||
return Promise.resolve(o2[c2.name]); | ||
case "Literal": | ||
return Promise.resolve(c2.value); | ||
case "LogicalExpression": | ||
var v = function(e3) { | ||
return s2 ? e3 : Promise.resolve(Promise.all([r2(c2.left, o2), r2(c2.right, o2)])).then(function(r3) { | ||
return u[c2.operator](r3[0], r3[1]); | ||
}); | ||
}, h = "||" === c2.operator ? (s2 = 1, Promise.resolve(r2(c2.left, o2)).then(function(e3) { | ||
return e3 || Promise.resolve(r2(c2.right, o2)); | ||
})) : function() { | ||
if ("&&" === c2.operator) | ||
return s2 = 1, Promise.resolve(r2(c2.left, o2)).then(function(e3) { | ||
return e3 ? Promise.resolve(r2(c2.right, o2)) : e3; | ||
}); | ||
}(); | ||
return Promise.resolve(h && h.then ? h.then(v) : v(h)); | ||
case "MemberExpression": | ||
return Promise.resolve(n(c2, o2)).then(function(r3) { | ||
return r3[1]; | ||
}); | ||
case "ThisExpression": | ||
return Promise.resolve(o2); | ||
case "UnaryExpression": | ||
var P = i[c2.operator]; | ||
return Promise.resolve(r2(c2.argument, o2)).then(function(r3) { | ||
return P.call(i, r3); | ||
}); | ||
default: | ||
return Promise.resolve(void 0); | ||
} | ||
} catch (r3) { | ||
return Promise.reject(r3); | ||
} | ||
}; | ||
var n = function(r3, n2) { | ||
try { | ||
return Promise.resolve(e(r3.object, n2)).then(function(t2) { | ||
function o2() { | ||
if (/^__proto__|prototype|constructor$/.test(u2)) | ||
throw Error('Access to member "' + u2 + '" disallowed.'); | ||
return [t2, t2[u2]]; | ||
} | ||
var u2, i2 = function() { | ||
if (r3.computed) | ||
return Promise.resolve(e(r3.property, n2)).then(function(r4) { | ||
u2 = r4; | ||
}); | ||
u2 = r3.property.name; | ||
}(); | ||
return i2 && i2.then ? i2.then(o2) : o2(); | ||
}); | ||
} catch (r4) { | ||
return Promise.reject(r4); | ||
} | ||
}; | ||
var t = function(r3, n2) { | ||
try { | ||
return Promise.resolve(Promise.all(r3.map(function(r4) { | ||
return e(r4, n2); | ||
}))); | ||
} catch (r4) { | ||
return Promise.reject(r4); | ||
} | ||
}; | ||
var o = { "||": 1, "&&": 2, "|": 3, "^": 4, "&": 5, "==": 6, "!=": 6, "===": 6, "!==": 6, "<": 7, ">": 7, "<=": 7, ">=": 7, "<<": 8, ">>": 8, ">>>": 8, "+": 9, "-": 9, "*": 10, "/": 10, "%": 10 }; | ||
var u = { "||": function(r3, e2) { | ||
return r3 || e2; | ||
}, "&&": function(r3, e2) { | ||
return r3 && e2; | ||
}, "|": function(r3, e2) { | ||
return r3 | e2; | ||
}, "^": function(r3, e2) { | ||
return r3 ^ e2; | ||
}, "&": function(r3, e2) { | ||
return r3 & e2; | ||
}, "==": function(r3, e2) { | ||
return r3 == e2; | ||
}, "!=": function(r3, e2) { | ||
return r3 != e2; | ||
}, "===": function(r3, e2) { | ||
return r3 === e2; | ||
}, "!==": function(r3, e2) { | ||
return r3 !== e2; | ||
}, "<": function(r3, e2) { | ||
return r3 < e2; | ||
}, ">": function(r3, e2) { | ||
return r3 > e2; | ||
}, "<=": function(r3, e2) { | ||
return r3 <= e2; | ||
}, ">=": function(r3, e2) { | ||
return r3 >= e2; | ||
}, "<<": function(r3, e2) { | ||
return r3 << e2; | ||
}, ">>": function(r3, e2) { | ||
return r3 >> e2; | ||
}, ">>>": function(r3, e2) { | ||
return r3 >>> e2; | ||
}, "+": function(r3, e2) { | ||
return r3 + e2; | ||
}, "-": function(r3, e2) { | ||
return r3 - e2; | ||
}, "*": function(r3, e2) { | ||
return r3 * e2; | ||
}, "/": function(r3, e2) { | ||
return r3 / e2; | ||
}, "%": function(r3, e2) { | ||
return r3 % e2; | ||
} }; | ||
var i = { "-": function(r2) { | ||
return -r2; | ||
}, "+": function(r2) { | ||
return +r2; | ||
}, "~": function(r2) { | ||
return ~r2; | ||
}, "!": function(r2) { | ||
return !r2; | ||
var i = { "-": function(r3) { | ||
return -r3; | ||
}, "+": function(r3) { | ||
return +r3; | ||
}, "~": function(r3) { | ||
return ~r3; | ||
}, "!": function(r3) { | ||
return !r3; | ||
} }; | ||
function s(r2, e) { | ||
return r2.map(function(r3) { | ||
return a(r3, e); | ||
function s(r3, e2) { | ||
return r3.map(function(r4) { | ||
return a(r4, e2); | ||
}); | ||
} | ||
function c(r2, e) { | ||
var n, t = a(r2.object, e); | ||
if (n = r2.computed ? a(r2.property, e) : r2.property.name, /^__proto__|prototype|constructor$/.test(n)) | ||
throw Error('Access to member "' + n + '" disallowed.'); | ||
return [t, t[n]]; | ||
function c(r3, e2) { | ||
var n2, t2 = a(r3.object, e2); | ||
if (n2 = r3.computed ? a(r3.property, e2) : r3.property.name, /^__proto__|prototype|constructor$/.test(n2)) | ||
throw Error('Access to member "' + n2 + '" disallowed.'); | ||
return [t2, t2[n2]]; | ||
} | ||
function a(r2, e) { | ||
var n = r2; | ||
switch (n.type) { | ||
function a(r3, e2) { | ||
var n2 = r3; | ||
switch (n2.type) { | ||
case "ArrayExpression": | ||
return s(n.elements, e); | ||
return s(n2.elements, e2); | ||
case "BinaryExpression": | ||
return u[n.operator](a(n.left, e), a(n.right, e)); | ||
return u[n2.operator](a(n2.left, e2), a(n2.right, e2)); | ||
case "CallExpression": | ||
var t, o, l; | ||
if ("MemberExpression" === n.callee.type ? (t = (l = c(n.callee, e))[0], o = l[1]) : o = a(n.callee, e), "function" != typeof o) | ||
var t2, o2, l2; | ||
if ("MemberExpression" === n2.callee.type ? (t2 = (l2 = c(n2.callee, e2))[0], o2 = l2[1]) : o2 = a(n2.callee, e2), "function" != typeof o2) | ||
return; | ||
return o.apply(t, s(n.arguments, e)); | ||
return o2.apply(t2, s(n2.arguments, e2)); | ||
case "ConditionalExpression": | ||
return a(n.test, e) ? a(n.consequent, e) : a(n.alternate, e); | ||
return a(n2.test, e2) ? a(n2.consequent, e2) : a(n2.alternate, e2); | ||
case "Identifier": | ||
return e[n.name]; | ||
return e2[n2.name]; | ||
case "Literal": | ||
return n.value; | ||
return n2.value; | ||
case "LogicalExpression": | ||
return "||" === n.operator ? a(n.left, e) || a(n.right, e) : "&&" === n.operator ? a(n.left, e) && a(n.right, e) : u[n.operator](a(n.left, e), a(n.right, e)); | ||
return "||" === n2.operator ? a(n2.left, e2) || a(n2.right, e2) : "&&" === n2.operator ? a(n2.left, e2) && a(n2.right, e2) : u[n2.operator](a(n2.left, e2), a(n2.right, e2)); | ||
case "MemberExpression": | ||
return c(n, e)[1]; | ||
return c(n2, e2)[1]; | ||
case "ThisExpression": | ||
return e; | ||
return e2; | ||
case "UnaryExpression": | ||
return i[n.operator](a(n.argument, e)); | ||
return i[n2.operator](a(n2.argument, e2)); | ||
default: | ||
@@ -660,4 +765,17 @@ return; | ||
} | ||
function l(e2) { | ||
return a.bind(null, (0, import_jsep.default)(e2)); | ||
} | ||
function f(n2) { | ||
return e.bind(null, (0, import_jsep.default)(n2)); | ||
} | ||
function p(e2, n2) { | ||
import_jsep.default.addUnaryOp(e2), i[e2] = n2; | ||
} | ||
function m(e2, n2, t2) { | ||
t2 ? (import_jsep.default.addBinaryOp(e2, n2), u[e2] = t2) : (import_jsep.default.addBinaryOp(e2, o[e2] || 1), u[e2] = n2); | ||
} | ||
// src/helpers/parse-expression-string.ts | ||
var { parse, eval: evaluate } = expression_eval_module_exports; | ||
var cachedExpressionMap = { | ||
@@ -671,3 +789,3 @@ "-": (object) => object | ||
let func; | ||
const ast = (0, import_jsep2.default)(propValue); | ||
const ast = parse(propValue); | ||
if (ast.type === "Identifier") { | ||
@@ -684,3 +802,3 @@ func = (row) => { | ||
func = (row) => { | ||
return a(ast, row); | ||
return evaluate(ast, row); | ||
}; | ||
@@ -713,15 +831,15 @@ } | ||
var JSONConfiguration = class { | ||
typeKey = TYPE_KEY; | ||
functionKey = FUNCTION_KEY; | ||
log = console; | ||
classes = {}; | ||
reactComponents = {}; | ||
enumerations = {}; | ||
constants = {}; | ||
functions = {}; | ||
React = null; | ||
convertFunction = parseExpressionString; | ||
preProcessClassProps = (Class, props) => props; | ||
postProcessConvertedJson = (json) => json; | ||
constructor(...configurations) { | ||
this.typeKey = TYPE_KEY; | ||
this.functionKey = FUNCTION_KEY; | ||
this.log = console; | ||
this.classes = {}; | ||
this.reactComponents = {}; | ||
this.enumerations = {}; | ||
this.constants = {}; | ||
this.functions = {}; | ||
this.React = null; | ||
this.convertFunction = parseExpressionString; | ||
this.preProcessClassProps = (Class, props) => props; | ||
this.postProcessConvertedJson = (json) => json; | ||
for (const configuration of configurations) { | ||
@@ -779,5 +897,3 @@ this.merge(configuration); | ||
if (!Class && !Component) { | ||
const { | ||
log | ||
} = configuration; | ||
const { log } = configuration; | ||
if (log) { | ||
@@ -802,8 +918,4 @@ const stringProps = JSON.stringify(props, null, 0).slice(0, 40); | ||
function instantiateReactComponent(Component, props, configuration) { | ||
const { | ||
React | ||
} = configuration; | ||
const { | ||
children = [] | ||
} = props; | ||
const { React } = configuration; | ||
const { children = [] } = props; | ||
delete props.children; | ||
@@ -821,5 +933,3 @@ if (configuration.preProcessClassProps) { | ||
if (!matchedFunction) { | ||
const { | ||
log | ||
} = configuration; | ||
const { log } = configuration; | ||
if (log) { | ||
@@ -842,8 +952,8 @@ const stringProps = JSON.stringify(props, null, 0).slice(0, 40); | ||
var JSONConverter = class { | ||
log = console; | ||
onJSONChange = () => { | ||
}; | ||
json = null; | ||
convertedJson = null; | ||
constructor(props) { | ||
this.log = console; | ||
this.onJSONChange = () => { | ||
}; | ||
this.json = null; | ||
this.convertedJson = null; | ||
this.setProps(props); | ||
@@ -902,5 +1012,3 @@ } | ||
function isClassInstance(json, configuration) { | ||
const { | ||
typeKey | ||
} = configuration; | ||
const { typeKey } = configuration; | ||
const isClass = isObject3(json) && Boolean(json[typeKey]); | ||
@@ -910,9 +1018,5 @@ return isClass; | ||
function convertClassInstance(json, configuration) { | ||
const { | ||
typeKey | ||
} = configuration; | ||
const { typeKey } = configuration; | ||
const type = json[typeKey]; | ||
let props = { | ||
...json | ||
}; | ||
let props = { ...json }; | ||
delete props[typeKey]; | ||
@@ -923,9 +1027,5 @@ props = convertPlainObject(props, configuration); | ||
function convertFunctionObject(json, configuration) { | ||
const { | ||
functionKey | ||
} = configuration; | ||
const { functionKey } = configuration; | ||
const targetFunction = json[functionKey]; | ||
let props = { | ||
...json | ||
}; | ||
let props = { ...json }; | ||
delete props[functionKey]; | ||
@@ -967,7 +1067,9 @@ props = convertPlainObject(props, configuration); | ||
var Transport = class { | ||
static setCallbacks({ | ||
onInitialize, | ||
onFinalize, | ||
onMessage | ||
}) { | ||
constructor(name = "Transport") { | ||
this._messageQueue = []; | ||
this.userData = {}; | ||
this._destroyed = false; | ||
this.name = name; | ||
} | ||
static setCallbacks({ onInitialize, onFinalize, onMessage }) { | ||
if (onInitialize) { | ||
@@ -983,8 +1085,2 @@ state.onInitialize = onInitialize; | ||
} | ||
_messageQueue = []; | ||
userData = {}; | ||
_destroyed = false; | ||
constructor(name = "Transport") { | ||
this.name = name; | ||
} | ||
getRootDOMElement() { | ||
@@ -1000,13 +1096,7 @@ return typeof document !== "undefined" ? document.body : null; | ||
_initialize(options = {}) { | ||
const message = { | ||
transport: this, | ||
...options | ||
}; | ||
const message = { transport: this, ...options }; | ||
state.onInitialize(message); | ||
} | ||
_finalize(options = {}) { | ||
const message = { | ||
transport: this, | ||
...options | ||
}; | ||
const message = { transport: this, ...options }; | ||
state.onFinalize(message); | ||
@@ -1016,6 +1106,3 @@ this._destroyed = true; | ||
_messageReceived(message = {}) { | ||
message = { | ||
transport: this, | ||
...message | ||
}; | ||
message = { transport: this, ...message }; | ||
console.debug("Delivering transport message", message); | ||
@@ -1022,0 +1109,0 @@ state.onMessage(message); |
@@ -5,3 +5,4 @@ { | ||
"license": "MIT", | ||
"version": "9.0.0-beta.2", | ||
"type": "module", | ||
"version": "9.0.0-beta.3", | ||
"publishConfig": { | ||
@@ -20,9 +21,15 @@ "access": "public" | ||
}, | ||
"main": "dist/es5/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "typed/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"files": [ | ||
"dist", | ||
"src", | ||
"typed", | ||
"dist.min.js" | ||
@@ -43,3 +50,3 @@ ], | ||
}, | ||
"gitHead": "ed132efaf84a75ea71c89dd8555b6ffc1fe839d5" | ||
"gitHead": "643d1009268bbf92b5bc0941d00aa59d5e3a582b" | ||
} |
import {get} from '../utils/get'; | ||
// expression-eval: Small jsep based expression parser that supports array and object indexing | ||
import {parse, eval as evaluate} from 'expression-eval'; | ||
import * as expressionEval from 'expression-eval'; | ||
const {parse, eval: evaluate} = expressionEval; | ||
@@ -6,0 +7,0 @@ const cachedExpressionMap = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2811
Yes
152191
59