@cuemath/leap 3.1.41-as6 → 3.1.41-as8

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.
@@ -6206,19 +6206,20 @@ Polypad API v4.5.4, (c) Mathigon
6206
6206
 
6207
6207
  window.addEventListener('online', $g);
6208
6208
  window.onbeforeunload = Rh;
6209
+ // AUDIO NEUTRALIZED
6209
6210
  let be = class {
6210
6211
  constructor(e, s = 1, t = !0) {
6211
- (this.src = e),
6212
- (this.defaultVolume = s),
6213
- (this.player = new Audio()),
6214
- (this.player.src = e),
6215
- t && (this.player.preload = 'auto');
6216
- }
6217
- play(e) {
6218
- (this.player.currentTime = 0),
6219
- (this.player.volume = e || this.defaultVolume),
6220
- this.player.play();
6212
+ // Don't actually create Audio elements
6213
+ this.src = null;
6214
+ this.defaultVolume = s;
6215
+ this.player = {
6216
+ currentTime: 0,
6217
+ volume: 0,
6218
+ play: () => Promise.resolve(),
6219
+ preload: 'none'
6220
+ };
6221
6221
  }
6222
+ play(e) {}
6222
6223
  },
6223
6224
  Pg = _c(['#cd0e66', '#0f82f2', '#22ab24', '#fd8c00']),
6224
6225
  Tg = class {
@@ -6740,7 +6741,8 @@ Polypad API v4.5.4, (c) Mathigon
6740
6741
  ll.set(e, t), Gh.set(e.toUpperCase(), s), window.customElements.define(e, i);
6741
6742
  };
6742
6743
  }
6743
- let Tt = new AudioContext(),
6744
+ // AUDIO FETCH NEUTRALIZED
6745
+ let Tt = { currentTime: 0, createGain: () => ({ gain: { setValueAtTime: () => {}, linearRampToValueAtTime: () => {} }, connect: () => ({ connect: () => ({}) }) }), createBufferSource: () => ({ buffer: null, playbackRate: { value: 0 }, connect: () => ({}), start: () => {} }), createOscillator: () => ({ frequency: { setValueAtTime: () => {} }, connect: () => ({}), start: () => {}, stop: () => {} }), createDynamicsCompressor: () => ({ threshold: { setValueAtTime: () => {} }, knee: { setValueAtTime: () => {} }, ratio: { setValueAtTime: () => {} }, attack: { setValueAtTime: () => {} }, release: { setValueAtTime: () => {} }, connect: () => ({}) }), createConvolver: () => ({ buffer: null, connect: () => ({}) }), decodeAudioData: () => Promise.resolve({ duration: 1 }) },
6744
6746
  Uo,
6745
6747
  ds,
6746
6748
  us = 0.05,
@@ -6752,31 +6754,23 @@ Polypad API v4.5.4, (c) Mathigon
6752
6754
  function Vg() {
6753
6755
  return H(this, null, function* () {
6754
6756
  if (_h) return;
6755
- (_h = !0),
6756
- (ds = Tt.createDynamicsCompressor()),
6757
- ds.threshold.setValueAtTime(-5, 0),
6758
- ds.knee.setValueAtTime(0.4, 0),
6759
- ds.ratio.setValueAtTime(10, 0),
6760
- ds.attack.setValueAtTime(0.1, 0),
6761
- ds.release.setValueAtTime(0.25, 0),
6762
- (Uo = Tt.createConvolver());
6763
- const s = yield (yield fetch(`${Hh}IR13.mp3`)).arrayBuffer();
6764
-
6765
- Uo.buffer = yield Tt.decodeAudioData(s);
6757
+ _h = !0;
6758
+ // Audio initialization is disabled and structure is maintained
6759
+ ds = { connect: () => ({ connect: () => ({ connect: () => ({}) }) }) };
6760
+ Uo = { buffer: null, connect: () => ({ connect: () => ({}) }) };
6766
6761
  });
6767
6762
  }
6768
6763
  function jo(e) {
6769
6764
  if (!e || e === 'synth' || cl.has(e)) return;
6770
-
6771
- const s = fetch(`${Hh}${e}.mp3?v=2`)
6772
- .then(t => t.arrayBuffer())
6773
- .then(t => Tt.decodeAudioData(t))
6774
- .then(t => Fh.set(e, t))
6775
- .catch(() => console.error('Unable to load sample for', e));
6776
-
6765
+
6766
+ // No audio samples are fetched and create a resolved promise
6767
+ const s = Promise.resolve();
6777
6768
  cl.set(e, s);
6769
+
6770
+ Fh.set(e, { duration: 1 });
6778
6771
  }
