@pie-element/passage 7.4.3 → 8.0.0-next.20261002094057

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 (109) hide show
  1. package/author.js +2 -0
  2. package/configure.js +2 -0
  3. package/controller.js +1 -0
  4. package/dist/author/common.d.ts +36 -0
  5. package/dist/author/common.js +57 -0
  6. package/dist/author/defaults.d.ts +175 -0
  7. package/dist/author/defaults.js +113 -0
  8. package/dist/author/design.d.ts +28 -0
  9. package/dist/author/design.js +120 -0
  10. package/dist/author/index.d.ts +36 -0
  11. package/dist/author/index.js +66 -0
  12. package/dist/author/passage.d.ts +27 -0
  13. package/dist/author/passage.js +127 -0
  14. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  15. package/dist/browser/author/index.js +34161 -0
  16. package/dist/browser/author/index.js.map +1 -0
  17. package/dist/browser/controller/index.js +64 -0
  18. package/dist/browser/controller/index.js.map +1 -0
  19. package/dist/browser/delivery/index.js +117 -0
  20. package/dist/browser/delivery/index.js.map +1 -0
  21. package/dist/browser/dist-BtyOUh0E.js +9737 -0
  22. package/dist/browser/dist-BtyOUh0E.js.map +1 -0
  23. package/dist/browser/dist-CiWlBjsz.js +92 -0
  24. package/dist/browser/dist-CiWlBjsz.js.map +1 -0
  25. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  26. package/dist/browser/editor-runtime/author/index.js +17752 -0
  27. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  28. package/dist/browser/editor-runtime/controller/index.js +64 -0
  29. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  30. package/dist/browser/editor-runtime/delivery/index.js +117 -0
  31. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  32. package/dist/browser/editor-runtime/dist-Ba_6pEHz.js +9737 -0
  33. package/dist/browser/editor-runtime/dist-Ba_6pEHz.js.map +1 -0
  34. package/dist/browser/editor-runtime/dist-CiWlBjsz.js +92 -0
  35. package/dist/browser/editor-runtime/dist-CiWlBjsz.js.map +1 -0
  36. package/dist/browser/editor-runtime/print/index.js +51 -0
  37. package/dist/browser/editor-runtime/print/index.js.map +1 -0
  38. package/dist/browser/editor-runtime/rolldown-runtime-CHQKHQ89.js +32 -0
  39. package/dist/browser/editor-runtime/stimulus-tabs-41Y6tEn5.js +256 -0
  40. package/dist/browser/editor-runtime/stimulus-tabs-41Y6tEn5.js.map +1 -0
  41. package/dist/browser/print/index.js +51 -0
  42. package/dist/browser/print/index.js.map +1 -0
  43. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  44. package/dist/browser/stimulus-tabs-DVM_5xjR.js +256 -0
  45. package/dist/browser/stimulus-tabs-DVM_5xjR.js.map +1 -0
  46. package/dist/controller/defaults.d.ts +23 -0
  47. package/dist/controller/defaults.js +17 -0
  48. package/dist/controller/index.d.ts +18 -0
  49. package/dist/controller/index.js +50 -0
  50. package/dist/delivery/index.d.ts +22 -0
  51. package/dist/delivery/index.js +83 -0
  52. package/dist/delivery/stimulus-tabs.d.ts +28 -0
  53. package/dist/delivery/stimulus-tabs.js +257 -0
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.iife.d.ts +8 -0
  56. package/dist/index.iife.js +145 -0
  57. package/dist/index.js +2 -0
  58. package/dist/print/index.d.ts +15 -0
  59. package/dist/print/index.js +49 -0
  60. package/dist/runtime-support.d.ts +12 -0
  61. package/dist/runtime-support.js +12 -0
  62. package/module/print.js +15919 -1
  63. package/module/print.js.map +1 -0
  64. package/package.json +104 -20
  65. package/print.js +2 -0
  66. package/CHANGELOG.json +0 -227
  67. package/CHANGELOG.md +0 -1548
  68. package/LICENSE.md +0 -5
  69. package/README.md +0 -3
  70. package/configure/CHANGELOG.md +0 -752
  71. package/configure/lib/common.js +0 -74
  72. package/configure/lib/common.js.map +0 -1
  73. package/configure/lib/defaults.js +0 -174
  74. package/configure/lib/defaults.js.map +0 -1
  75. package/configure/lib/design.js +0 -185
  76. package/configure/lib/design.js.map +0 -1
  77. package/configure/lib/index.js +0 -87
  78. package/configure/lib/index.js.map +0 -1
  79. package/configure/lib/passage.js +0 -194
  80. package/configure/lib/passage.js.map +0 -1
  81. package/configure/package.json +0 -23
  82. package/controller/CHANGELOG.json +0 -1
  83. package/controller/CHANGELOG.md +0 -121
  84. package/controller/lib/defaults.js +0 -23
  85. package/controller/lib/defaults.js.map +0 -1
  86. package/controller/lib/index.js +0 -80
  87. package/controller/lib/index.js.map +0 -1
  88. package/controller/package.json +0 -13
  89. package/docs/config-schema.json +0 -1325
  90. package/docs/config-schema.json.md +0 -974
  91. package/docs/demo/config.js +0 -8
  92. package/docs/demo/generate.js +0 -32
  93. package/docs/demo/index.html +0 -1
  94. package/docs/pie-schema.json +0 -775
  95. package/docs/pie-schema.json.md +0 -561
  96. package/lib/index.js +0 -144
  97. package/lib/index.js.map +0 -1
  98. package/lib/print.js +0 -78
  99. package/lib/print.js.map +0 -1
  100. package/lib/stimulus-tabs.js +0 -451
  101. package/lib/stimulus-tabs.js.map +0 -1
  102. package/module/configure.js +0 -1
  103. package/module/controller.js +0 -920
  104. package/module/demo.js +0 -57
  105. package/module/element.js +0 -1
  106. package/module/index.html +0 -21
  107. package/module/manifest.json +0 -14
  108. package/module/print-demo.js +0 -95
  109. package/module/print.html +0 -18
