@teipublisher/pb-components 1.40.2 → 1.41.1

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/demo/pb-code-editor.html +12 -9
  3. package/dist/{iron-form-f540b15b.js → iron-form-9e72ac45.js} +1 -1
  4. package/dist/jinn-codemirror-cc5827eb.js +1 -0
  5. package/dist/{paper-checkbox-f6a70487.js → paper-checkbox-102e3b43.js} +120 -120
  6. package/dist/pb-code-editor.js +22 -0
  7. package/dist/pb-components-bundle.js +234 -234
  8. package/dist/pb-edit-app.js +33 -33
  9. package/dist/pb-elements.json +61 -16
  10. package/dist/pb-i18n-6ad23bcf.js +1 -0
  11. package/dist/pb-message-0fb0b538.js +911 -0
  12. package/dist/pb-odd-editor.js +125 -82
  13. package/package.json +4 -5
  14. package/pb-elements.json +61 -16
  15. package/src/pb-code-editor.js +51 -663
  16. package/src/pb-components.js +0 -1
  17. package/src/pb-odd-model-editor.js +68 -23
  18. package/src/pb-odd-parameter-editor.js +17 -9
  19. package/src/pb-odd-rendition-editor.js +19 -9
  20. package/css/codemirror/3024-day.css +0 -41
  21. package/css/codemirror/3024-night.css +0 -39
  22. package/css/codemirror/abbott.css +0 -268
  23. package/css/codemirror/abcdef.css +0 -32
  24. package/css/codemirror/ambiance-mobile.css +0 -5
  25. package/css/codemirror/ambiance.css +0 -74
  26. package/css/codemirror/ayu-dark.css +0 -44
  27. package/css/codemirror/ayu-mirage.css +0 -45
  28. package/css/codemirror/base16-dark.css +0 -40
  29. package/css/codemirror/base16-light.css +0 -38
  30. package/css/codemirror/bespin.css +0 -34
  31. package/css/codemirror/blackboard.css +0 -32
  32. package/css/codemirror/cobalt.css +0 -25
  33. package/css/codemirror/colorforth.css +0 -33
  34. package/css/codemirror/darcula.css +0 -53
  35. package/css/codemirror/dracula.css +0 -40
  36. package/css/codemirror/duotone-dark.css +0 -35
  37. package/css/codemirror/duotone-light.css +0 -36
  38. package/css/codemirror/eclipse.css +0 -23
  39. package/css/codemirror/elegant.css +0 -13
  40. package/css/codemirror/erlang-dark.css +0 -34
  41. package/css/codemirror/gruvbox-dark.css +0 -39
  42. package/css/codemirror/hopscotch.css +0 -34
  43. package/css/codemirror/icecoder.css +0 -43
  44. package/css/codemirror/idea.css +0 -42
  45. package/css/codemirror/isotope.css +0 -34
  46. package/css/codemirror/juejin.css +0 -30
  47. package/css/codemirror/lesser-dark.css +0 -47
  48. package/css/codemirror/liquibyte.css +0 -95
  49. package/css/codemirror/lucario.css +0 -37
  50. package/css/codemirror/material-darker.css +0 -135
  51. package/css/codemirror/material-ocean.css +0 -141
  52. package/css/codemirror/material-palenight.css +0 -141
  53. package/css/codemirror/material.css +0 -141
  54. package/css/codemirror/mbo.css +0 -37
  55. package/css/codemirror/mdn-like.css +0 -46
  56. package/css/codemirror/midnight.css +0 -39
  57. package/css/codemirror/monokai.css +0 -41
  58. package/css/codemirror/moxer.css +0 -143
  59. package/css/codemirror/neat.css +0 -12
  60. package/css/codemirror/neo.css +0 -43
  61. package/css/codemirror/night.css +0 -27
  62. package/css/codemirror/nord.css +0 -42
  63. package/css/codemirror/oceanic-next.css +0 -46
  64. package/css/codemirror/panda-syntax.css +0 -85
  65. package/css/codemirror/paraiso-dark.css +0 -38
  66. package/css/codemirror/paraiso-light.css +0 -38
  67. package/css/codemirror/pastel-on-dark.css +0 -52
  68. package/css/codemirror/railscasts.css +0 -34
  69. package/css/codemirror/rubyblue.css +0 -25
  70. package/css/codemirror/seti.css +0 -44
  71. package/css/codemirror/shadowfox.css +0 -52
  72. package/css/codemirror/solarized.css +0 -168
  73. package/css/codemirror/ssms.css +0 -16
  74. package/css/codemirror/the-matrix.css +0 -30
  75. package/css/codemirror/tomorrow-night-bright.css +0 -35
  76. package/css/codemirror/tomorrow-night-eighties.css +0 -38
  77. package/css/codemirror/ttcn.css +0 -64
  78. package/css/codemirror/twilight.css +0 -32
  79. package/css/codemirror/vibrant-ink.css +0 -34
  80. package/css/codemirror/xq-dark.css +0 -53
  81. package/css/codemirror/xq-light.css +0 -43
  82. package/css/codemirror/yeti.css +0 -44
  83. package/css/codemirror/yonce.css +0 -59
  84. package/css/codemirror/zenburn.css +0 -37
  85. package/dist/pb-message-1a0c0c52.js +0 -1360
  86. package/lib/codemirror/addon/display/placeholder.js +0 -70
  87. package/lib/codemirror/addon/edit/matchbrackets.js +0 -152
  88. package/lib/codemirror/addon/lint/lint.js +0 -282
  89. package/lib/codemirror/mode/css/css.js +0 -855
  90. package/lib/codemirror/mode/stex/stex.js +0 -249
  91. package/lib/codemirror/mode/xml/xml.js +0 -404
  92. package/lib/codemirror/mode/xquery/xquery.js +0 -434
