piral-dashboard 1.4.0-beta.6250 → 1.4.0-beta.6252

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/esm/Dashboard.js CHANGED
@@ -16,7 +16,7 @@ export const Dashboard = (props) => {
16
16
  return (React.createElement(PiralDashboardTile, { key: tile, columns: initialColumns, rows: initialRows, resizable: resizable, meta: preferences },
17
17
  React.createElement(Component, { columns: initialColumns, rows: initialRows })));
18
18
  });
19
- return React.createElement(PiralDashboardContainer, Object.assign({}, props, { children: children }));
19
+ return React.createElement(PiralDashboardContainer, { ...props, children: children });
20
20
  };
21
21
  Dashboard.displayName = 'Dashboard';
22
22
  //# sourceMappingURL=Dashboard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../src/Dashboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAO3E;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,KAAK,EAAE,EAAE;IAC3D,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;SAChC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;SACrC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,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AAE;QACZ,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,EAAE,cAAc,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,WAAW,CAAC;QAC/E,OAAO,CACL,oBAAC,kBAAkB,IACjB,GAAG,EAAE,IAAI,EACT,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,WAAW;YACjB,oBAAC,SAAS,IAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAI,CACtC,CACtB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,OAAO,oBAAC,uBAAuB,OAAK,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AACpE,CAAC,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
package/esm/actions.js CHANGED
@@ -1,8 +1,20 @@
1
1
  import { withKey, withoutKey } from 'piral-core';
2
2
  export function registerTile(ctx, name, value) {
3
- ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { tiles: withKey(state.registry.tiles, name, value) }) })));
3
+ ctx.dispatch((state) => ({
4
+ ...state,
5
+ registry: {
6
+ ...state.registry,
7
+ tiles: withKey(state.registry.tiles, name, value),
8
+ },
9
+ }));
4
10
  }
5
11
  export function unregisterTile(ctx, name) {
6
- ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { tiles: withoutKey(state.registry.tiles, name) }) })));
12
+ ctx.dispatch((state) => ({
13
+ ...state,
14
+ registry: {
15
+ ...state.registry,
16
+ tiles: withoutKey(state.registry.tiles, name),
17
+ },
18
+ }));
7
19
  }
8
20
  //# sourceMappingURL=actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":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QACvB,GAAG,KAAK;QACR,QAAQ,EAAE;YACR,GAAG,KAAK,CAAC,QAAQ;YACjB,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;SAC9C;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
package/esm/helpers.js CHANGED
@@ -1,7 +1,10 @@
1
1
  import { DefaultTile, DefaultContainer } from './default';
2
2
  import { Dashboard } from './Dashboard';
3
3
  export function getPreferences(defaultPreferences, customPreferences = {}) {
4
- return Object.assign(Object.assign({}, defaultPreferences), customPreferences);
4
+ return {
5
+ ...defaultPreferences,
6
+ ...customPreferences,
7
+ };
5
8
  }
6
9
  export function getTiles(items, defaultPreferences) {
7
10
  const tiles = {};
@@ -16,12 +19,29 @@ export function getTiles(items, defaultPreferences) {
16
19
  return tiles;
17
20
  }
18
21
  export function withTiles(tiles) {
19
- return (state) => (Object.assign(Object.assign({}, state), { components: Object.assign({ DashboardTile: DefaultTile, DashboardContainer: DefaultContainer }, state.components), registry: Object.assign(Object.assign({}, state.registry), { tiles }) }));
22
+ return (state) => ({
23
+ ...state,
24
+ components: {
25
+ DashboardTile: DefaultTile,
26
+ DashboardContainer: DefaultContainer,
27
+ ...state.components,
28
+ },
29
+ registry: {
30
+ ...state.registry,
31
+ tiles,
32
+ },
33
+ });
20
34
  }
21
35
  export function withRoutes(routes) {
22
- return (state) => (Object.assign(Object.assign({}, state), { routes: Object.assign(Object.assign({}, state.routes), routes.reduce((newRoutes, route) => {
23
- newRoutes[route] = Dashboard;
24
- return newRoutes;
25
- }, {})) }));
36
+ return (state) => ({
37
+ ...state,
38
+ routes: {
39
+ ...state.routes,
40
+ ...routes.reduce((newRoutes, route) => {
41
+ newRoutes[route] = Dashboard;
42
+ return newRoutes;
43
+ }, {}),
44
+ },
45
+ });
26
46
  }
27
47
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts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C,GAAG,SAAS,CAAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC,EAAE,EAAE,CAAC;SACP;KACF,CAAC,CAAC;AACL,CAAC"}
package/lib/Dashboard.js CHANGED
@@ -19,7 +19,7 @@ const Dashboard = (props) => {
19
19
  return (React.createElement(components_1.PiralDashboardTile, { key: tile, columns: initialColumns, rows: initialRows, resizable: resizable, meta: preferences },
20
20
  React.createElement(Component, { columns: initialColumns, rows: initialRows })));
21
21
  });