package/module/demo.js DELETED
@@ -1,57 +0,0 @@
1
- import Configure from './configure.js';
2
- import Element from './element.js';
3
- import * as controller from './controller.js';
4
-
5
- var generate = {};
6
-
7
- generate.model = (id, element) => ({
8
- id,
9
- element,
10
- passages: [
11
- {
12
- teacherInstructions: 'Teacher instructions for first tab',
13
- title: 'Hope Is the Thing with Feathers',
14
- subtitle: 'from <em>The Complete Poems of Emily Dickinson</em>',
15
- author: 'by Emily Dickinson',
16
- text: '<p><font style="visibility:hidden">00000</font>Hope is the thing with feathers<br /><font style="visibility:hidden">00000</font>That perches in the soul,<br /><font style="visibility:hidden">00000</font>And sings the tune without the words,<br /><font style="visibility:hidden">00000</font>And never stops at all,</p><p>5<font style="visibility:hidden">0000</font>And sweetest in the gale is heard;<br /><font style="visibility:hidden">00000</font>And sore must be the storm<br /><font style="visibility:hidden">00000</font>That could abash the little bird<br /><font style="visibility:hidden">00000</font>That kept so many warm.</p><p><font style="visibility:hidden">00000</font>I&#8217;ve heard it in the chillest land,<br />10<font style="visibility:hidden">000</font>And on the strangest sea;<br /><font style="visibility:hidden">00000</font>Yet, never, in extremity,<br /><font style="visibility:hidden">00000</font>It asked a crumb of me.</p>',
17
- },
18
- {
19
- title: 'Ineskeen Road, July Evening',
20
- text: `The bicycles go by in twos and threes -<br/>
21
- There's a dance in Billy Brennan's barn tonight,<br/>
22
- And there's the half-talk code of mysteries<br/>
23
- And the wink-and-elbow language of delight.<br/>
24
- Half-past eight and there is not a spot<br/>
25
- Upon a mile of road, no shadow thrown<br/>
26
- That might turn out a man or woman, not<br/>
27
- A footfall tapping secrecies of stone. <br/>
28
- <p/>
29
- I have what every poet hates in spite<br/>
30
- Of all the solemn talk of contemplation.<br/>
31
- Oh, Alexander Selkirk knew the plight<br/>
32
- Of being king and government and nation.<br/>
33
- A road, a mile of kingdom. I am king<br/>
34
- Of banks and stones and every blooming thing.<br/>
35
- `,
36
- },
37
- ],
38
- });
39
-
40
- const { model } = generate;
41
-
42
- var config = {
43
- elements: {
44
- 'passage-element': '../..',
45
- },
46
- models: [model('1', 'passage-element')],
47
- };
48
-
49
- //Note: demo-el is a custom element loaded in the markup.
50
- customElements.whenDefined("demo-el").then(() => {
51
- config.models.forEach((m) => {
52
- const de = document.createElement("demo-el");
53
- document.body.appendChild(de);
54
- de.def = { tagName: m.element, Element, Configure, controller };
55
- de.model = m;
56
- });
57
- });
package/module/element.js DELETED
@@ -1 +0,0 @@
1
- import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as i,_dll_react_dom as r,_dll_mui__material_colors as s,_dll_mui__material as o,_dll_debug as a,_dll_mui__material_collapse as l,_dll_react_dom_client as c}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";var d={};Object.defineProperty(d,"__esModule",{value:!0});class p extends CustomEvent{constructor(e,t,n){super(p.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}p.TYPE="model-set";var h=d.ModelSetEvent=p;class u extends CustomEvent{constructor(e,t){super(u.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}u.TYPE="session-changed",d.SessionChangedEvent=u;const m=n,f=t,g=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",E=({size:e,children:t})=>{const n={height:e=g(e),width:e,display:"inline-block",position:"relative"};return m.createElement("div",{style:n},t)};E.propTypes={size:f.number,children:f.oneOfType([f.arrayOf(f.node),f.node]).isRequired};const b=n,y=t,v=({size:e,children:t,sx:n})=>b.createElement(E,{size:e},b.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));v.propTypes={size:y.oneOfType([y.string,y.number]),children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired,sx:y.object},y.string.isRequired;const x=({fill:e})=>b.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});x.propTypes={fill:y.string.isRequired};const C=({fill:e})=>b.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});C.propTypes={fill:y.string.isRequired};const _=({fill:e})=>b.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});_.propTypes={fill:y.string.isRequired};const R=({fill:e})=>b.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});R.propTypes={fill:y.string.isRequired};const k=t,O=n;var T=(e,t)=>{class n extends O.Component{static __initStatic(){this.propTypes={iconSet:k.oneOf(["emoji","check"]),shape:k.oneOf(["round","square"]),category:k.oneOf(["feedback",void 0]),open:k.bool,size:k.oneOfType([k.number,k.string]),fg:k.string,bg:k.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:i,category:r,open:s,size:o,fg:a,bg:l}=this.props,c="check"===n?O.createElement(e,{fill:a}):O.createElement(t,{fill:a}),d="check"===n?O.createElement(e,{fill:l}):O.createElement(t,{fill:l});return s?O.createElement(v,{size:o},d):O.createElement(v,{size:o},"feedback"===r?"round"===i?O.createElement(C,{fill:l}):O.createElement(x,{fill:l}):"round"===i?O.createElement(_,{fill:l}):O.createElement(R,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const S=t,A=n,M=({fill:e})=>A.createElement("g",{transform:"translate(1, 0)"},A.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),A.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),A.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));M.propTypes={fill:S.string.isRequired};const N=({fill:e,x:t=0,y:n=0})=>A.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});N.propTypes={fill:S.string.isRequired,x:S.number,y:S.number};const D=T(N,M);D.propTypes={iconSet:S.oneOf(["emoji","check"]),shape:S.oneOf(["round","square"]),category:S.oneOf(["feedback",void 0]),open:S.bool,fg:S.string,bg:S.string,size:S.oneOfType([S.string,S.number])},D.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const w=t,{styled:L}=i;w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,w.string.isRequired,L("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),w.bool,w.string;const F=t,B=n,I=({fill:e})=>B.createElement("g",{transform:"translate(0.5, 0.5)"},B.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),B.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));I.propTypes={fill:F.string.isRequired};const z=({fill:e})=>B.createElement("g",{transform:"translate(1,0)"},B.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));z.propTypes={fill:F.string.isRequired};const P=T(I,z);P.propTypes={iconSet:F.oneOf(["emoji","check"]),shape:F.oneOf(["round","square"]),category:F.oneOf(["feedback",void 0]),open:F.bool,fg:F.string,bg:F.string,size:F.oneOfType([F.string,F.number])},P.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const q=t,j=n,H=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return j.createElement("g",null,j.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),j.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),j.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},W=({children:e,size:t})=>j.createElement(E,{size:t},j.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));W.propTypes={children:q.oneOfType([q.arrayOf(q.node),q.node]).isRequired,size:q.number};const $=()=>j.createElement("g",null,j.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),j.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),j.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),Y=()=>j.createElement("g",null,j.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),j.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),j.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),j.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class U extends j.Component{constructor(e){super(e)}render(){return!0===this.props.open?j.createElement(W,null,j.createElement($,null),j.createElement(H,null)):j.createElement(W,null,j.createElement(Y,null),j.createElement(H,null))}}U.propTypes={open:q.bool},U.defaultProps={open:!1};const G=t,K=n,J=({fill:e})=>K.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});J.propTypes={fill:G.string};class V extends K.Component{static __initStatic(){this.propTypes={classes:G.object.isRequired,size:G.number}}render(){const{size:e}=this.props;return!0===this.props.open?K.createElement(E,{size:e},K.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},K.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),K.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),K.createElement(J,{fill:"#1A9CFF"}))):K.createElement(E,{size:e},K.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},K.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),K.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),K.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",K.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),K.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),K.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),K.createElement(J,{fill:"1A9CFF"})))}}V.__initStatic(),V.propTypes={open:G.bool},V.defaultProps={open:!1};const X=t,Z=n,Q=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),Z.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Q.propTypes={fill:X.string.isRequired};const ee=({fill:e})=>Z.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});ee.propTypes={fill:X.string.isRequired};const te=({fill:e})=>Z.createElement("g",null,Z.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),Z.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),Z.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));te.propTypes={fill:X.string.isRequired};class ne extends Z.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),feedback:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),square:{check:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(Q,{fill:t})),emoji:Z.createElement(v,null,Z.createElement(ee,{fill:n}),Z.createElement(te,{fill:t})),open:{check:Z.createElement(v,null,Z.createElement(Q,{fill:n})),emoji:Z.createElement(v,null,Z.createElement(te,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:i}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===i?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}ne.propTypes={iconSet:X.oneOf(["emoji","check",void 0]),shape:X.oneOf(["square",void 0]),category:X.oneOf(["feedback",void 0]),open:X.bool,fg:X.string,bg:X.string},ne.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const ie=t,re=n,se=({fill:e})=>re.createElement("g",{transform:"translate(0, 0)"},re.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),re.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));se.propTypes={fill:ie.string.isRequired};const oe=({fill:e})=>re.createElement("g",{transform:"translate(2, 0)"},re.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),re.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),re.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));oe.propTypes={fill:ie.string.isRequired};const ae=T(se,oe);ae.propTypes={iconSet:ie.oneOf(["emoji","check"]),shape:ie.oneOf(["round","square"]),category:ie.oneOf(["feedback",void 0]),open:ie.bool,fg:ie.string,bg:ie.string,size:ie.oneOfType([ie.string,ie.number])},ae.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const le=t,ce=n,de=({fill:e})=>ce.createElement("g",null,ce.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),ce.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));de.propTypes={fill:le.string.isRequired};const pe=({fill:e})=>ce.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});pe.propTypes={fill:le.string.isRequired};const he=({fill:e="#FFFFFF"})=>ce.createElement("g",null,ce.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),ce.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));he.propTypes={fill:le.string};const ue=({children:e,size:t})=>{const n=g(t),i={height:n,width:n,display:"inline-block",position:"relative"};return ce.createElement("div",{style:i},ce.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};ue.propTypes={children:le.oneOfType([le.arrayOf(le.node),le.node]).isRequired,size:le.oneOfType([le.string,le.number])};class me extends ce.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,s=ce.createElement(de,{fill:n}),o={check:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement(he,null),s,ce.createElement(pe,{fill:r})),open:{check:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:"#FFFFFF"})),emoji:ce.createElement(ue,{size:this.props.size},ce.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ce.createElement(de,{fill:i}),ce.createElement(pe,{fill:r}))}};return!0===t?o.open[e]:o[e]}}function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fe.apply(null,arguments)}function ge(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function Ee(e,t){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ee(e,t)}function be(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ee(e,t)}function ye(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}me.propTypes={iconSet:le.oneOf(["emoji","check"]),open:le.bool,fg:le.string,bg:le.string,border:le.string,size:le.oneOfType([le.string,le.number])},me.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var ve=!1;var xe=n.createContext(null),Ce=function(e){return e.scrollTop};const _e=n,Re=r;var ke="unmounted",Oe="exited",Te="entering",Se="entered",Ae="exiting",Me=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,s=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?s?(r=Oe,i.appearStatus=Te):r=Se:r=t.unmountOnExit||t.mountOnEnter?ke:Oe,i.state={status:r},i.nextCallback=null,i}be(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ke?{status:Oe}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Te&&n!==Se&&(t=Te):n!==Te&&n!==Se||(t=Ae)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Te){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this);n&&Ce(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Oe&&this.setState({status:ke})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[Re.findDOMNode(this),i],s=r[0],o=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||ve?this.safeSetState({status:Se},function(){t.props.onEntered(s)}):(this.props.onEnter(s,o),this.safeSetState({status:Te},function(){t.props.onEntering(s,o),t.onTransitionEnd(l,function(){t.safeSetState({status:Se},function(){t.props.onEntered(s,o)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:Re.findDOMNode(this);t&&!ve?(this.props.onExit(i),this.safeSetState({status:Ae},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Oe},function(){e.props.onExited(i)})})})):this.safeSetState({status:Oe},function(){e.props.onExited(i)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=r[0],o=r[1];this.props.addEndListener(s,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ke)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var i=ge(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return _e.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,i):_e.cloneElement(_e.Children.only(n),i))},t}(_e.Component);function Ne(){}Me.contextType=xe,Me.propTypes={},Me.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ne,onEntering:Ne,onEntered:Ne,onExit:Ne,onExiting:Ne,onExited:Ne},Me.UNMOUNTED=ke,Me.EXITED=Oe,Me.ENTERING=Te,Me.ENTERED=Se,Me.EXITING=Ae;var De=Me;const we=n;var Le=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i})},Fe=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=ye(n.className,i):n.setAttribute("class",ye(n.className&&n.className.baseVal||"",i)));var n,i})},Be=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1];t.removeClasses(r,"exit"),t.addClass(r,s?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.addClass(r,s,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.removeClasses(r,s),t.addClass(r,s,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:i?r+"-active":n[e+"Active"],doneClassName:i?r+"-done":n[e+"Done"]}},t}be(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(i+=" "+r),"active"===n&&e&&Ce(e),i&&(this.appliedClasses[t][n]=i,Le(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,s=n.done;this.appliedClasses[t]={},i&&Fe(e,i),r&&Fe(e,r),s&&Fe(e,s)},n.render=function(){var e=this.props;e.classNames;var t=ge(e,["classNames"]);return we.createElement(De,fe({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(we.Component);Be.defaultProps={classNames:""},Be.propTypes={};var Ie=Be;const{Children:ze}=n,{cloneElement:Pe}=n,{isValidElement:qe}=n;function je(e,t){var n=Object.create(null);return e&&ze.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&qe(e)?t(e):e}(e)}),n}function He(e,t,n){return null!=n[t]?n[t]:e.props[t]}function We(e,t,n){var i=je(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,r=Object.create(null),s=[];for(var o in e)o in t?s.length&&(r[o]=s,s=[]):s.push(o);var a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<s.length;i++)a[s[i]]=n(s[i]);return a}(t,i);return Object.keys(r).forEach(function(s){var o=r[s];if(qe(o)){var a=s in t,l=s in i,c=t[s],d=qe(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&qe(c)&&(r[s]=Pe(o,{onExited:n.bind(null,o),in:c.props.in,exit:He(o,"exit",e),enter:He(o,"enter",e)})):r[s]=Pe(o,{in:!1}):r[s]=Pe(o,{onExited:n.bind(null,o),in:!0,exit:He(o,"exit",e),enter:He(o,"enter",e)})}}),r}const $e=n;var Ye=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Ue=function(e){function t(t,n){var i,r=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},i}be(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,r=t.children,s=t.handleExited;return{children:t.firstRender?(n=e,i=s,je(n.children,function(e){return Pe(e,{onExited:i.bind(null,e),in:!0,appear:He(e,"appear",n),enter:He(e,"enter",n),exit:He(e,"exit",n)})})):We(e,r,s),firstRender:!1}},n.handleExited=function(e,t){var n=je(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=fe({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=ge(e,["component","childFactory"]),r=this.state.contextValue,s=Ye(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?$e.createElement(xe.Provider,{value:r},s):$e.createElement(xe.Provider,{value:r},$e.createElement(t,i,s))},t}($e.Component);Ue.propTypes={},Ue.defaultProps={component:"div",childFactory:function(e){return e}};var Ge=Ue;const{green:Ke}=s,{indigo:Je}=s,{orange:Ve}=s,{pink:Xe}=s,{red:Ze}=s,Qe={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:Ke[500],CORRECT_SECONDARY:Ke[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:Ve[500],INCORRECT_SECONDARY:Ze[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:Ze[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:Je[500],PRIMARY_LIGHT:Je[200],PRIMARY_DARK:Je[800],SECONDARY:Xe.A400,SECONDARY_LIGHT:Xe[200],SECONDARY_DARK:Xe[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",TABLE_GRID:"black",TABLE_GRID_LIGHT:"#dfe2e5",TABLE_STRIPE:"#f6f8fa",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BUTTON_FOCUS_OUTLINE:"#3B82F6",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",KEY_BOARD_FOCUS_INDICATOR:"#2B87FF",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Qe);const et=(tt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${tt}-${t}, ${e})`,t)});var tt;const nt=()=>et("text",Qe.TEXT),it=()=>et("background",Qe.BACKGROUND),rt=()=>et("border-gray",Qe.BORDER_GRAY),st=()=>et("table-stripe","background-dark",Qe.TABLE_STRIPE),ot=n,at=t,{styled:lt}=i,ct=lt("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),dt=lt("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${et("disabled",Qe.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${et("correct",Qe.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${et("incorrect",Qe.INCORRECT)})`}}),pt=lt("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class ht extends ot.Component{constructor(...e){super(...e),ht.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:at.string,feedback:at.string}}__init(){this.nodeRef=ot.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?ot.createElement(Ie,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},ot.createElement(pt,{ref:this.nodeRef},ot.createElement(ct,null,ot.createElement(dt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return ot.createElement("div",null,ot.createElement(Ge,null,this.renderFeedback()))}}ht.__initStatic();const ut=n,mt=t,{Popover:ft}=o,{styled:gt}=i,Et=a("pie-libs:render-ui:response-indicators"),bt=gt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),yt=gt(ft)({cursor:"pointer"}),vt=gt("div")({padding:"0",borderRadius:"4px"}),xt=(e,t)=>{class n extends ut.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Et("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:i}=this.state;return ut.createElement(bt,{hasFeedback:!!n},ut.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},ut.createElement(e,null)),n&&ut.createElement(yt,{PaperComponent:vt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},ut.createElement(ht,{feedback:n,correctness:t})))}}return n.propTypes={feedback:mt.string},n};xt(D,"correct"),xt(P,"incorrect"),xt(ae,"partially-correct"),xt(ne,"nothing-submitted");const Ct=n,{styled:_t}=i,Rt=l,kt=t,{renderMath:Ot}=e,Tt=_t("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),St=_t(Rt)(({theme:e})=>({paddingTop:e.spacing(2)}));class At extends Ct.Component{constructor(...e){super(...e),At.prototype.__init.call(this),At.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:kt.string,children:kt.object,labels:kt.shape({visible:kt.string,hidden:kt.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Ot(this.root)}componentDidUpdate(){Ot(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Ct.createElement("div",{className:n,ref:e=>this.root=e},Ct.createElement("div",{onClick:this.toggleExpanded},Ct.createElement(Tt,null,i)),Ct.createElement(St,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}At.__initStatic(),At.__initStatic2();const{Button:Mt}=o,{styled:Nt}=i;Nt("div")({display:"flex",flexDirection:"column"}),Nt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Nt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Nt(Mt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Dt=n,{createTheme:wt}=i,{styled:Lt}=i,{StyledEngineProvider:Ft}=i,{ThemeProvider:Bt}=i,It=t;const zt=wt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),Pt=Lt("div")({"& table, th, td":{fontSize:"inherit"}});class qt extends Dt.Component{static __initStatic(){this.propTypes={className:It.string,children:It.array,extraCSSRules:It.shape({names:It.arrayOf(It.string),rules:It.string}),fontSizeFactor:It.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),i=t(document.body),r=Math.max(n,i),s=null!=e&&"number"==typeof e?e:1;return 1!==s?{fontSize:r*s+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...s}=i,o=this.computeStyle(n);return Dt.createElement(Ft,{injectFirst:!0},Dt.createElement(Bt,{theme:zt},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Dt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Dt.createElement(Pt,{className:`${t} extraCSSRules`,...s,...o&&{style:o}},e)))}}qt.__initStatic(),qt.__initStatic2();const jt=n,{styled:Ht}=i,Wt=t,$t=Ht(qt)({display:"flex",flexDirection:"column",position:"relative"});class Yt extends jt.Component{static __initStatic(){this.propTypes={ariaLabel:Wt.string,children:Wt.oneOfType([Wt.arrayOf(Wt.node),Wt.node]).isRequired,role:Wt.string,extraCSSRules:Wt.shape({names:Wt.arrayOf(Wt.string),rules:Wt.string}),fontSizeFactor:Wt.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:s}=this.props,o=t?{"aria-label":t,role:n}:{};return jt.createElement($t,{...o,extraCSSRules:i,fontSizeFactor:r,classes:s},e)}}Yt.__initStatic();const Ut=n,Gt=t;class Kt extends Ut.Component{static __initStatic(){this.propTypes={tag:Gt.string,className:Gt.string,html:Gt.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return Ut.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Kt.__initStatic(),Kt.__initStatic2();const{InputLabel:Jt}=o,{FormControl:Vt}=o,Xt=t,{styled:Zt}=i;Zt(Vt)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Zt(Jt)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),Xt.oneOfType([Xt.string,Xt.object]).isRequired,Xt.string,Xt.oneOfType([Xt.arrayOf(Xt.node),Xt.node]).isRequired;const Qt=n,{Component:en}=n,{styled:tn}=i,nn=t,{renderMath:rn}=e,sn=tn("div")(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:"collapse"},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:"solid",borderColor:et("table-grid","text",Qe.TABLE_GRID)},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:st()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:st()},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:nt()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${nt()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),on=/\\embed\{newLine\}\[\]/g;class an extends en{constructor(...e){super(...e),an.prototype.__init.call(this),an.prototype.__init2.call(this)}static __initStatic(){this.propTypes={prompt:nn.string,tagName:nn.string,className:nn.string,onClick:nn.func,defaultClassName:nn.string,autoplayAudioEnabled:nn.bool,customAudioButton:{playImage:nn.string,pauseImage:nn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.promptRef=Qt.createRef()}__init2(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const i=n.querySelector("audio");if(i){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",i.getAttribute("src")),i.removeAttribute("src"),i.setAttribute("id","pie-prompt-audio-player"),i.appendChild(e),t){i.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),i.parentNode.insertBefore(e,i)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),i=document.getElementById("pie-prompt-audio-player");if(e&&i&&i.play().then(()=>{n&&t&&i.addEventListener("ended",s)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},s=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",o),i.addEventListener("pause",a),i.addEventListener("ended",s),this._handlePlayClick=r,this._handleAudioPlay=o,this._handleAudioPause=a,this._handleAudioEnded=s}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=this.promptRef.current;e&&"function"==typeof rn&&rn(e)}alignImages(){const e=this.promptRef.current;if(!e)return;const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",i=e.parentElement;if("DIV"===i.tagName&&"flex"===i.style.display&&"100%"===i.style.width)i.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const r=e.cloneNode(!0);t.appendChild(r),i.replaceChild(t,e)}}}render(){const{prompt:e,tagName:t,className:n,onClick:i,defaultClassName:r}=this.props,s=`${n||""} ${r||""} ${"legend"===t?"legend":""} preview-prompt`.trim();return Qt.createElement(sn,{as:t||"div",ref:this.promptRef,onClick:i,className:s,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(on,"\\newline ")}})}}an.__initStatic(),an.__initStatic2();const ln=t;ln.node,ln.bool;const cn=t,dn=n,pn=e=>dn.createElement(dn.Fragment,null,dn.Children.map(e.children,t=>dn.cloneElement(t,{"data-pie-purpose":e.purpose})));function hn(e="",t=2){if(!e)return e;const n=(new DOMParser).parseFromString(e,"text/html");return n.body.querySelectorAll("[data-heading]").forEach(e=>{const i=e.getAttribute("data-heading")||"",r=parseInt(i.replace("heading",""),10);if(!Number.isFinite(r))return;const s=Math.min(6,Math.max(1,t+r-1)),o=n.createElement(`h${s}`);o.setAttribute("data-heading",i),Array.from(e.attributes).forEach(e=>{"data-heading"!==e.name&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}pn.propTypes={children:cn.node,purpose:cn.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const un=n,mn=t,{Tabs:fn}=o,{Tab:gn}=o,{styled:En}=i;const bn=()=>{if("undefined"==typeof window)return 1;const e=window.outerWidth/window.innerWidth,t=Number.isFinite(e)&&e>0?e:1;return Math.max(.4,Math.min(1,2/t))},yn=En("div")({flexGrow:1,backgroundColor:it(),color:nt(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),vn=En("div")(({theme:e})=>({backgroundColor:it(),color:nt(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),xn=En("div")({fontSize:"1.75rem"}),Cn=En("div")({fontSize:"1.5rem"}),_n=En("div")({fontSize:"1.25rem"}),Rn=En(gn)(({theme:e})=>({background:it(),fontSize:"inherit",fontFamily:"Roboto, sans-serif",color:nt(),borderRadius:`${e.spacing(2)} ${e.spacing(2)} 0 0`,border:`1px solid ${rt()}`,borderBottomWidth:0,minHeight:"56px",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"center",margin:`0 ${e.spacing(1)}`,textTransform:"none",".passage-label":{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",margin:"auto 0",opacity:.7},"&.Mui-selected":{color:nt(),".passage-label":{opacity:1},".passage-label-underline":{backgroundColor:et("tertiary",Qe.TERTIARY)}},"&:hover":{".passage-label-underline":{backgroundColor:et("tertiary-light",Qe.TERTIARY_LIGHT)}},"& .MuiTouchRipple-root":{opacity:.7}})),kn=En("div")(()=>({height:"2px",width:"100%",marginTop:"6px",background:it()}));class On extends un.Component{constructor(...e){super(...e),On.prototype.__init.call(this),On.prototype.__init2.call(this),On.prototype.__init3.call(this),On.prototype.__init4.call(this),On.prototype.__init5.call(this),On.prototype.__init6.call(this),On.prototype.__init7.call(this)}__init(){this.state={activeTab:0,zoomCompensation:bn(),containerWidth:0}}__init2(){this.containerRef=un.createRef()}componentDidMount(){"undefined"!=typeof window&&(window.addEventListener("resize",this.updateZoomCompensation),this.containerRef.current&&"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.updateContainerWidth),this.resizeObserver.observe(this.containerRef.current)),this.updateContainerWidth())}componentWillUnmount(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.updateZoomCompensation),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null))}__init3(){this.updateZoomCompensation=()=>{this.setState({zoomCompensation:bn()})}}__init4(){this.updateContainerWidth=()=>{const e=this.containerRef.current;if(!e)return;const t=e.clientWidth;t!==this.state.containerWidth&&this.setState({containerWidth:t})}}__init5(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init6(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const s=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(s+1)%i.length;break;case"ArrowLeft":r=(s-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=s}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init7(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=un.createElement(an,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:un.createElement(At,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,i=n?Math.min(6,Math.max(1,n)):void 0,r=n?`h${i}`:"h2",s=n?Math.min(6,Math.max(1,i+1)):void 0;return un.createElement(vn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&un.createElement(pn,{purpose:"passage-title"},un.createElement(r,null,un.createElement(xn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&un.createElement(pn,{purpose:"passage-subtitle"},un.createElement(Cn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&un.createElement(pn,{purpose:"passage-author"},un.createElement(_n,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&un.createElement(pn,{purpose:"passage-text"},un.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?hn(e.text,s):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i,zoomCompensation:r,containerWidth:s}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:o}=e||{},a=(t||[]).find(e=>e.id===i),l=s>0?s/t.length:null,c=s>0&&s<=170*t.length;return un.createElement(qt,{extraCSSRules:o},un.createElement(yn,{className:"passages",ref:this.containerRef},n||1===t.length?t.map(e=>this.renderTab(e,n)):un.createElement(un.Fragment,null,un.createElement(fn,{sx:{position:"static","@media (min-width: 841px)":{position:"sticky",top:0,zIndex:1},background:"var(--pie-passage-header-background, rgba(255,255,255,0))",color:nt(),fontFamily:"Roboto, sans-serif",zoom:r,"& .MuiTabs-list":{backgroundColor:`var(--pie-passage-header-background, ${et("background-dark",Qe.BACKGROUND_DARK)})`,borderBottom:`1px solid ${rt()}`},"& .MuiTabs-indicator":{backgroundColor:et("white",Qe.WHITE),marginBottom:"-1px"}},value:i,onChange:this.handleChange},t.map((e,t)=>un.createElement(Rn,{key:e.id,id:`button-${e.id}`,sx:l?{maxWidth:`${l}px`}:void 0,label:un.createElement(un.Fragment,null,un.createElement(pn,{purpose:"passage-label"},c?un.createElement("span",{className:"passage-label"},`Passage ${t+1}`):un.createElement("span",{className:"passage-label",dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),un.createElement(kn,{className:"passage-label-underline"})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),a?this.renderTab(a,n):null)))}}On.propTypes={tabs:mn.arrayOf(mn.shape({id:mn.number.isRequired,label:mn.string.isRequired,title:mn.string.isRequired,subtitle:mn.string,author:mn.string,text:mn.string.isRequired,teacherInstructions:mn.string}).isRequired).isRequired,disabledTabs:mn.bool,model:mn.object,baseHeadingLevel:mn.number};const{renderMath:Tn}=e,Sn=n,{createRoot:An}=c;function Mn(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(n=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=n?n:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var n,i}class Nn extends HTMLElement{constructor(){super(),Nn.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),Tn(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new h(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),n=Sn.createElement(On,{tabs:t,model:this._model,baseHeadingLevel:Mn(this)});this._root||(this._root=An(this)),this._root.render(n),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&(this._root.unmount(),this._root=null)}}export{Nn as default};
package/module/index.html DELETED
@@ -1,21 +0,0 @@
1
-
2
- <!doctype html>
3
- <html>
4
- <head>
5
- <title>@pie-element/passage@7.4.3</title>
6
- <script
7
- type="module"
8
- src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
9
-
10
- <link
11
- href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
12
- rel="stylesheet"
13
- />
14
- <style>
15
- html, body {
16
- font-family: 'Roboto', sans-serif;
17
- }
18
- </style>
19
- <script type="module" src="./demo.js"></script>
20
- </head>
21
- </html>
@@ -1,14 +0,0 @@
1
- {
2
- "name": "@pie-element/passage",
3
- "version": "7.4.3",
4
- "modules": [
5
- {
6
- "name": "@pie-lib/shared-module",
7
- "version": "6.0.0"
8
- },
9
- {
10
- "name": "@pie-lib/math-rendering-module",
11
- "version": "6.0.0"
12
- }
13
- ]
14
- }
@@ -1,95 +0,0 @@
1
- import PrintElement from './print.js';
2
-
3
- var generate = {};
4
-
5
- generate.model = (id, element) => ({
6
- id,
7
- element,
8
- passages: [
9
- {
10
- teacherInstructions: 'Teacher instructions for first tab',
11
- title: 'Hope Is the Thing with Feathers',
12
- subtitle: 'from <em>The Complete Poems of Emily Dickinson</em>',
13
- author: 'by Emily Dickinson',
14
- text: '<p><font style="visibility:hidden">00000</font>Hope is the thing with feathers<br /><font style="visibility:hidden">00000</font>That perches in the soul,<br /><font style="visibility:hidden">00000</font>And sings the tune without the words,<br /><font style="visibility:hidden">00000</font>And never stops at all,</p><p>5<font style="visibility:hidden">0000</font>And sweetest in the gale is heard;<br /><font style="visibility:hidden">00000</font>And sore must be the storm<br /><font style="visibility:hidden">00000</font>That could abash the little bird<br /><font style="visibility:hidden">00000</font>That kept so many warm.</p><p><font style="visibility:hidden">00000</font>I&#8217;ve heard it in the chillest land,<br />10<font style="visibility:hidden">000</font>And on the strangest sea;<br /><font style="visibility:hidden">00000</font>Yet, never, in extremity,<br /><font style="visibility:hidden">00000</font>It asked a crumb of me.</p>',
15
- },
16
- {
17
- title: 'Ineskeen Road, July Evening',
18
- text: `The bicycles go by in twos and threes -<br/>
19
- There's a dance in Billy Brennan's barn tonight,<br/>
20
- And there's the half-talk code of mysteries<br/>
21
- And the wink-and-elbow language of delight.<br/>
22
- Half-past eight and there is not a spot<br/>
23
- Upon a mile of road, no shadow thrown<br/>
24
- That might turn out a man or woman, not<br/>
25
- A footfall tapping secrecies of stone. <br/>
26
- <p/>
27
- I have what every poet hates in spite<br/>
28
- Of all the solemn talk of contemplation.<br/>
29
- Oh, Alexander Selkirk knew the plight<br/>
30
- Of being king and government and nation.<br/>
31
- A road, a mile of kingdom. I am king<br/>
32
- Of banks and stones and every blooming thing.<br/>
33
- `,
34
- },
35
- ],
36
- });
37
-
38
- const { model } = generate;
39
-
40
- var config = {
41
- elements: {
42
- 'passage-element': '../..',
43
- },
44
- models: [model('1', 'passage-element')],
45
- };
46
-
47
- // new init - just shows off print!
48
-
49
- const init = async () => {
50
- console.log('define the element...');
51
- await Promise.all(
52
- config.models.map(async (m) => {
53
- try {
54
- const printTag = `${m.element}-print`;
55
- if (customElements.get(printTag)) {
56
- return true;
57
- } else {
58
- customElements.define(printTag, PrintElement);
59
- await customElements.whenDefined(printTag);
60
- return true;
61
- }
62
- } catch (e) {
63
- return false;
64
- }
65
- })
66
- );
67
-
68
- console.log('now apply the model...');
69
- config.models.forEach((m) => {
70
- const printTag = `${m.element}-print`;
71
- const h3s = document.createElement('h3');
72
- h3s.textContent = 'student mode';
73
- document.body.appendChild(h3s);
74
- const de = document.createElement(printTag);
75
- document.body.appendChild(de);
76
- de.options = {};
77
- de.model = m;
78
-
79
- const h3 = document.createElement('h3');
80
- h3.textContent = 'instructor mode';
81
- document.body.appendChild(h3);
82
- const instr = document.createElement(printTag);
83
- document.body.appendChild(instr);
84
- instr.options = { mode: 'instructor' };
85
- instr.model = JSON.parse(JSON.stringify(m));
86
- });
87
- };
88
-
89
- init()
90
- .then(() => {
91
- console.log('ready');
92
- })
93
- .catch((e) => {
94
- console.error(e);
95
- });
package/module/print.html DELETED
@@ -1,18 +0,0 @@
1
-
2
- <!doctype html>
3
- <html>
4
- <head>
5
- <title>@pie-element/passage@7.4.3</title>
6
- <link
7
- href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
- rel="stylesheet"
9
- />
10
- <style>
11
- html, body {
12
- font-family: 'Roboto', sans-serif;
13
- }
14
- </style>
15
- <script type="module" src="./print-demo.js"></script>
16
- </head>
17
- <body></body>
18
- </html>