@@ -1,67 +1,67 @@
1
- import{t as e}from"./paper-checkbox-f6a70487.js";import{p as t,L as p,h as o,c as a}from"./pb-mixin-15ff531f.js";import"./iron-form-f540b15b.js";class i extends(t(p)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{error:{type:String},url:{type:String},templates:{type:Array},odds:{type:Array}})}constructor(){super(),this.templates=[],this.odds=[]}connectedCallback(){super.connectedCallback()}firstUpdated(){const e=this.shadowRoot.getElementById("form"),t=this.shadowRoot.getElementById("defaultView"),p=this.shadowRoot.getElementById("index"),o=this.shadowRoot.getElementById("template");this.subscribeTo("pb-i18n-update",e=>{const t=this.shadowRoot.querySelector("#defaultView paper-listbox");let p=t.selected;t.selected=void 0,t.selected=p;const o=this.shadowRoot.querySelector("#index paper-listbox");p=o.selected,o.selected=void 0,o.selected=p},[]),i.waitOnce("pb-page-ready",e=>{let t;t=this.minApiVersion("1.0.0")?e.endpoint+"/api/templates":e.endpoint+"/modules/lib/components-list-templates.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.templates=e}),t=this.minApiVersion("1.0.0")?e.endpoint+"/api/odd":e.endpoint+"/modules/lib/components-list-odds.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.odds=e});const p=this.shadowRoot.querySelector("form");this.minApiVersion("1.0.0")?p.action=e.endpoint+"/api/apps/generate":p.action=e.endpoint+"/modules/components-generate.xql"}),e.addEventListener("iron-form-presubmit",(function(){const e=t.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=p.selectedItem.getAttribute("value"),this.request.body.template=o.selectedItem.getAttribute("value")})),e.addEventListener("iron-form-response",e=>{console.log(e),e.detail.completes.then(e=>{this.emitTo("pb-end-update");const t=e.parseResponse();if(console.log("<pb-edit-app> Received response: %o",t),t.target){const e=window.location.href.replace(/^(.*)\/tei-publisher\/.*/,"$1");this.url=e+"/"+this.shadowRoot.querySelector("paper-input[name=abbrev]").value,this.error=null}else this.error=t.description;this.shadowRoot.getElementById("dialog").open()})}),e.addEventListener("iron-form-error",e=>{this.emitTo("pb-end-update"),console.log("<pb-edit-app> Received response: %o",e.detail.request.response),this.error=e.detail.request.response.description,this.shadowRoot.getElementById("dialog").open()}),e.addEventListener("iron-form-invalid",()=>this.emitTo("pb-end-update"))}_doSubmit(){this.emitTo("pb-start-update");this.shadowRoot.getElementById("form").submit()}render(){return o`
1
+ import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./pb-mixin-15ff531f.js";import{t as i}from"./pb-i18n-6ad23bcf.js";import"./iron-form-9e72ac45.js";class a extends(e(t)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{error:{type:String},url:{type:String},templates:{type:Array},odds:{type:Array}})}constructor(){super(),this.templates=[],this.odds=[]}connectedCallback(){super.connectedCallback()}firstUpdated(){const e=this.shadowRoot.getElementById("form"),t=this.shadowRoot.getElementById("defaultView"),p=this.shadowRoot.getElementById("index"),o=this.shadowRoot.getElementById("template");this.subscribeTo("pb-i18n-update",e=>{const t=this.shadowRoot.querySelector("#defaultView paper-listbox");let p=t.selected;t.selected=void 0,t.selected=p;const o=this.shadowRoot.querySelector("#index paper-listbox");p=o.selected,o.selected=void 0,o.selected=p},[]),a.waitOnce("pb-page-ready",e=>{let t;t=this.minApiVersion("1.0.0")?e.endpoint+"/api/templates":e.endpoint+"/modules/lib/components-list-templates.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.templates=e}),t=this.minApiVersion("1.0.0")?e.endpoint+"/api/odd":e.endpoint+"/modules/lib/components-list-odds.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.odds=e});const p=this.shadowRoot.querySelector("form");this.minApiVersion("1.0.0")?p.action=e.endpoint+"/api/apps/generate":p.action=e.endpoint+"/modules/components-generate.xql"}),e.addEventListener("iron-form-presubmit",(function(){const e=t.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=p.selectedItem.getAttribute("value"),this.request.body.template=o.selectedItem.getAttribute("value")})),e.addEventListener("iron-form-response",e=>{console.log(e),e.detail.completes.then(e=>{this.emitTo("pb-end-update");const t=e.parseResponse();if(console.log("<pb-edit-app> Received response: %o",t),t.target){const e=window.location.href.replace(/^(.*)\/tei-publisher\/.*/,"$1");this.url=e+"/"+this.shadowRoot.querySelector("paper-input[name=abbrev]").value,this.error=null}else this.error=t.description;this.shadowRoot.getElementById("dialog").open()})}),e.addEventListener("iron-form-error",e=>{this.emitTo("pb-end-update"),console.log("<pb-edit-app> Received response: %o",e.detail.request.response),this.error=e.detail.request.response.description,this.shadowRoot.getElementById("dialog").open()}),e.addEventListener("iron-form-invalid",()=>this.emitTo("pb-end-update"))}_doSubmit(){this.emitTo("pb-start-update");this.shadowRoot.getElementById("form").submit()}render(){return p`
2
2
  <iron-form id="form">
3
3
  <form method="POST" accept="application/json" enctype="application/json">
4
4
  <fieldset>
5
- <legend>${e("document.selectODD")}</legend>
6
- ${this.odds.map(e=>o`<paper-checkbox name="odd" value="${e.name}">${e.label}</paper-checkbox>`)}
5
+ <legend>${i("document.selectODD")}</legend>
6
+ ${this.odds.map(e=>p`<paper-checkbox name="odd" value="${e.name}">${e.label}</paper-checkbox>`)}
7
7
  </fieldset>
8
8
  <paper-input name="uri" type="url" required placeholder="http://exist-db.org/apps/my-simple-app"
9
- label="${e("appgen.uri")}" auto-validate></paper-input>
10
- <paper-input id="abbrev" name="abbrev" pattern="[a-zA-Z0-9-_]+" required placeholder="${e("appgen.abbrev.placeholder")}"
11
- label="${e("appgen.abbrev.label")}" auto-validate></paper-input>
9
+ label="${i("appgen.uri")}" auto-validate></paper-input>
10
+ <paper-input id="abbrev" name="abbrev" pattern="[a-zA-Z0-9-_]+" required placeholder="${i("appgen.abbrev.placeholder")}"
11
+ label="${i("appgen.abbrev.label")}" auto-validate></paper-input>
12
12
  <paper-input name="data-collection" pattern="[a-zA-Z0-9-_/]+" placeholder="data"
13
- label="${e("appgen.collection")}" auto-validate></paper-input>
14
- <paper-input name="title" required placeholder="${e("appgen.title.label")}"
15
- label="${e("appgen.title.help")}"></paper-input>
13
+ label="${i("appgen.collection")}" auto-validate></paper-input>
14
+ <paper-input name="title" required placeholder="${i("appgen.title.label")}"
15
+ label="${i("appgen.title.help")}"></paper-input>
16
16
  <fieldset>
17
- <legend>${e("appgen.template.help")}</legend>
18
- <paper-dropdown-menu id="template" label="${e("appgen.template.label")}" name="template">
17
+ <legend>${i("appgen.template.help")}</legend>
18
+ <paper-dropdown-menu id="template" label="${i("appgen.template.label")}" name="template">
19
19
  <paper-listbox slot="dropdown-content" class="dropdown-content" attr-for-selected="value" selected="view.html">
20
- ${this.templates.map(e=>o`<paper-item value="${e.name}">${e.title}</paper-item>`)}
20
+ ${this.templates.map(e=>p`<paper-item value="${e.name}">${e.title}</paper-item>`)}
21
21
  </paper-listbox>
22
22
  </paper-dropdown-menu>
23
23
  </fieldset>
24
24
  <fieldset>
25
- <legend>${e("appgen.view.help")}</legend>
26
- <paper-dropdown-menu id="defaultView" label="${e("appgen.label")}" name="default-view">
25
+ <legend>${i("appgen.view.help")}</legend>
26
+ <paper-dropdown-menu id="defaultView" label="${i("appgen.label")}" name="default-view">
27
27
  <paper-listbox slot="dropdown-content" class="dropdown-content" selected="div" attr-for-selected="value">
28
- <paper-item value="div">${e("appgen.view.div")}</paper-item>
29
- <paper-item value="page">${e("appgen.view.page")}</paper-item>
28
+ <paper-item value="div">${i("appgen.view.div")}</paper-item>
29
+ <paper-item value="page">${i("appgen.view.page")}</paper-item>
30
30
  </paper-listbox>
31
31
  </paper-dropdown-menu>
32
32
  </fieldset>
33
33
  <fieldset>
34
- <legend>${e("appgen.index.help")}</legend>
35
- <paper-dropdown-menu id="index" label="${e("appgen.index.label")}" name="index">
34
+ <legend>${i("appgen.index.help")}</legend>
35
+ <paper-dropdown-menu id="index" label="${i("appgen.index.label")}" name="index">
36
36
  <paper-listbox slot="dropdown-content" class="dropdown-content" selected="tei:div" attr-for-selected="value">
37
- <paper-item value="tei:div">${e("appgen.index.index-div")}</paper-item>
38
- <paper-item value="tei:text">${e("appgen.index.index-text")}</paper-item>
37
+ <paper-item value="tei:div">${i("appgen.index.index-div")}</paper-item>
38
+ <paper-item value="tei:text">${i("appgen.index.index-text")}</paper-item>
39
39
  </paper-listbox>
40
40
  </paper-dropdown-menu>
41
41
  </fieldset>
42
42
  <fieldset>
43
- <legend>${e("appgen.account.user")}</legend>
44
- <paper-input name="owner" required placeholder="${e("login.user")}"
45
- label="${e("appgen.account.owner")}" auto-validate></paper-input>
46
- <paper-input name="password" type="password" required placeholder="${e("login.password")}"
47
- label="${e("appgen.account.password")}" auto-validate></paper-input>
43
+ <legend>${i("appgen.account.user")}</legend>
44
+ <paper-input name="owner" required placeholder="${i("login.user")}"
45
+ label="${i("appgen.account.owner")}" auto-validate></paper-input>
46
+ <paper-input name="password" type="password" required placeholder="${i("login.password")}"
47
+ label="${i("appgen.account.password")}" auto-validate></paper-input>
48
48
  </fieldset>
49
- <paper-button id="submit" @click="${this._doSubmit}"><iron-icon icon="save"></iron-icon> ${e("appgen.submit")}</paper-button>
49
+ <paper-button id="submit" @click="${this._doSubmit}"><iron-icon icon="save"></iron-icon> ${i("appgen.submit")}</paper-button>
50
50
  </form>
51
51
  </iron-form>
52
52
  <paper-dialog id="dialog">
53
- <h2>${e("appgen.dialog.title")}</h2>
53
+ <h2>${i("appgen.dialog.title")}</h2>
54
54
  <div id="dialogContent">
55
- ${this.error?o`<div id="error">${this.error}</div>`:o`<a href="${this.url}" target="_blank">
56
- <paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${e("appgen.open")}</paper-button>
55
+ ${this.error?p`<div id="error">${this.error}</div>`:p`<a href="${this.url}" target="_blank">
56
+ <paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${i("appgen.open")}</paper-button>
57
57
  </a>
58
- <p>${e("appgen.success")}</p>`}
58
+ <p>${i("appgen.success")}</p>`}
59
59
  </div>
60
60
  <div class="buttons">
61
- <paper-button dialog-dismiss autofocus>${e("dialogs.close")}</paper-button>
61
+ <paper-button dialog-dismiss autofocus>${i("dialogs.close")}</paper-button>
62
62
  </div>
63
63
  </paper-dialog>
64
- `}static get styles(){return a`
64
+ `}static get styles(){return o`
65
65
  :host {
66
66
  display: block;
67
67
  }
@@ -107,4 +107,4 @@ import{t as e}from"./paper-checkbox-f6a70487.js";import{p as t,L as p,h as o,c a
107
107
  display: block;
108
108
  flex: 1 0;
109
109
  }
110
- `}}customElements.define("pb-edit-app",i);export{i as PbEditApp};
110
+ `}}customElements.define("pb-edit-app",a);export{a as PbEditApp};
@@ -1875,7 +1875,7 @@
1875
1875
  {
1876
1876
  "name": "pb-code-editor",
1877
1877
  "path": "./src/pb-code-editor.js",
1878
- "description": "A wrapper for the popular codemirror code editor.",
1878
+ "description": "A code editor based on codemirror 6. Provides a wrapper around\n[@jinntec/jinn-codemirror](https://github.com/JinnElements/jinn-codemirror),\nmainly for backwards compatibility.",
1879
1879
  "attributes": [
1880
1880
  {
1881
1881
  "name": "code",
@@ -1887,7 +1887,7 @@
1887
1887
  "name": "mode",
1888
1888
  "description": "the language mode e.g. 'javascript' or 'xquery'.",
1889
1889
  "type": "string",
1890
- "default": "\"javascript\""
1890
+ "default": "\"xml\""
1891
1891
  },
1892
1892
  {
1893
1893
  "name": "placeholder",
@@ -1912,13 +1912,35 @@
1912
1912
  "default": "\"\""
1913
1913
  },
1914
1914
  {
1915
- "name": "theme",
1915
+ "name": "subscribe",
1916
+ "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
1916
1917
  "type": "string"
1917
1918
  },
1918
1919
  {
1919
- "name": "apiVersion",
1920
- "type": "string",
1921
- "default": "\"0.9.0\""
1920
+ "name": "subscribe-config",
1921
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to listen to.",
1922
+ "type": "object"
1923
+ },
1924
+ {
1925
+ "name": "emit",
1926
+ "description": "The name of the channel to send events to.",
1927
+ "type": "string"
1928
+ },
1929
+ {
1930
+ "name": "emit-config",
1931
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to be dispatched.",
1932
+ "type": "object"
1933
+ },
1934
+ {
1935
+ "name": "wait-for",
1936
+ "description": "A selector pointing to other components this component depends on.\nWhen method `wait` is called, it will wait until all referenced\ncomponents signal with a `pb-ready` event that they are ready and listening\nto events.",
1937
+ "type": "string"
1938
+ },
1939
+ {
1940
+ "name": "disabled",
1941
+ "description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
1942
+ "type": "boolean",
1943
+ "default": "false"
1922
1944
  }
1923
1945
  ],
1924
1946
  "properties": [
@@ -1934,7 +1956,7 @@
1934
1956
  "attribute": "mode",
1935
1957
  "description": "the language mode e.g. 'javascript' or 'xquery'.",
1936
1958
  "type": "string",
1937
- "default": "\"javascript\""
1959
+ "default": "\"xml\""
1938
1960
  },
1939
1961
  {
1940
1962
  "name": "placeholder",
@@ -1963,23 +1985,46 @@
1963
1985
  "default": "\"\""
1964
1986
  },
1965
1987
  {
1966
- "name": "theme",
1967
- "attribute": "theme",
1988
+ "name": "subscribe",
1989
+ "attribute": "subscribe",
1990
+ "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
1968
1991
  "type": "string"
1969
1992
  },
1970
1993
  {
1971
- "name": "apiVersion",
1972
- "attribute": "apiVersion",
1973
- "type": "string",
1974
- "default": "\"0.9.0\""
1994
+ "name": "subscribeConfig",
1995
+ "attribute": "subscribe-config",
1996
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to listen to.",
1997
+ "type": "object"
1998
+ },
1999
+ {
2000
+ "name": "emit",
2001
+ "attribute": "emit",
2002
+ "description": "The name of the channel to send events to.",
2003
+ "type": "string"
2004
+ },
2005
+ {
2006
+ "name": "emitConfig",
2007
+ "attribute": "emit-config",
2008
+ "description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to be dispatched.",
2009
+ "type": "object"
2010
+ },
2011
+ {
2012
+ "name": "waitFor",
2013
+ "attribute": "wait-for",
2014
+ "description": "A selector pointing to other components this component depends on.\nWhen method `wait` is called, it will wait until all referenced\ncomponents signal with a `pb-ready` event that they are ready and listening\nto events.",
2015
+ "type": "string"
2016
+ },
2017
+ {
2018
+ "name": "disabled",
2019
+ "attribute": "disabled",
2020
+ "description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
2021
+ "type": "boolean",
2022
+ "default": "false"
1975
2023
  }
1976
2024
  ],