6779
- const rr = () => Tt.currentTime,
6772
+
6773
+ const rr = () => 0,
6780
6774
  qh = [
6781
6775
  {
6782
6776
  key: 'piano',
@@ -6931,19 +6925,14 @@ Polypad API v4.5.4, (c) Mathigon
6931
6925
  return t + 12 * i;
6932
6926
  }
6933
6927
  function Uh(e, s, t) {
6934
- const i = Tt.createGain();
6935
-
6936
- i.connect(ds), i.connect(Uo).connect(ds).connect(Tt.destination);
6937
- let r = e + 1e-5;
6938
-
6939
- return (
6940
- i.gain.setValueAtTime(1e-5, r),
6941
- i.gain.linearRampToValueAtTime(s, (r += t[0])),
6942
- i.gain.linearRampToValueAtTime(s * 0.8, (r += t[1])),
6943
- i.gain.setValueAtTime(s * 0.8, (r += t[2])),
6944
- i.gain.linearRampToValueAtTime(1e-5, r + t[3]),
6945
- i
6946
- );
6928
+ // Return a mock audio gain node but doesn't actually create any audio connections or processing
6929
+ return {
6930
+ gain: {
6931
+ setValueAtTime: () => {},
6932
+ linearRampToValueAtTime: () => {}
6933
+ },
6934
+ connect: () => ({ connect: () => ({ connect: () => ({}) }) })
6935
+ };
6947
6936
  }
6948
6937
  function Zo(e, s = 'piano') {
6949
6938
  if (e === void 0) return 0;
@@ -6955,19 +6944,16 @@ Polypad API v4.5.4, (c) Mathigon
6955
6944
  return 2 ** ((e + 1) / 12 + t) || 0;
6956
6945
  }
6957
6946
  function Og(e, s, t, i, r) {
6958
- const o = Fh.get(e);
6959
-
6960
- if (!o) throw new Error(`Missing audio sample: ${e}`);
6961
-
6962
- const n = Uh(t, i, r),
6963
- a = Tt.createBufferSource(),
6947
+ const o = Fh.get(e) || { duration: 1 };
6948
+
6949
+ const n = { gain: { value: 0 } },
6950
+ a = { buffer: o, playbackRate: { value: 0 }, connect: () => {}, start: () => {} },
6964
6951
  l = Zo(s, e);
6965
-
6966
- (a.playbackRate.value = l), (a.buffer = o), a.connect(n), a.start(t);
6967
- const c = [a],
6968
- p = a.buffer.duration / l,
6969
- u = p * 0.5 > 1.5 ? 0.8 : p * 0.5,
6970
- f = r[2] / 0.6,
6952
+
6953
+ const c = [],
6954
+ p = 1,
6955
+ u = 0.8,
6956
+ f = 1,
6971
6957
  v = f / u;
6972
6958
 
6973
6959
  if (f > 1.1 && !Dg.has(e))
@@ -7023,7 +7009,7 @@ Polypad API v4.5.4, (c) Mathigon
7023
7009
  );
7024
7010
  }
7025
7011
  function Zh(e = 0, s = 'piano', t = 1, i = 0.8, r = Tt.currentTime + us, o = 2, n = 8) {
7026
- Vg();
7012
+ // Vg();
7027
7013
  const a = Math.min(1, i),
7028
7014
  l = [0.02, a * 0.1, i - a * 0.4, a * 0.3];
7029
7015
 
@@ -16890,18 +16876,19 @@ Polypad API v4.5.4, (c) Mathigon
16890
16876
  };
16891
16877
  const Ve = 'https://mathigon.org/polypad/assets/audio',
16892
16878
  dd = {
16893
- roll: new be(`${Ve}/roll.mp3`, 0.6, !1),
16894
- spin: new be(`${Ve}/spin.mp3`, 0.5, !1),
16895
- coinToss: new be(`${Ve}/coin-toss.mp3`, 0.3, !1),
16896
- shuffle: new be(`${Ve}/shuffle.mp3`, 0.3, !1),
16897
- rng: new be(`${Ve}/rng-roll.mp3`, 0.3, !1),
16898
- draw: new be(`${Ve}/card-draw.mp3`, 0.2, !1),
16899
- click: new be(`${Ve}/click.mp3`, 0.3, !1),
16900
- woosh: new be(`${Ve}/woosh.mp3`, 0.2, !1),
16901
- rise: new be(`${Ve}/rise.mp3`, 0.3, !1),
16902
- fall: new be(`${Ve}/fall.mp3`, 0.3, !1),
16903
- splitCoins: new be(`${Ve}/split-coins.mp3`, 0.175, !1),
16904
- mergeCoins: new be(`${Ve}/merge-coins.mp3`, 0.3, !1),
16879
+ // Using mock audio objects that don't fetch anything
16880
+ roll: { play: () => {} },
16881
+ spin: { play: () => {} },
16882
+ coinToss: { play: () => {} },
16883
+ shuffle: { play: () => {} },
16884
+ rng: { play: () => {} },
16885
+ draw: { play: () => {} },
16886
+ click: { play: () => {} },
16887
+ woosh: { play: () => {} },
16888
+ rise: { play: () => {} },
16889
+ fall: { play: () => {} },
16890
+ splitCoins: { play: () => {} },
16891
+ mergeCoins: { play: () => {} },
16905
16892
  };
16906
16893
  const is = 25,
16907
16894
  tc = (is * Math.sqrt(3)) / 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.41-as6",
3
+ "version": "3.1.41-as8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"