@opentabs-dev/opentabs-plugin-twitch 0.0.75 → 0.0.76

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.
@@ -14883,21 +14883,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14883
14883
  };
14884
14884
  var src_default = new TwitchPlugin();
14885
14885
 
14886
- // dist/_adapter_entry_076d99d3-40b4-463e-9ce2-53dcd3cb1ae7.ts
14886
+ // dist/_adapter_entry_72ccd637-3456-41f9-8bbc-a477018eee1d.ts
14887
14887
  if (!globalThis.__openTabs) {
14888
14888
  globalThis.__openTabs = {};
14889
14889
  } else {
14890
14890
  const desc = Object.getOwnPropertyDescriptor(globalThis.__openTabs, "adapters");
14891
14891
  if (desc && !desc.writable) {
14892
- const ot2 = globalThis.__openTabs;
14892
+ const ot3 = globalThis.__openTabs;
14893
14893
  const newAdaptersObj = {};
14894
- if (ot2.adapters) {
14895
- for (const key of Object.keys(ot2.adapters)) {
14896
- const d = Object.getOwnPropertyDescriptor(ot2.adapters, key);
14894
+ if (ot3.adapters) {
14895
+ for (const key of Object.keys(ot3.adapters)) {
14896
+ const d = Object.getOwnPropertyDescriptor(ot3.adapters, key);
14897
14897
  if (d) Object.defineProperty(newAdaptersObj, key, d);
14898
14898
  }
14899
14899
  }
14900
- globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdaptersObj });
14900
+ globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdaptersObj });
14901
14901
  }
14902
14902
  }
14903
14903
  if (!globalThis.__openTabs.adapters) {
@@ -14935,6 +14935,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14935
14935
  }
14936
14936
  };
14937
14937
  var restoreTransport = setLogTransport ? setLogTransport(logTransport) : void 0;
14938
+ var ot2 = globalThis.__openTabs;
14939
+ ot2._notifyReadinessChanged = () => {
14940
+ try {
14941
+ const nonce = globalThis.__openTabs?._readinessNonce;
14942
+ if (nonce) {
14943
+ window.postMessage({ type: "opentabs:readiness-changed", plugin: "twitch", nonce }, "*");
14944
+ }
14945
+ } catch {
14946
+ }
14947
+ };
14938
14948
  var existing = adapters["twitch"];
14939
14949
  if (existing) {
14940
14950
  if (typeof existing.teardown === "function") {
@@ -14946,7 +14956,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14946
14956
  }
14947
14957
  }
14948
14958
  if (!Reflect.deleteProperty(adapters, "twitch")) {
14949
- const ot2 = globalThis.__openTabs;
14959
+ const ot3 = globalThis.__openTabs;
14950
14960
  const newAdapters = {};
14951
14961
  for (const key of Object.keys(adapters)) {
14952
14962
  if (key !== "twitch") {
@@ -14954,7 +14964,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14954
14964
  if (desc) Object.defineProperty(newAdapters, key, desc);
14955
14965
  }
14956
14966
  }
14957
- globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdapters });
14967
+ globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdapters });
14958
14968
  }
14959
14969
  var hasLifecycleHooks = typeof src_default.onToolInvocationStart === "function" || typeof src_default.onToolInvocationEnd === "function";
14960
14970
  for (const tool of src_default.tools) {
@@ -15015,12 +15025,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15015
15025
  }
15016
15026
  }
15017
15027
  };
15018
- const ot2 = globalThis.__openTabs;
15019
- if (!ot2._navigationInterceptor) {
15028
+ const ot3 = globalThis.__openTabs;
15029
+ if (!ot3._navigationInterceptor) {
15020
15030
  const origPushState = history.pushState.bind(history);
15021
15031
  const origReplaceState = history.replaceState.bind(history);
15022
15032
  const callbacks = /* @__PURE__ */ new Map();
15023
- ot2._navigationInterceptor = { callbacks, origPushState, origReplaceState };
15033
+ ot3._navigationInterceptor = { callbacks, origPushState, origReplaceState };
15024
15034
  history.pushState = function(...args) {
15025
15035
  origPushState(...args);
15026
15036
  for (const cb of callbacks.values()) {
@@ -15034,7 +15044,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15034
15044
  }
15035
15045
  };
15036
15046
  }
15037
- const interceptor = ot2._navigationInterceptor;
15047
+ const interceptor = ot3._navigationInterceptor;
15038
15048
  interceptor.callbacks.set("twitch", checkUrl);
15039
15049
  window.addEventListener("popstate", checkUrl);
15040
15050
  window.addEventListener("hashchange", checkUrl);
@@ -15089,5 +15099,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15089
15099
  };
15090
15100
  delete src_default.onDeactivate;
15091
15101
  }
15092
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["twitch"]){var a=o.adapters["twitch"];a.__adapterHash="3e5c28e5ba090d4da043a4375a541ebc1a359aba5e82cd181f5f5d3a241a50ab";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"twitch",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15102
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["twitch"]){var a=o.adapters["twitch"];a.__adapterHash="3d04009d5ad3dd9ff3018f6f2db3d86da19e73adf2bcc971f9b7d0bd21e7e60c";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"twitch",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15093
15103
  //# sourceMappingURL=adapter.iife.js.map