1977
2025
  "events": [
1978
2026
  {
1979
2027
  "name": "code-changed"
1980
- },
1981
- {
1982
- "name": "linting-error"
1983
2028
  }
1984
2029
  ]
1985
2030
  },
@@ -0,0 +1 @@
1
+ import{d as t,L as e,N as n,A as s}from"./pb-mixin-15ff531f.js";const i=new Map;let a;function r(t){a=t}function o(t){return t instanceof n?t.startNode.isConnected:t instanceof s?t.committer.element.isConnected:t.element.isConnected}function c(){Object.keys(i).forEach(t=>{o(t)||i.delete(t)})}function l(t){"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t)}function d(t,e){const n=e();t.value!==n&&(t.setValue(n),t.commit())}function u(t){a=t.t,i.forEach((t,e)=>{o(e)&&d(e,t)})}function p(t,e){return a?a(t,e):t}const h=t(t=>e=>{i.set(e,t),d(e,t)}),f=(t,e)=>h(()=>p(t,e));document.addEventListener("pb-i18n-update",t=>{u(t.detail)}),setInterval(()=>l(()=>c()),6e4);class b extends e{static get properties(){return Object.assign(Object.assign({},super.properties),{},{key:{type:String},options:{type:Object},_translated:{type:String}})}constructor(){super(),this.key="missing-key",this.options=null,this._translated=null}connectedCallback(){super.connectedCallback(),this._fallback=this.innerHTML,document.addEventListener("pb-i18n-update",this._translate.bind(this)),this._translate()}_translate(){const t=p(this.key,this.options);t&&t!==this.key?this._translated=t:this._translated=null}render(){return this._translated?this._translated:this._fallback}createRenderRoot(){return this}}customElements.define("pb-i18n",b);export{p as g,r as i,f as t};