22
- return React.createElement(components_1.PiralDashboardContainer, Object.assign({}, props, { children: children }));
22
+ return React.createElement(components_1.PiralDashboardContainer, { ...props, children: children });
23
23
  };
24
24
  exports.Dashboard = Dashboard;
25
25
  exports.Dashboard.displayName = 'Dashboard';
@@ -1 +1 @@
1
- {"version":3,"file":"Dashboard.js","sourceRoot":"","sources":["../src/Dashboard.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,2CAA4C;AAC5C,6CAA2E;AAO3E;;;GAGG;AACI,MAAM,SAAS,GAA6B,CAAC,KAAK,EAAE,EAAE;IAC3D,MAAM,KAAK,GAAG,IAAA,2BAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;SAChC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;SACrC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,EAAE,cAAc,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,EAAE,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C;QAC/E,OAAO,CACL,oBAAC,+BAAkB,IACjB,GAAG,EAAE,IAAI,EACT,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,WAAW;YACjB,oBAAC,SAAS,IAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAI,CACtC,CACtB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,OAAO,oBAAC,oCAAuB,OAAK,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AACpE,CAAC,CAAC;AArBW,QAAA,SAAS,aAqBpB;AACF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
package/lib/actions.js CHANGED
@@ -3,11 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unregisterTile = exports.registerTile = void 0;
4
4
  const piral_core_1 = require("piral-core");
5
5
  function registerTile(ctx, name, value) {
6
- ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { tiles: (0, piral_core_1.withKey)(state.registry.tiles, name, value) }) })));
6
+ ctx.dispatch((state) => ({
7
+ ...state,
8
+ registry: {
9
+ ...state.registry,
10
+ tiles: (0, piral_core_1.withKey)(state.registry.tiles, name, value),
11
+ },
12
+ }));
7
13
  }
8
14
  exports.registerTile = registerTile;
9
15
  function unregisterTile(ctx, name) {
10
- ctx.dispatch((state) => (Object.assign(Object.assign({}, state), { registry: Object.assign(Object.assign({}, state.registry), { tiles: (0, piral_core_1.withoutKey)(state.registry.tiles, name) }) })));
16
+ ctx.dispatch((state) => ({
17
+ ...state,
18
+ registry: {
19
+ ...state.registry,
20
+ tiles: (0, piral_core_1.withoutKey)(state.registry.tiles, name),
21
+ },
22
+ }));
11
23
  }
12
24
  exports.unregisterTile = unregisterTile;
13
25
  //# sourceMappingURL=actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.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YACjB,KAAK,EAAE,IAAA,uBAAU,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;SAC9C;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AARD,wCAQC"}
package/lib/helpers.js CHANGED
@@ -4,7 +4,10 @@ exports.withRoutes = exports.withTiles = exports.getTiles = exports.getPreferenc
4
4
  const default_1 = require("./default");
5
5
  const Dashboard_1 = require("./Dashboard");
6
6
  function getPreferences(defaultPreferences, customPreferences = {}) {
7
- return Object.assign(Object.assign({}, defaultPreferences), customPreferences);
7
+ return {
8
+ ...defaultPreferences,
9
+ ...customPreferences,
10
+ };
8
11
  }
9
12
  exports.getPreferences = getPreferences;
