@pie-qti/player-elements 0.1.22 → 0.1.23

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 (49) hide show
  1. package/dist/{define-Bkc2UFCK.js → define-CqE08oOW.js} +2832 -2424
  2. package/dist/define-CqE08oOW.js.map +1 -0
  3. package/dist/{dist-C0bIgnik.js → dist-B1Rc9Jhz.js} +4 -4
  4. package/dist/{dist-C0bIgnik.js.map → dist-B1Rc9Jhz.js.map} +1 -1
  5. package/dist/dist-CQEJemjs.js +5061 -0
  6. package/dist/dist-CQEJemjs.js.map +1 -0
  7. package/dist/{dist-_mWRIrTg.js → dist-CsEP48m1.js} +2353 -2660
  8. package/dist/dist-CsEP48m1.js.map +1 -0
  9. package/dist/{dist-CPyrAOfS.js → dist-DQ_jFQFX.js} +20 -11
  10. package/dist/dist-DQ_jFQFX.js.map +1 -0
  11. package/dist/{element-BrpUrZI4.js → element-DU-n15ch.js} +2 -2
  12. package/dist/{element-BrpUrZI4.js.map → element-DU-n15ch.js.map} +1 -1
  13. package/dist/{element-class-DWoLXp_r-ms67Krq-.js → element-class-DBV-1lkb-BeszDwN_.js} +524 -496
  14. package/dist/element-class-DBV-1lkb-BeszDwN_.js.map +1 -0
  15. package/dist/elements.js +3 -3
  16. package/dist/index.js +2 -2
  17. package/dist/item-toolbar-element-iE73NEkH.js +1922 -0
  18. package/dist/item-toolbar-element-iE73NEkH.js.map +1 -0
  19. package/dist/pie-assessment-toolkit-element-BGOTMhdG.js +8300 -0
  20. package/dist/pie-assessment-toolkit-element-BGOTMhdG.js.map +1 -0
  21. package/dist/{pie-tool-calculator-BGp3etqJ.js → pie-tool-calculator-CkQb5qxg.js} +969 -952
  22. package/dist/pie-tool-calculator-CkQb5qxg.js.map +1 -0
  23. package/dist/register-players.js +1 -1
  24. package/dist/register.js +4591 -6734
  25. package/dist/register.js.map +1 -1
  26. package/dist/{resolveItems-XtUnsftV.js → resolveItems-DhQQhD2k.js} +2 -2
  27. package/dist/{resolveItems-XtUnsftV.js.map → resolveItems-DhQQhD2k.js.map} +1 -1
  28. package/dist/{root-DBWhDxjY.js → root-Dqg3cyBt.js} +12 -12
  29. package/dist/root-Dqg3cyBt.js.map +1 -0
  30. package/dist/tool-tts-inline-CA3VjWU4.js +3670 -0
  31. package/dist/tool-tts-inline-CA3VjWU4.js.map +1 -0
  32. package/dist/{tag-names-DV56RHJk.js → types-BFOGFD4R.js} +4 -22
  33. package/dist/types-BFOGFD4R.js.map +1 -0
  34. package/package.json +7 -7
  35. package/dist/define-Bkc2UFCK.js.map +0 -1
  36. package/dist/dist-CPyrAOfS.js.map +0 -1
  37. package/dist/dist-DU1nH3y8.js +0 -1247
  38. package/dist/dist-DU1nH3y8.js.map +0 -1
  39. package/dist/dist-_mWRIrTg.js.map +0 -1
  40. package/dist/element-class-DWoLXp_r-ms67Krq-.js.map +0 -1
  41. package/dist/item-toolbar-element-DFppTi_H.js +0 -6015
  42. package/dist/item-toolbar-element-DFppTi_H.js.map +0 -1
  43. package/dist/pie-assessment-toolkit-element-DlSFT_I2.js +0 -28479
  44. package/dist/pie-assessment-toolkit-element-DlSFT_I2.js.map +0 -1
  45. package/dist/pie-tool-calculator-BGp3etqJ.js.map +0 -1
  46. package/dist/root-DBWhDxjY.js.map +0 -1
  47. package/dist/tag-names-DV56RHJk.js.map +0 -1
  48. package/dist/tool-tts-inline-DVUYjVnD.js +0 -2574
  49. package/dist/tool-tts-inline-DVUYjVnD.js.map +0 -1
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.bun/@pie-players+pie-calculator-desmos@0.3.53/node_modules/@pie-players/pie-calculator-desmos/dist/desmos-provider.js
1
+ //#region ../../node_modules/.bun/@pie-players+pie-calculator-desmos@0.3.67/node_modules/@pie-players/pie-calculator-desmos/dist/desmos-provider.js
2
2
  var e = class {
3
3
  providerId = "desmos";
4
4
  providerName = "Desmos";
@@ -7,7 +7,7 @@ var e = class {
7
7
  "scientific",
8
8
  "graphing"
9
9
  ];
10
- version = "1.10";
10
+ version = "1.12";
11
11
  initialized = !1;
12
12
  apiKey;
13
13
  proxyEndpoint;
@@ -26,7 +26,7 @@ var e = class {
26
26
  async loadDesmosScript() {
27
27
  return new Promise((e, t) => {
28
28
  let n = document.createElement("script");
29
- n.src = this.apiKey ? `https://www.desmos.com/api/v1.10/calculator.js?apiKey=${this.apiKey}` : "https://www.desmos.com/api/v1.10/calculator.js", n.async = !0, n.onload = () => {
29
+ n.src = this.apiKey ? `https://www.desmos.com/api/v1.12/calculator.js?apiKey=${this.apiKey}` : "https://www.desmos.com/api/v1.12/calculator.js", n.async = !0, n.onload = () => {
30
30
  window.Desmos ? (console.log("[DesmosProvider] Desmos API loaded successfully"), e()) : t(/* @__PURE__ */ Error("Desmos API loaded but window.Desmos is undefined"));
31
31
  }, n.onerror = () => {
32
32
  t(/* @__PURE__ */ Error("Failed to load Desmos API from CDN"));
@@ -217,4 +217,4 @@ var e = class {
217
217
  //#endregion
218
218
  export { e as DesmosCalculatorProvider };
219
219
 
220
- //# sourceMappingURL=dist-C0bIgnik.js.map
220
+ //# sourceMappingURL=dist-B1Rc9Jhz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist-C0bIgnik.js","names":[],"sources":["../../../node_modules/.bun/@pie-players+pie-calculator-desmos@0.3.53/node_modules/@pie-players/pie-calculator-desmos/dist/desmos-provider.js"],"sourcesContent":["/**\n * Desmos Calculator Provider\n * Implementation of CalculatorProvider for Desmos calculators\n *\n * Supports: Basic, Scientific, and Graphing calculators\n * Based on Desmos API v1.10+\n * Requires: Desmos API key (obtain from https://www.desmos.com/api)\n *\n * SECURITY BEST PRACTICE:\n * - Development: Pass apiKey directly for local testing\n * - Production: Use proxyEndpoint to keep API key server-side\n *\n * Example server-side proxy (Express.js):\n * ```\n * app.get('/api/desmos/token', requireAuth, (req, res) => {\n * res.json({ apiKey: process.env.DESMOS_API_KEY });\n * });\n * ```\n */\n/**\n * Desmos Calculator Provider Implementation\n */\nexport class DesmosCalculatorProvider {\n providerId = \"desmos\";\n providerName = \"Desmos\";\n supportedTypes = [\n \"basic\",\n \"scientific\",\n \"graphing\",\n ];\n version = \"1.10\";\n initialized = false;\n apiKey;\n proxyEndpoint;\n isDevelopment = false;\n onTelemetry;\n async emitTelemetry(eventName, payload) {\n try {\n await this.onTelemetry?.(eventName, payload);\n }\n catch (error) {\n console.warn(\"[DesmosProvider] telemetry callback failed:\", error);\n }\n }\n /**\n * Get the configured API key\n * @internal Used internally by calculator instances\n */\n getApiKey() {\n return this.apiKey;\n }\n /**\n * Dynamically load the Desmos calculator library\n * @private\n */\n async loadDesmosScript() {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n // Include API key in script URL if available\n const scriptUrl = this.apiKey\n ? `https://www.desmos.com/api/v1.10/calculator.js?apiKey=${this.apiKey}`\n : \"https://www.desmos.com/api/v1.10/calculator.js\";\n script.src = scriptUrl;\n script.async = true;\n script.onload = () => {\n if (window.Desmos) {\n console.log(\"[DesmosProvider] Desmos API loaded successfully\");\n resolve();\n }\n else {\n reject(new Error(\"Desmos API loaded but window.Desmos is undefined\"));\n }\n };\n script.onerror = () => {\n reject(new Error(\"Failed to load Desmos API from CDN\"));\n };\n document.head.appendChild(script);\n });\n }\n /**\n * Initialize Desmos library\n * @param config Configuration with API key (development) or proxy endpoint (production)\n */\n async initialize(config) {\n if (this.initialized)\n return;\n this.onTelemetry = config?.onTelemetry;\n // SSR guard\n if (typeof window === \"undefined\") {\n throw new Error(\"Desmos calculators can only be initialized in the browser\");\n }\n // Determine if we're in development mode\n this.isDevelopment =\n process.env.NODE_ENV === \"development\" ||\n typeof process === \"undefined\" ||\n !process.env.NODE_ENV;\n // Configure API access pattern\n if (config?.proxyEndpoint) {\n // Production pattern: server-side proxy\n this.proxyEndpoint = config.proxyEndpoint;\n const authStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-backend-call-start\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"proxy-auth-fetch\",\n });\n try {\n const response = await fetch(config.proxyEndpoint);\n if (!response.ok) {\n throw new Error(`Proxy endpoint returned ${response.status}`);\n }\n const data = await response.json();\n this.apiKey = data.apiKey;\n await this.emitTelemetry(\"pie-tool-backend-call-success\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"proxy-auth-fetch\",\n duration: Date.now() - authStartedAt,\n });\n console.log(\"[DesmosProvider] Initialized with server-side proxy (SECURE)\");\n }\n catch (error) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"proxy-auth-fetch\",\n duration: Date.now() - authStartedAt,\n errorType: \"CalculatorProxyAuthError\",\n message: error instanceof Error ? error.message : String(error),\n });\n throw new Error(`[DesmosProvider] Failed to fetch API key from proxy: ${error}`);\n }\n }\n else if (config?.apiKey) {\n // Development pattern: direct API key\n this.apiKey = config.apiKey;\n // Security warning in production\n if (!this.isDevelopment) {\n console.error(\"⚠️ [DesmosProvider] SECURITY WARNING: API key exposed in client-side code!\\n\" +\n \"This is insecure for production. Use proxyEndpoint instead.\\n\" +\n \"See: https://pie-players.dev/docs/calculator-desmos#security\");\n }\n else {\n console.log(\"[DesmosProvider] Initialized with direct API key (DEVELOPMENT MODE)\");\n }\n }\n else {\n // No API key provided\n console.warn(\"[DesmosProvider] No API key or proxy endpoint provided.\\n\" +\n \"Production usage requires authentication. Obtain API key from https://www.desmos.com/api\\n\" +\n \"Recommended: Use proxyEndpoint for production, apiKey for development only.\");\n }\n // Load Desmos API if not already loaded\n if (!window.Desmos) {\n console.log(\"[DesmosProvider] Loading Desmos API library...\");\n const libraryLoadStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-library-load-start\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"desmos-script-load\",\n });\n try {\n await this.loadDesmosScript();\n await this.emitTelemetry(\"pie-tool-library-load-success\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"desmos-script-load\",\n duration: Date.now() - libraryLoadStartedAt,\n });\n }\n catch (error) {\n await this.emitTelemetry(\"pie-tool-library-load-error\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"desmos-script-load\",\n duration: Date.now() - libraryLoadStartedAt,\n errorType: \"ToolLibraryLoadError\",\n message: error instanceof Error ? error.message : String(error),\n });\n throw error;\n }\n }\n this.initialized = true;\n }\n /**\n * Create a calculator instance\n */\n async createCalculator(type, container, config) {\n if (!this.initialized) {\n await this.initialize();\n }\n if (!this.supportsType(type)) {\n throw new Error(`Desmos does not support calculator type: ${type}`);\n }\n return new DesmosCalculator(this, type, container, config, this.apiKey);\n }\n /**\n * Check if type is supported\n */\n supportsType(type) {\n return this.supportedTypes.includes(type);\n }\n /**\n * Cleanup\n */\n destroy() {\n this.initialized = false;\n this.onTelemetry = undefined;\n }\n /**\n * Get provider capabilities\n */\n getCapabilities() {\n return {\n supportsHistory: false, // Desmos doesn't expose history API\n supportsGraphing: true,\n supportsExpressions: true,\n canExport: true,\n maxPrecision: 15,\n inputMethods: [\"keyboard\", \"mouse\", \"touch\"],\n };\n }\n}\n/**\n * Desmos Calculator Instance\n */\nclass DesmosCalculator {\n provider;\n type;\n Desmos;\n calculator;\n container;\n constructor(provider, type, container, config, apiKey) {\n this.provider = provider;\n this.type = type;\n this.container = container;\n this.Desmos = window.Desmos;\n if (!this.Desmos) {\n throw new Error(\"Desmos API not available\");\n }\n this._initializeCalculator(config, apiKey);\n }\n _initializeCalculator(config, apiKey) {\n // Merge Desmos-specific config with defaults\n const desmosConfig = {\n ...(config?.desmos || {}),\n apiKey: apiKey || config?.desmos?.apiKey,\n };\n // Apply restricted mode if specified\n if (config?.restrictedMode) {\n Object.assign(desmosConfig, {\n expressionsTopbar: false,\n settingsMenu: false,\n zoomButtons: false,\n expressions: false,\n links: false,\n });\n }\n // Create appropriate calculator type\n switch (this.type) {\n case \"graphing\":\n this.calculator = this.Desmos.GraphingCalculator(this.container, desmosConfig);\n break;\n case \"scientific\":\n this.calculator = this.Desmos.ScientificCalculator(this.container, desmosConfig);\n break;\n case \"basic\":\n this.calculator = this.Desmos.FourFunctionCalculator(this.container, desmosConfig);\n break;\n default:\n throw new Error(`Unsupported calculator type: ${this.type}`);\n }\n console.log(`[DesmosCalculator] Created ${this.type} calculator`);\n }\n getValue() {\n // For graphing calculator, get the state\n if (this.type === \"graphing\" && this.calculator.getState) {\n const state = this.calculator.getState();\n return JSON.stringify(state);\n }\n // For other calculators, return empty (Desmos doesn't expose value API)\n return \"\";\n }\n setValue(value) {\n // For graphing calculator, set the state\n if (this.type === \"graphing\" && this.calculator.setState) {\n try {\n const state = JSON.parse(value);\n this.calculator.setState(state);\n }\n catch (error) {\n console.error(\"[DesmosCalculator] Failed to set state:\", error);\n }\n }\n }\n clear() {\n if (this.calculator.setBlank) {\n this.calculator.setBlank();\n }\n }\n async evaluate(expression) {\n // Desmos doesn't provide a direct evaluate API\n // For graphing calculator, add expression and observe\n if (this.type === \"graphing\") {\n return new Promise((resolve) => {\n const id = `eval_${Date.now()}`;\n this.calculator.setExpression({ id, latex: expression });\n // Give Desmos time to process\n setTimeout(() => {\n const helperExpression = this.calculator.HelperExpression({\n latex: expression,\n });\n const result = helperExpression.numericValue || expression;\n this.calculator.removeExpression({ id });\n resolve(String(result));\n }, 100);\n });\n }\n return expression;\n }\n resize() {\n if (this.calculator.resize) {\n this.calculator.resize();\n }\n }\n focus() {\n try {\n if (this.type === \"graphing\" &&\n typeof this.calculator?.focusFirstExpression === \"function\") {\n this.calculator.focusFirstExpression();\n return;\n }\n const target = this.container.querySelector('.dcg-mq-editable-field[tabindex=\"0\"], textarea, [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])');\n target?.focus();\n }\n catch (error) {\n console.warn(\"[DesmosCalculator] focus() failed:\", error);\n }\n }\n exportState() {\n let providerState = {};\n if (this.type === \"graphing\" && this.calculator.getState) {\n providerState = this.calculator.getState();\n }\n return {\n type: this.type,\n provider: \"desmos\",\n value: this.getValue(),\n providerState,\n };\n }\n importState(state) {\n if (state.provider !== \"desmos\") {\n throw new Error(`Cannot import state from provider: ${state.provider}`);\n }\n if (state.providerState && this.calculator.setState) {\n this.calculator.setState(state.providerState);\n }\n else if (state.value) {\n this.setValue(state.value);\n }\n }\n destroy() {\n if (this.calculator && this.calculator.destroy) {\n this.calculator.destroy();\n }\n this.container.replaceChildren();\n console.log(\"[DesmosCalculator] destroyed\");\n }\n}\n//# sourceMappingURL=desmos-provider.js.map"],"x_google_ignoreList":[0],"mappings":";AAsBA,IAAa,IAAb,MAAsC;CAClC,aAAa;CACb,eAAe;CACf,iBAAiB;EACb;EACA;EACA;CACJ;CACA,UAAU;CACV,cAAc;CACd;CACA;CACA,gBAAgB;CAChB;CACA,MAAM,cAAc,GAAW,GAAS;EACpC,IAAI;GACA,MAAM,KAAK,cAAc,GAAW,CAAO;EAC/C,SACO,GAAO;GACV,QAAQ,KAAK,+CAA+C,CAAK;EACrE;CACJ;CAKA,YAAY;EACR,OAAO,KAAK;CAChB;CAKA,MAAM,mBAAmB;EACrB,OAAO,IAAI,SAAS,GAAS,MAAW;GACpC,IAAM,IAAS,SAAS,cAAc,QAAQ;GAmB9C,AAdA,EAAO,MAHW,KAAK,SACjB,yDAAyD,KAAK,WAC9D,kDAEN,EAAO,QAAQ,IACf,EAAO,eAAe;IAClB,AAAI,OAAO,UACP,QAAQ,IAAI,iDAAiD,GAC7D,EAAQ,KAGR,EAAO,gBAAI,MAAM,kDAAkD,CAAC;GAE5E,GACA,EAAO,gBAAgB;IACnB,EAAO,gBAAI,MAAM,oCAAoC,CAAC;GAC1D,GACA,SAAS,KAAK,YAAY,CAAM;EACpC,CAAC;CACL;CAKA,MAAM,WAAW,GAAQ;EACjB,UAAK,aAIT;OAFA,KAAK,cAAc,GAAQ,aAEvB,OAAO,SAAW,KAClB,MAAU,MAAM,2DAA2D;GAQ/E,IALA,KAAK,gBAAA,QAAA,IAAA,aACwB,iBACrB,OAAO,UAAY,OACnB,CAAA,QAAA,IA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,KAAK,WAAW,qBAAqB;IACrC;GACJ;GAEA,KADoB,UAAU,cAAc,iHACvC,CAAC,EAAE,MAAM;EAClB,SACO,GAAO;GACV,QAAQ,KAAK,sCAAsC,CAAK;EAC5D;CACJ;CACA,cAAc;EACV,IAAI,IAAgB,CAAC;EAIrB,OAHI,KAAK,SAAS,cAAc,KAAK,WAAW,aAC5C,IAAgB,KAAK,WAAW,SAAS,IAEtC;GACH,MAAM,KAAK;GACX,UAAU;GACV,OAAO,KAAK,SAAS;GACrB;EACJ;CACJ;CACA,YAAY,GAAO;EACf,IAAI,EAAM,aAAa,UACnB,MAAU,MAAM,sCAAsC,EAAM,UAAU;EAE1E,AAAI,EAAM,iBAAiB,KAAK,WAAW,WACvC,KAAK,WAAW,SAAS,EAAM,aAAa,IAEvC,EAAM,SACX,KAAK,SAAS,EAAM,KAAK;CAEjC;CACA,UAAU;EAKN,AAJI,KAAK,cAAc,KAAK,WAAW,WACnC,KAAK,WAAW,QAAQ,GAE5B,KAAK,UAAU,gBAAgB,GAC/B,QAAQ,IAAI,8BAA8B;CAC9C;AACJ"}
1
+ {"version":3,"file":"dist-B1Rc9Jhz.js","names":[],"sources":["../../../node_modules/.bun/@pie-players+pie-calculator-desmos@0.3.67/node_modules/@pie-players/pie-calculator-desmos/dist/desmos-provider.js"],"sourcesContent":["/**\n * Desmos Calculator Provider\n * Implementation of CalculatorProvider for Desmos calculators\n *\n * Supports: Basic, Scientific, and Graphing calculators\n * Based on Desmos API v1.12+\n * Requires: Desmos API key (obtain from https://www.desmos.com/api)\n *\n * SECURITY BEST PRACTICE:\n * - Development: Pass apiKey directly for local testing\n * - Production: Use proxyEndpoint to keep API key server-side\n *\n * Example server-side proxy (Express.js):\n * ```\n * app.get('/api/desmos/token', requireAuth, (req, res) => {\n * res.json({ apiKey: process.env.DESMOS_API_KEY });\n * });\n * ```\n */\n/**\n * Desmos Calculator Provider Implementation\n */\nexport class DesmosCalculatorProvider {\n providerId = \"desmos\";\n providerName = \"Desmos\";\n supportedTypes = [\n \"basic\",\n \"scientific\",\n \"graphing\",\n ];\n version = \"1.12\";\n initialized = false;\n apiKey;\n proxyEndpoint;\n isDevelopment = false;\n onTelemetry;\n async emitTelemetry(eventName, payload) {\n try {\n await this.onTelemetry?.(eventName, payload);\n }\n catch (error) {\n console.warn(\"[DesmosProvider] telemetry callback failed:\", error);\n }\n }\n /**\n * Get the configured API key\n * @internal Used internally by calculator instances\n */\n getApiKey() {\n return this.apiKey;\n }\n /**\n * Dynamically load the Desmos calculator library\n * @private\n */\n async loadDesmosScript() {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n // Include API key in script URL if available\n const scriptUrl = this.apiKey\n ? `https://www.desmos.com/api/v1.12/calculator.js?apiKey=${this.apiKey}`\n : \"https://www.desmos.com/api/v1.12/calculator.js\";\n script.src = scriptUrl;\n script.async = true;\n script.onload = () => {\n if (window.Desmos) {\n console.log(\"[DesmosProvider] Desmos API loaded successfully\");\n resolve();\n }\n else {\n reject(new Error(\"Desmos API loaded but window.Desmos is undefined\"));\n }\n };\n script.onerror = () => {\n reject(new Error(\"Failed to load Desmos API from CDN\"));\n };\n document.head.appendChild(script);\n });\n }\n /**\n * Initialize Desmos library\n * @param config Configuration with API key (development) or proxy endpoint (production)\n */\n async initialize(config) {\n if (this.initialized)\n return;\n this.onTelemetry = config?.onTelemetry;\n // SSR guard\n if (typeof window === \"undefined\") {\n throw new Error(\"Desmos calculators can only be initialized in the browser\");\n }\n // Determine if we're in development mode\n this.isDevelopment =\n process.env.NODE_ENV === \"development\" ||\n typeof process === \"undefined\" ||\n !process.env.NODE_ENV;\n // Configure API access pattern\n if (config?.proxyEndpoint) {\n // Production pattern: server-side proxy\n this.proxyEndpoint = config.proxyEndpoint;\n const authStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-backend-call-start\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"proxy-auth-fetch\",\n });\n try {\n const response = await fetch(config.proxyEndpoint);\n if (!response.ok) {\n throw new Error(`Proxy endpoint returned ${response.status}`);\n }\n const data = await response.json();\n this.apiKey = data.apiKey;\n await this.emitTelemetry(\"pie-tool-backend-call-success\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"proxy-auth-fetch\",\n duration: Date.now() - authStartedAt,\n });\n console.log(\"[DesmosProvider] Initialized with server-side proxy (SECURE)\");\n }\n catch (error) {\n await this.emitTelemetry(\"pie-tool-backend-call-error\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"proxy-auth-fetch\",\n duration: Date.now() - authStartedAt,\n errorType: \"CalculatorProxyAuthError\",\n message: error instanceof Error ? error.message : String(error),\n });\n throw new Error(`[DesmosProvider] Failed to fetch API key from proxy: ${error}`);\n }\n }\n else if (config?.apiKey) {\n // Development pattern: direct API key\n this.apiKey = config.apiKey;\n // Security warning in production\n if (!this.isDevelopment) {\n console.error(\"⚠️ [DesmosProvider] SECURITY WARNING: API key exposed in client-side code!\\n\" +\n \"This is insecure for production. Use proxyEndpoint instead.\\n\" +\n \"See: https://pie-players.dev/docs/calculator-desmos#security\");\n }\n else {\n console.log(\"[DesmosProvider] Initialized with direct API key (DEVELOPMENT MODE)\");\n }\n }\n else {\n // No API key provided\n console.warn(\"[DesmosProvider] No API key or proxy endpoint provided.\\n\" +\n \"Production usage requires authentication. Obtain API key from https://www.desmos.com/api\\n\" +\n \"Recommended: Use proxyEndpoint for production, apiKey for development only.\");\n }\n // Load Desmos API if not already loaded\n if (!window.Desmos) {\n console.log(\"[DesmosProvider] Loading Desmos API library...\");\n const libraryLoadStartedAt = Date.now();\n await this.emitTelemetry(\"pie-tool-library-load-start\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"desmos-script-load\",\n });\n try {\n await this.loadDesmosScript();\n await this.emitTelemetry(\"pie-tool-library-load-success\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"desmos-script-load\",\n duration: Date.now() - libraryLoadStartedAt,\n });\n }\n catch (error) {\n await this.emitTelemetry(\"pie-tool-library-load-error\", {\n toolId: \"calculator\",\n backend: \"desmos\",\n operation: \"desmos-script-load\",\n duration: Date.now() - libraryLoadStartedAt,\n errorType: \"ToolLibraryLoadError\",\n message: error instanceof Error ? error.message : String(error),\n });\n throw error;\n }\n }\n this.initialized = true;\n }\n /**\n * Create a calculator instance\n */\n async createCalculator(type, container, config) {\n if (!this.initialized) {\n await this.initialize();\n }\n if (!this.supportsType(type)) {\n throw new Error(`Desmos does not support calculator type: ${type}`);\n }\n return new DesmosCalculator(this, type, container, config, this.apiKey);\n }\n /**\n * Check if type is supported\n */\n supportsType(type) {\n return this.supportedTypes.includes(type);\n }\n /**\n * Cleanup\n */\n destroy() {\n this.initialized = false;\n this.onTelemetry = undefined;\n }\n /**\n * Get provider capabilities\n */\n getCapabilities() {\n return {\n supportsHistory: false, // Desmos doesn't expose history API\n supportsGraphing: true,\n supportsExpressions: true,\n canExport: true,\n maxPrecision: 15,\n inputMethods: [\"keyboard\", \"mouse\", \"touch\"],\n };\n }\n}\n/**\n * Desmos Calculator Instance\n */\nclass DesmosCalculator {\n provider;\n type;\n Desmos;\n calculator;\n container;\n constructor(provider, type, container, config, apiKey) {\n this.provider = provider;\n this.type = type;\n this.container = container;\n this.Desmos = window.Desmos;\n if (!this.Desmos) {\n throw new Error(\"Desmos API not available\");\n }\n this._initializeCalculator(config, apiKey);\n }\n _initializeCalculator(config, apiKey) {\n // Merge Desmos-specific config with defaults\n const desmosConfig = {\n ...(config?.desmos || {}),\n apiKey: apiKey || config?.desmos?.apiKey,\n };\n // Apply restricted mode if specified\n if (config?.restrictedMode) {\n Object.assign(desmosConfig, {\n expressionsTopbar: false,\n settingsMenu: false,\n zoomButtons: false,\n expressions: false,\n links: false,\n });\n }\n // Create appropriate calculator type\n switch (this.type) {\n case \"graphing\":\n this.calculator = this.Desmos.GraphingCalculator(this.container, desmosConfig);\n break;\n case \"scientific\":\n this.calculator = this.Desmos.ScientificCalculator(this.container, desmosConfig);\n break;\n case \"basic\":\n this.calculator = this.Desmos.FourFunctionCalculator(this.container, desmosConfig);\n break;\n default:\n throw new Error(`Unsupported calculator type: ${this.type}`);\n }\n console.log(`[DesmosCalculator] Created ${this.type} calculator`);\n }\n getValue() {\n // For graphing calculator, get the state\n if (this.type === \"graphing\" && this.calculator.getState) {\n const state = this.calculator.getState();\n return JSON.stringify(state);\n }\n // For other calculators, return empty (Desmos doesn't expose value API)\n return \"\";\n }\n setValue(value) {\n // For graphing calculator, set the state\n if (this.type === \"graphing\" && this.calculator.setState) {\n try {\n const state = JSON.parse(value);\n this.calculator.setState(state);\n }\n catch (error) {\n console.error(\"[DesmosCalculator] Failed to set state:\", error);\n }\n }\n }\n clear() {\n if (this.calculator.setBlank) {\n this.calculator.setBlank();\n }\n }\n async evaluate(expression) {\n // Desmos doesn't provide a direct evaluate API\n // For graphing calculator, add expression and observe\n if (this.type === \"graphing\") {\n return new Promise((resolve) => {\n const id = `eval_${Date.now()}`;\n this.calculator.setExpression({ id, latex: expression });\n // Give Desmos time to process\n setTimeout(() => {\n const helperExpression = this.calculator.HelperExpression({\n latex: expression,\n });\n const result = helperExpression.numericValue || expression;\n this.calculator.removeExpression({ id });\n resolve(String(result));\n }, 100);\n });\n }\n return expression;\n }\n resize() {\n if (this.calculator.resize) {\n this.calculator.resize();\n }\n }\n focus() {\n try {\n if (this.type === \"graphing\" &&\n typeof this.calculator?.focusFirstExpression === \"function\") {\n this.calculator.focusFirstExpression();\n return;\n }\n const target = this.container.querySelector('.dcg-mq-editable-field[tabindex=\"0\"], textarea, [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])');\n target?.focus();\n }\n catch (error) {\n console.warn(\"[DesmosCalculator] focus() failed:\", error);\n }\n }\n exportState() {\n let providerState = {};\n if (this.type === \"graphing\" && this.calculator.getState) {\n providerState = this.calculator.getState();\n }\n return {\n type: this.type,\n provider: \"desmos\",\n value: this.getValue(),\n providerState,\n };\n }\n importState(state) {\n if (state.provider !== \"desmos\") {\n throw new Error(`Cannot import state from provider: ${state.provider}`);\n }\n if (state.providerState && this.calculator.setState) {\n this.calculator.setState(state.providerState);\n }\n else if (state.value) {\n this.setValue(state.value);\n }\n }\n destroy() {\n if (this.calculator && this.calculator.destroy) {\n this.calculator.destroy();\n }\n this.container.replaceChildren();\n console.log(\"[DesmosCalculator] destroyed\");\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";AAsBA,IAAa,IAAb,MAAsC;CAClC,aAAa;CACb,eAAe;CACf,iBAAiB;EACb;EACA;EACA;CACJ;CACA,UAAU;CACV,cAAc;CACd;CACA;CACA,gBAAgB;CAChB;CACA,MAAM,cAAc,GAAW,GAAS;EACpC,IAAI;GACA,MAAM,KAAK,cAAc,GAAW,CAAO;EAC/C,SACO,GAAO;GACV,QAAQ,KAAK,+CAA+C,CAAK;EACrE;CACJ;CAKA,YAAY;EACR,OAAO,KAAK;CAChB;CAKA,MAAM,mBAAmB;EACrB,OAAO,IAAI,SAAS,GAAS,MAAW;GACpC,IAAM,IAAS,SAAS,cAAc,QAAQ;GAmB9C,AAdA,EAAO,MAHW,KAAK,SACjB,yDAAyD,KAAK,WAC9D,kDAEN,EAAO,QAAQ,IACf,EAAO,eAAe;IAClB,AAAI,OAAO,UACP,QAAQ,IAAI,iDAAiD,GAC7D,EAAQ,KAGR,EAAO,gBAAI,MAAM,kDAAkD,CAAC;GAE5E,GACA,EAAO,gBAAgB;IACnB,EAAO,gBAAI,MAAM,oCAAoC,CAAC;GAC1D,GACA,SAAS,KAAK,YAAY,CAAM;EACpC,CAAC;CACL;CAKA,MAAM,WAAW,GAAQ;EACjB,UAAK,aAIT;OAFA,KAAK,cAAc,GAAQ,aAEvB,OAAO,SAAW,KAClB,MAAU,MAAM,2DAA2D;GAQ/E,IALA,KAAK,gBAAA,QAAA,IAAA,aACwB,iBACrB,OAAO,UAAY,OACnB,CAAA,QAAA,IAAA,UAEJ,GAAQ,eAAe;IAEvB,KAAK,gBAAgB,EAAO;IAC5B,IAAM,IAAgB,KA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