10
13
  function getTiles(items, defaultPreferences) {
@@ -21,14 +24,31 @@ function getTiles(items, defaultPreferences) {
21
24
  }
22
25
  exports.getTiles = getTiles;
23
26
  function withTiles(tiles) {
24
- return (state) => (Object.assign(Object.assign({}, state), { components: Object.assign({ DashboardTile: default_1.DefaultTile, DashboardContainer: default_1.DefaultContainer }, state.components), registry: Object.assign(Object.assign({}, state.registry), { tiles }) }));
27
+ return (state) => ({
28
+ ...state,
29
+ components: {
30
+ DashboardTile: default_1.DefaultTile,
31
+ DashboardContainer: default_1.DefaultContainer,
32
+ ...state.components,
33
+ },
34
+ registry: {
35
+ ...state.registry,
36
+ tiles,
37
+ },
38
+ });
25
39
  }
26
40
  exports.withTiles = withTiles;
27
41
  function withRoutes(routes) {
28
- return (state) => (Object.assign(Object.assign({}, state), { routes: Object.assign(Object.assign({}, state.routes), routes.reduce((newRoutes, route) => {
29
- newRoutes[route] = Dashboard_1.Dashboard;
30
- return newRoutes;
31
- }, {})) }));
42
+ return (state) => ({
43
+ ...state,
44
+ routes: {
45
+ ...state.routes,
46
+ ...routes.reduce((newRoutes, route) => {
47
+ newRoutes[route] = Dashboard_1.Dashboard;
48
+ return newRoutes;
49
+ }, {}),
50
+ },
51
+ });
32
52
  }
33
53
  exports.withRoutes = withRoutes;
34
54
  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AAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC,EAAE,EAAE,CAAC;SACP;KACF,CAAC,CAAC;AACL,CAAC;AAXD,gCAWC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-dashboard",
3
- "version": "1.4.0-beta.6250",
3
+ "version": "1.4.0-beta.6252",
4
4
  "description": "Plugin for creating a centralized dashboard in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -63,8 +63,8 @@
63
63
  "devDependencies": {
64
64
  "@types/react": "^18.0.0",
65
65
  "@types/react-router-dom": "^5.1.6",
66
- "piral-core": "1.4.0-beta.6250",
66
+ "piral-core": "1.4.0-beta.6252",
67
67
  "react": "^18.0.0"
68
68
  },
69
- "gitHead": "7c95a8922d0cfb80e02b32bcded0256825e00c09"
69
+ "gitHead": "f30d158bb902504e233849eb7c7f65a0d3e52ce3"
70
70
  }
@@ -1 +1 @@
1
- var piralDashboard=(()=>{var q=Object.create;var h=Object.defineProperty,v=Object.defineProperties,B=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols,L=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var I=(e,r,t)=>r in e?h(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,i=(e,r)=>{for(var t in r||(r={}))G.call(r,t)&&I(e,t,r[t]);if(S)for(var t of S(r))M.call(r,t)&&I(e,t,r[t]);return e},s=(e,r)=>v(e,H(r)),F=e=>h(e,"__esModule",{value:!0});var p=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var k=(e,r)=>{F(e);for(var t in r)h(e,t,{get:r[t],enumerable:!0})},Q=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of J(r))!G.call(e,o)&&o!=="default"&&h(e,o,{get:()=>r[o],enumerable:!(t=B(r,o))||t.enumerable});return e},c=e=>Q(F(h(e!=null?q(L(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var X={};k(X,{Dashboard:()=>d,PiralDashboardContainer:()=>C,PiralDashboardTile:()=>R,createDashboardApi:()=>W});var y={};k(y,{registerTile:()=>U,unregisterTile:()=>V});var D=c(p("piral-core"));function U(e,r,t){e.dispatch(o=>s(i({},o),{registry:s(i({},o.registry),{tiles:(0,D.withKey)(o.registry.tiles,r,t)})}))}function V(e,r){e.dispatch(t=>s(i({},t),{registry:s(i({},t.registry),{tiles:(0,D.withoutKey)(t.registry.tiles,r)})}))}var l=c(p("piral-core"));var P=c(p("react")),z=c(p("piral-core"));var x=c(p("piral-core")),C=(0,x.getPiralComponent)("DashboardContainer"),R=(0,x.getPiralComponent)("DashboardTile");var d=e=>{let r=(0,z.useGlobalState)(a=>a.registry.tiles),{filter:t=()=>!0}=e,o=Object.keys(r).filter(a=>t(r[a])).map(a=>{let{component:f,preferences:T}=r[a],{initialColumns:m=1,initialRows:g=1,resizable:n=!1}=T;return P.createElement(R,{key:a,columns:m,rows:g,resizable:n,meta:T},P.createElement(f,{columns:m,rows:g}))});return P.createElement(C,s(i({},e),{children:o}))};d.displayName="Dashboard";var E=c(p("react")),b=c(p("piral-core")),K=e=>E.createElement(b.ExtensionSlot,{name:"dashboard",params:e,empty:()=>(0,b.defaultRender)(e.children,"default_dashboard")}),N=e=>(0,b.defaultRender)(e.children);function w(e,r={}){return i(i({},e),r)}function j(e,r){let t={},o=0;for(let{component:a,preferences:f}of e)t[`global-${o++}`]={pilet:void 0,component:a,preferences:w(r,f)};return t}function O(e){return r=>s(i({},r),{components:i({DashboardTile:N,DashboardContainer:K},r.components),registry:s(i({},r.registry),{tiles:e})})}function _(e){return r=>s(i({},r),{routes:i(i({},r.routes),e.reduce((t,o)=>(t[o]=d,t),{}))})}function W(e={}){let{tiles:r=[],defaultPreferences:t={},routes:o=["/"]}=e;return a=>(a.defineActions(y),a.dispatch((0,l.withAll)(O(j(r,t)),(0,l.withRootExtension)("piral-dashboard",d),_(o))),(f,T)=>{let m=T.name,g=0;return{registerTile(n,u,A){typeof n!="string"&&(A=u,u=n,n=g++);let $=(0,l.buildName)(m,n);return a.registerTile($,{pilet:m,component:(0,l.withApi)(a,u,f,"tile"),preferences:w(t,A)}),()=>f.unregisterTile(n)},unregisterTile(n){let u=(0,l.buildName)(m,n);a.unregisterTile(u)}}})}return X;})();
1
+ var piralDashboard=(()=>{var N=Object.create;var b=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var w=e=>b(e,"__esModule",{value:!0});var n=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var A=(e,r)=>{w(e);for(var t in r)b(e,t,{get:r[t],enumerable:!0})},q=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of O(r))!$.call(e,o)&&o!=="default"&&b(e,o,{get:()=>r[o],enumerable:!(t=j(r,o))||t.enumerable});return e},l=e=>q(w(b(e!=null?N(_(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var J={};A(J,{Dashboard:()=>f,PiralDashboardContainer:()=>y,PiralDashboardTile:()=>x,createDashboardApi:()=>H});var D={};A(D,{registerTile:()=>v,unregisterTile:()=>B});var T=l(n("piral-core"));function v(e,r,t){e.dispatch(o=>({...o,registry:{...o.registry,tiles:(0,T.withKey)(o.registry.tiles,r,t)}}))}function B(e,r){e.dispatch(t=>({...t,registry:{...t.registry,tiles:(0,T.withoutKey)(t.registry.tiles,r)}}))}var s=l(n("piral-core"));var g=l(n("react")),S=l(n("piral-core"));var P=l(n("piral-core")),y=(0,P.getPiralComponent)("DashboardContainer"),x=(0,P.getPiralComponent)("DashboardTile");var f=e=>{let r=(0,S.useGlobalState)(i=>i.registry.tiles),{filter:t=()=>!0}=e,o=Object.keys(r).filter(i=>t(r[i])).map(i=>{let{component:p,preferences:u}=r[i],{initialColumns:c=1,initialRows:h=1,resizable:a=!1}=u;return g.createElement(x,{key:i,columns:c,rows:h,resizable:a,meta:u},g.createElement(p,{columns:c,rows:h}))});return g.createElement(y,{...e,children:o})};f.displayName="Dashboard";var G=l(n("react")),d=l(n("piral-core")),I=e=>G.createElement(d.ExtensionSlot,{name:"dashboard",params:e,empty:()=>(0,d.defaultRender)(e.children,"default_dashboard")}),F=e=>(0,d.defaultRender)(e.children);function C(e,r={}){return{...e,...r}}function k(e,r){let t={},o=0;for(let{component:i,preferences:p}of e)t[`global-${o++}`]={pilet:void 0,component:i,preferences:C(r,p)};return t}function z(e){return r=>({...r,components:{DashboardTile:F,DashboardContainer:I,...r.components},registry:{...r.registry,tiles:e}})}function E(e){return r=>({...r,routes:{...r.routes,...e.reduce((t,o)=>(t[o]=f,t),{})}})}function H(e={}){let{tiles:r=[],defaultPreferences:t={},routes:o=["/"]}=e;return i=>(i.defineActions(D),i.dispatch((0,s.withAll)(z(k(r,t)),(0,s.withRootExtension)("piral-dashboard",f),E(o))),(p,u)=>{let c=u.name,h=0;return{registerTile(a,m,R){typeof a!="string"&&(R=m,m=a,a=h++);let K=(0,s.buildName)(c,a);return i.registerTile(K,{pilet:c,component:(0,s.withApi)(i,m,p,"tile"),preferences:C(t,R)}),()=>p.unregisterTile(a)},unregisterTile(a){let m=(0,s.buildName)(c,a);i.unregisterTile(m)}}})}return J;})();