@edugate/ai-agent 0.0.1 → 0.1.0
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.
- package/dist/index.d.mts +77707 -3
- package/dist/index.d.ts +77707 -3
- package/dist/index.js +6 -4
- package/dist/index.mjs +7 -4
- package/package.json +13 -7
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
"use strict";var Pe=Object.create;var L=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var g=(t,n)=>()=>{try{return n||t((n={exports:{}}).exports,n),n.exports}catch(i){throw n=0,i}},Fe=(t,n)=>{for(var i in n)L(t,i,{get:n[i],enumerable:!0})},ie=(t,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of De(n))!Re.call(t,a)&&a!==i&&L(t,a,{get:()=>n[a],enumerable:!(r=Ae(n,a))||r.enumerable});return t};var Qe=(t,n,i)=>(i=t!=null?Pe(qe(t)):{},ie(n||!t||!t.__esModule?L(i,"default",{value:t,enumerable:!0}):i,t)),Ee=t=>ie(L({},"__esModule",{value:!0}),t);var w=g(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.MediaRefSchema=m.MediaItemSchema=m.VideoSettingsSchema=m.CropDataSchema=m.MediaSourceSchema=m.MediaTypeSchema=m.GridSizeSchema=m.SizeSchema=m.PositionSchema=void 0;var c=require("zod");m.PositionSchema=c.z.object({x:c.z.number(),y:c.z.number(),z:c.z.number().optional()});m.SizeSchema=c.z.object({width:c.z.number().optional(),height:c.z.number().optional()});m.GridSizeSchema=c.z.object({rows:c.z.number(),cols:c.z.number()});m.MediaTypeSchema=c.z.enum(["image","color","gif","shape","illustration","video","audio"]);m.MediaSourceSchema=c.z.enum(["unsplash","pexels","upload","url","library","tenor"]);m.CropDataSchema=c.z.object({x:c.z.number(),y:c.z.number(),width:c.z.number(),height:c.z.number(),zoom:c.z.number().optional(),rotation:c.z.number().optional(),aspect:c.z.number().optional()});m.VideoSettingsSchema=c.z.object({autoplay:c.z.boolean().optional(),loop:c.z.boolean().optional(),muted:c.z.boolean().optional(),controls:c.z.boolean().optional(),poster:c.z.string().optional(),volume:c.z.number().optional()});m.MediaItemSchema=c.z.object({id:c.z.string().optional(),url:c.z.string().optional(),title:c.z.string().optional(),type:m.MediaTypeSchema,source:m.MediaSourceSchema.optional(),alt:c.z.string().optional(),width:c.z.number().optional(),height:c.z.number().optional(),format:c.z.enum(["cover","contain"]).optional(),color:c.z.string().optional(),cropData:m.CropDataSchema.optional(),duration:c.z.number().optional(),videoSettings:m.VideoSettingsSchema.optional()});m.MediaRefSchema=m.MediaItemSchema});var le=g(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.QuestionSchema=l.TextQuestionSchema=l.TrueFalseQuestionSchema=l.ChoiceQuestionSchema=l.QuestionOptionSchema=l.ImageSizeSchema=l.ImageAlignSchema=l.QuestionTypeSchema=void 0;var d=require("zod"),se=w();l.QuestionTypeSchema=d.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);l.ImageAlignSchema=d.z.enum(["left","right","center"]);l.ImageSizeSchema=d.z.object({width:d.z.number().optional(),height:d.z.number().optional()});l.QuestionOptionSchema=d.z.object({id:d.z.string(),text:d.z.string(),isCorrect:d.z.boolean(),image:se.MediaItemSchema.optional(),imageAlign:l.ImageAlignSchema.optional(),imageSize:l.ImageSizeSchema.optional()});var X={id:d.z.string(),text:d.z.string(),score:d.z.number().optional(),image:se.MediaItemSchema.optional(),imageAlign:l.ImageAlignSchema.optional(),imageSize:l.ImageSizeSchema.optional()};l.ChoiceQuestionSchema=d.z.object({...X,type:d.z.enum(["single-choice","multiple-choice"]),options:d.z.array(l.QuestionOptionSchema)});l.TrueFalseQuestionSchema=d.z.object({...X,type:d.z.literal("true-false"),correctAnswer:d.z.boolean()});l.TextQuestionSchema=d.z.object({...X,type:d.z.enum(["short-answers","long-answers"]),minCharacters:d.z.number().optional(),maxCharacters:d.z.number().optional()});l.QuestionSchema=d.z.discriminatedUnion("type",[l.ChoiceQuestionSchema,l.TrueFalseQuestionSchema,l.TextQuestionSchema])});var de=g(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.QuizContentSchema=k.QuizQuestionSchema=k.QuizOptionSchema=k.QuizQuestionTypeSchema=void 0;var u=require("zod"),me=w(),$=le();k.QuizQuestionTypeSchema=u.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);k.QuizOptionSchema=u.z.object({id:u.z.string().optional(),text:u.z.string(),isCorrect:u.z.boolean(),image:me.MediaItemSchema.optional().describe("Option image."),imageAlign:$.ImageAlignSchema.optional().describe("Option image alignment."),imageSize:$.ImageSizeSchema.optional().describe("Option image size.")});k.QuizQuestionSchema=u.z.object({id:u.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:k.QuizQuestionTypeSchema,text:u.z.string().describe("The question text."),score:u.z.number().optional(),options:u.z.array(k.QuizOptionSchema).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:u.z.boolean().optional().describe("Required for true-false."),image:me.MediaItemSchema.optional().describe("Question image."),imageAlign:$.ImageAlignSchema.optional().describe("Question image alignment."),imageSize:$.ImageSizeSchema.optional().describe("Question image size.")});k.QuizContentSchema=u.z.object({questions:u.z.array(k.QuizQuestionSchema).describe("Array of question objects."),showResults:u.z.boolean().optional(),allowRetry:u.z.boolean().optional(),maxRetry:u.z.string().optional(),required:u.z.boolean().optional(),submitText:u.z.string().optional().describe("Label for submit button."),timer:u.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:u.z.boolean().optional().describe("Show current/total questions count.")})});var ue=g(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.ClozeContentSchema=R.ClozeModeSchema=void 0;var Z=require("zod");R.ClozeModeSchema=Z.z.enum(["write","drag-drop"]);R.ClozeContentSchema=Z.z.object({templateText:Z.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:R.ClozeModeSchema.optional().describe("Input mode. Default: write.")})});var he=g(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.AnagramContentSchema=T.WordSearchContentSchema=T.CrosswordContentSchema=T.CrosswordWordSchema=T.WordGameBlockTypeSchema=void 0;var y=require("zod"),pe=w();T.WordGameBlockTypeSchema=y.z.enum(["Crossword","WordSearch","Anagram"]);T.CrosswordWordSchema=y.z.object({answer:y.z.string(),clue:y.z.string(),image:pe.MediaItemSchema.optional().describe("Clue image.")});T.CrosswordContentSchema=y.z.object({words:y.z.array(T.CrosswordWordSchema)});T.WordSearchContentSchema=y.z.object({words:y.z.array(y.z.string()),gridSize:pe.GridSizeSchema.optional().describe("Grid dimensions."),difficulty:y.z.enum(["easy","medium","hard"]).optional()});T.AnagramContentSchema=y.z.object({correctWord:y.z.string().describe("The correct word."),letters:y.z.array(y.z.string()).optional(),clue:y.z.string().optional().describe("A hint.")})});var Se=g(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.PairGameContentSchema=B.PairSchema=B.MemoryPairTypeSchema=B.PairGameBlockTypeSchema=void 0;var _=require("zod"),ee=w();B.PairGameBlockTypeSchema=_.z.enum(["Memory","MatchPairs"]);B.MemoryPairTypeSchema=_.z.enum(["img-img","img-word","word-word"]);B.PairSchema=_.z.object({id:_.z.string().optional(),type:B.MemoryPairTypeSchema.optional().describe("For Memory: pair type."),content:_.z.array(_.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:_.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:_.z.string().optional().describe("For MatchPairs: right side text."),leftImage:ee.MediaItemSchema.optional().describe("For MatchPairs: left side image."),rightImage:ee.MediaItemSchema.optional().describe("For MatchPairs: right side image.")});B.PairGameContentSchema=_.z.object({pairs:_.z.array(B.PairSchema).describe("Array of pair objects."),gridSize:ee.GridSizeSchema.optional().describe("For Memory: grid dimensions."),instructions:_.z.string().optional().describe("For MatchPairs: instruction text.")})});var be=g(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.DeckContentSchema=C.CardSchema=C.CardFaceSchema=C.DeckBlockTypeSchema=void 0;var I=require("zod");C.DeckBlockTypeSchema=I.z.enum(["Flashcard","CardDeck"]);C.CardFaceSchema=I.z.object({type:I.z.enum(["text","image"]),content:I.z.any()});C.CardSchema=I.z.object({id:I.z.string().optional(),front:C.CardFaceSchema.optional().describe("For Flashcard: front side."),back:C.CardFaceSchema.optional().describe("For Flashcard: back side."),frontText:I.z.string().optional().describe("For CardDeck: front text."),frontImage:I.z.any().optional().describe("For CardDeck: front image.")});C.DeckContentSchema=I.z.object({cards:I.z.array(C.CardSchema).describe("Array of card objects."),backImage:I.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:I.z.enum(["delete","return"]).optional().describe("For CardDeck.")})});var ze=g(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.DiceContentSchema=F.DieTypeSchema=void 0;var N=require("zod");F.DieTypeSchema=N.z.enum(["d4","d6","d8","d10","d12","d20"]);F.DiceContentSchema=N.z.object({diceType:F.DieTypeSchema.optional(),diceCount:N.z.number().int().min(1).max(10).optional(),color:N.z.string().optional().describe("CSS color for dice."),showNumber:N.z.boolean().optional(),persistent:N.z.boolean().optional().describe("Keep dice visible after roll.")})});var ge=g(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.SpinnerContentSchema=E.SpinnerSliceSchema=void 0;var Q=require("zod"),Ue=w();E.SpinnerSliceSchema=Q.z.object({id:Q.z.string().optional(),text:Q.z.string(),color:Q.z.string().optional().describe("CSS color for slice."),image:Ue.MediaItemSchema.optional().describe("Slice image.")});E.SpinnerContentSchema=Q.z.object({slices:Q.z.array(E.SpinnerSliceSchema).min(2).describe("Wheel slices (min 2)."),spinDuration:Q.z.number().optional().describe("Spin duration in seconds.")})});var ye=g(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.ShapeBlockThemeSchema=o.MatchPairsBlockThemeSchema=o.FlashcardBlockThemeSchema=o.CardDeckBlockThemeSchema=o.ClozeBlockThemeSchema=o.SpinningWheelBlockThemeSchema=o.MemoryBlockThemeSchema=o.WordSearchBlockThemeSchema=o.CrosswordBlockThemeSchema=o.DiceBlockThemeSchema=o.AnagramBlockThemeSchema=o.EditorBlockThemeSchema=o.DragAndDropBlockThemeSchema=o.QuizBlockThemeSchema=o.HotpointBlockThemeSchema=o.BlockThemeSchema=o.TextStylesSchema=o.BoxStylesSchema=o.RadiusSchema=o.BoxSideSchema=o.AnimationSchema=void 0;var e=require("zod"),oe=w();o.AnimationSchema=e.z.object({type:e.z.union([e.z.enum(["none","fade","direction","bounce","scale","rotate"]),e.z.string()]),duration:e.z.number().optional(),delay:e.z.number().optional(),phase:e.z.enum(["in","both","out"]).optional(),direction:e.z.enum(["up","right","down","left"]).optional()});o.BoxSideSchema=e.z.object({top:e.z.union([e.z.string(),e.z.number()]).optional(),right:e.z.union([e.z.string(),e.z.number()]).optional(),bottom:e.z.union([e.z.string(),e.z.number()]).optional(),left:e.z.union([e.z.string(),e.z.number()]).optional()});o.RadiusSchema=e.z.object({topLeft:e.z.union([e.z.string(),e.z.number()]).optional(),topRight:e.z.union([e.z.string(),e.z.number()]).optional(),bottomRight:e.z.union([e.z.string(),e.z.number()]).optional(),bottomLeft:e.z.union([e.z.string(),e.z.number()]).optional()});o.BoxStylesSchema=e.z.object({background:e.z.boolean().optional(),backgroundColor:e.z.string().optional(),backgroundOpacity:e.z.number().optional(),backgroundMedia:oe.MediaItemSchema.optional(),border:e.z.boolean().optional(),borderColor:e.z.string().optional(),borderWidth:o.BoxSideSchema.optional(),borderRadius:o.RadiusSchema.optional(),padding:e.z.union([e.z.string(),e.z.number(),o.BoxSideSchema]).optional()});o.TextStylesSchema=e.z.object({color:e.z.string().optional(),fontSize:e.z.number().optional(),fontFamily:e.z.string().optional(),fontStyle:e.z.string().optional(),fontWeight:e.z.union([e.z.string(),e.z.number()]).optional(),textAlign:e.z.enum(["left","center","right","justify"]).optional()});var O=o.BoxStylesSchema.merge(o.TextStylesSchema);o.BlockThemeSchema=e.z.object({spacing:e.z.enum(["no-spacing","small","medium","large"]).optional(),animation:o.AnimationSchema.optional(),styles:e.z.record(e.z.record(e.z.any())).optional()});o.HotpointBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({hotpoint:e.z.object({icon:e.z.string().optional(),iconPosition:e.z.enum(["left","right"]).optional(),iconSize:e.z.string().optional(),iconColor:e.z.string().optional(),image:oe.MediaItemSchema.optional(),imageFormat:e.z.enum(["circle","square","custom"]).optional(),border:e.z.boolean().optional(),borderColor:e.z.string().optional(),borderWidth:e.z.string().optional(),borderRadius:e.z.string().optional(),glow:e.z.boolean().optional(),glowColor:e.z.string().optional(),background:e.z.boolean().optional(),backgroundColor:e.z.string().optional(),fontSize:e.z.number().optional(),fontFamily:e.z.string().optional(),fontStyle:e.z.string().optional(),textColor:e.z.string().optional()}).optional()}).optional()});o.QuizBlockThemeSchema=o.BlockThemeSchema.extend({layout:e.z.enum(["horizontal","vertical","grid"]),gridColumns:e.z.number().optional(),preset:e.z.enum(["default","modern","trivia","custom"]),styles:e.z.object({general:O,question:O,answers:O.extend({customStyles:e.z.array(e.z.object({color:e.z.string().optional(),backgroundColor:e.z.string().optional(),targets:e.z.string().optional()})).optional(),hover:O.optional()}),button:O.extend({variant:e.z.enum(["default","outline","ghost"]).optional(),hover:O.optional()})}).optional()});o.DragAndDropBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),splitRatio:e.z.number().optional(),gridColumns:e.z.number().optional(),gridGap:e.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:e.z.object({x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:e.z.object({title:o.TextStylesSchema.optional(),sandbox:o.BoxStylesSchema.optional(),item:O.optional(),group:o.BoxStylesSchema.optional(),container:o.BoxStylesSchema.extend({url:e.z.string().optional(),type:oe.MediaTypeSchema.optional()}).optional(),groups:O.optional(),feedback:e.z.object({correct:e.z.string().optional(),incorrect:e.z.string().optional(),active:e.z.string().optional()}).optional(),referenceSize:e.z.object({width:e.z.number(),height:e.z.number()}).optional()}).optional()});o.EditorBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({editor:o.BoxStylesSchema.optional()}).optional()});o.AnagramBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({letter:o.BoxStylesSchema.optional(),letterText:o.TextStylesSchema.optional(),slot:o.BoxStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.DiceBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({button:o.BoxStylesSchema.extend({hover:O.optional()}).optional(),buttonText:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.CrosswordBlockThemeSchema=o.BlockThemeSchema.extend({primaryColor:e.z.string().optional(),layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),splitRatio:e.z.number().optional(),styles:e.z.object({text:o.TextStylesSchema.optional(),cell:o.BoxStylesSchema.optional(),grid:o.BoxStylesSchema.optional(),clueContainer:o.BoxStylesSchema.optional(),clueText:o.TextStylesSchema.optional(),clueTitle:o.TextStylesSchema.optional()}).optional()});o.WordSearchBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),splitRatio:e.z.number().optional(),styles:e.z.object({wordSearch:e.z.object({primaryColor:e.z.string().optional(),highlightColor:e.z.string().optional(),fontSize:e.z.number().optional(),fontFamily:e.z.string().optional(),textColor:e.z.string().optional(),cellBackgroundColor:e.z.string().optional()}).optional(),text:o.TextStylesSchema.optional(),cell:o.BoxStylesSchema.optional(),grid:o.BoxStylesSchema.optional(),wordListContainer:o.BoxStylesSchema.optional(),wordListText:o.TextStylesSchema.optional(),wordListTitle:o.TextStylesSchema.optional()}).optional()});o.MemoryBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({text:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional(),infoContainer:o.BoxStylesSchema.optional(),infoText:o.TextStylesSchema.optional(),card:o.BoxStylesSchema.optional()}).optional()});o.SpinningWheelBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({wheelText:o.TextStylesSchema.optional()}).optional()});o.ClozeBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),styles:e.z.object({text:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional(),wordBank:o.BoxStylesSchema.optional(),word:o.BoxStylesSchema.optional(),blank:o.BoxStylesSchema.optional()}).optional()});o.CardDeckBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({card:o.BoxStylesSchema.optional(),cardText:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.FlashcardBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({cardFront:o.BoxStylesSchema.optional(),cardBack:o.BoxStylesSchema.optional(),frontText:o.TextStylesSchema.optional(),backText:o.TextStylesSchema.optional(),navigation:o.BoxStylesSchema.optional(),navigationText:o.TextStylesSchema.optional()}).optional()});o.MatchPairsBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),styles:e.z.object({text:o.TextStylesSchema.optional(),card:o.BoxStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.ShapeBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({shape:O.extend({fillColor:e.z.string().optional(),textColor:e.z.string().optional(),borderStyle:e.z.enum(["solid","dashed","dotted"]).optional(),padding:e.z.number().optional()}).optional()}).optional()})});var fe=g(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.DragAndDropContentSchema=v.DragGroupSchema=v.DragItemSchema=void 0;var s=require("zod"),J=w(),V=ye();v.DragItemSchema=s.z.object({id:s.z.string().optional(),text:s.z.string(),background:J.MediaItemSchema.optional().describe("Background image/color for item."),opacity:s.z.number().optional().describe("Opacity of the item (0-1)."),x:s.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:s.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:s.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:s.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:s.z.number().optional().describe("Manual width in pixels."),height:s.z.number().optional().describe("Manual height in pixels."),styles:V.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:V.TextStylesSchema.optional().describe("Text custom styling styles.")});v.DragGroupSchema=s.z.object({id:s.z.string().optional(),name:s.z.string().describe("Group/dropzone name."),singleItem:s.z.boolean().optional().describe("Accept only one item inside."),background:J.MediaItemSchema.optional().describe("Background image/color for group."),x:s.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:s.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:s.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:s.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:s.z.number().optional().describe("Manual width in pixels."),height:s.z.number().optional().describe("Manual height in pixels."),opacity:s.z.number().optional().describe("Opacity of the group (0-1)."),styles:V.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:V.TextStylesSchema.optional().describe("Text custom styling styles."),items:s.z.array(v.DragItemSchema).describe("Items that belong in this group.")});v.DragAndDropContentSchema=s.z.object({groups:s.z.array(v.DragGroupSchema).min(1).describe("Drag-and-drop groups."),layout:s.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:s.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:s.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:s.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:s.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:J.MediaItemSchema.optional().describe("Shared background image/color for all groups."),itemBackground:J.MediaItemSchema.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:s.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:s.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:s.z.number().optional().describe("Proportion ratio for split layout.")})});var xe=g(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.ChartContentSchema=P.ChartConfigSchema=P.ChartTypeSchema=void 0;var f=require("zod");P.ChartTypeSchema=f.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]);P.ChartConfigSchema=f.z.object({colors:f.z.array(f.z.string()).optional(),xAxisLabel:f.z.string().optional(),yAxisLabel:f.z.string().optional(),showLegend:f.z.boolean().optional(),showTooltip:f.z.boolean().optional(),stacked:f.z.boolean().optional(),seriesNames:f.z.record(f.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")});P.ChartContentSchema=f.z.object({chartType:P.ChartTypeSchema.optional(),chartData:f.z.array(f.z.record(f.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:P.ChartConfigSchema.optional()})});var ke=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.PuzzleContentSchema=D.PuzzleTypeSchema=D.PuzzleGameModeSchema=void 0;var A=require("zod"),Ye=w();D.PuzzleGameModeSchema=A.z.enum(["scattered","rotated","scattered_rotated"]);D.PuzzleTypeSchema=A.z.enum(["swap","slide"]);D.PuzzleContentSchema=A.z.object({image:A.z.union([A.z.string(),Ye.MediaItemSchema]).optional().describe("Image URL or MediaItem for puzzle."),pieces:A.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:D.PuzzleGameModeSchema.optional(),puzzleType:D.PuzzleTypeSchema.optional(),showNumbers:A.z.union([A.z.boolean(),A.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:A.z.string().optional().describe("Deterministic seed for piece placement.")})});var Te=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.BasicContentSchema=void 0;var H=require("zod"),Xe=w();U.BasicContentSchema=H.z.object({content:H.z.any().optional().describe("For Editor: Plate JSON content array."),url:H.z.string().optional().describe("For Media or Embed: content URL."),text:H.z.string().optional().describe("For Shape: text inside shape."),mediaType:Xe.MediaTypeSchema.optional().describe("For Media: media type.")})});var Ce=g(b=>{"use strict";var Ze=b&&b.__createBinding||(Object.create?(function(t,n,i,r){r===void 0&&(r=i);var a=Object.getOwnPropertyDescriptor(n,i);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,a)}):(function(t,n,i,r){r===void 0&&(r=i),t[r]=n[i]})),M=b&&b.__exportStar||function(t,n){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Ze(n,t,i)};Object.defineProperty(b,"__esModule",{value:!0});M(de(),b);M(ue(),b);M(he(),b);M(Se(),b);M(be(),b);M(ze(),b);M(ge(),b);M(fe(),b);M(xe(),b);M(ke(),b);M(Te(),b)});var Be=g(j=>{"use strict";var eo=j&&j.__createBinding||(Object.create?(function(t,n,i,r){r===void 0&&(r=i);var a=Object.getOwnPropertyDescriptor(n,i);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,a)}):(function(t,n,i,r){r===void 0&&(r=i),t[r]=n[i]})),oo=j&&j.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),to=j&&j.__importStar||(function(){var t=function(n){return t=Object.getOwnPropertyNames||function(i){var r=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[r.length]=a);return r},t(n)};return function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var r=t(n),a=0;a<r.length;a++)r[a]!=="default"&&eo(i,n,r[a]);return oo(i,n),i}})();Object.defineProperty(j,"__esModule",{value:!0});j.BLOCK_CONTENT_SCHEMAS=void 0;j.generateBlockReference=ro;var no=to(require("zod-to-json-schema")),io=no.zodToJsonSchema,p=Ce();j.BLOCK_CONTENT_SCHEMAS={Quiz:p.QuizContentSchema,Cloze:p.ClozeContentSchema,Crossword:p.CrosswordContentSchema,WordSearch:p.WordSearchContentSchema,Anagram:p.AnagramContentSchema,Memory:p.PairGameContentSchema,MatchPairs:p.PairGameContentSchema,Flashcard:p.DeckContentSchema,CardDeck:p.DeckContentSchema,Dice:p.DiceContentSchema,SpinningWheel:p.SpinnerContentSchema,DragAndDrop:p.DragAndDropContentSchema,Chart:p.ChartContentSchema,Puzzle:p.PuzzleContentSchema,Editor:p.BasicContentSchema,Media:p.BasicContentSchema,Embed:p.BasicContentSchema,Shape:p.BasicContentSchema};function ao(t,n,i,r){let a=i?"*required*":"optional",z=te(n),h=n.description?` \u2014 ${n.description}`:"";return`${r}- \`${t}\` (${z}, ${a})${h}`}function te(t){return t.enum?`enum: ${t.enum.map(n=>JSON.stringify(n)).join(" | ")}`:t.anyOf||t.oneOf?(t.anyOf||t.oneOf).map(te).join(" | "):Array.isArray(t.type)?t.type.join(" | "):t.type==="array"&&t.items?`array<${te(t.items)}>`:t.type==="object"?"object":t.type??"any"}function ne(t,n){let i=[],r=new Set(t.required??[]),a=t.properties??{};for(let[z,h]of Object.entries(a))i.push(ao(z,h,r.has(z),n)),h.type==="object"&&h.properties?i.push(ne(h,n+" ")):h.type==="array"&&h.items?.type==="object"&&i.push(ne(h.items,n+" "));return i.join(`
|
|
2
|
-
|
|
3
|
-
${h||"_(no configurable fields)_"}`)}return t.join(`
|
|
1
|
+
"use strict";var zo=Object.create;var de=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var g=(a,i)=>()=>{try{return i||a((i={exports:{}}).exports,i),i.exports}catch(n){throw i=0,n}},Be=(a,i)=>{for(var n in i)de(a,n,{get:i[n],enumerable:!0})},me=(a,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of bo(i))!yo.call(a,l)&&l!==n&&de(a,l,{get:()=>i[l],enumerable:!(c=So(i,l))||c.enumerable});return a},I=(a,i,n)=>(me(a,i,"default"),n&&me(n,i,"default")),Qe=(a,i,n)=>(n=a!=null?zo(go(a)):{},me(i||!a||!a.__esModule?de(n,"default",{value:a,enumerable:!0}):n,a)),fo=a=>me(de({},"__esModule",{value:!0}),a);var _e=g(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.BlockTypeSchema=oe.BLOCK_TYPES=void 0;var To=require("zod");oe.BLOCK_TYPES=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"];oe.BlockTypeSchema=To.z.enum(oe.BLOCK_TYPES)});var L=g(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.MediaRefSchema=S.MediaItemSchema=S.VideoSettingsSchema=S.CropDataSchema=S.MediaSourceSchema=S.MediaTypeSchema=S.GridSizeSchema=S.SizeSchema=S.PositionSchema=void 0;var m=require("zod");S.PositionSchema=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()});S.SizeSchema=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()});S.GridSizeSchema=m.z.object({rows:m.z.number(),cols:m.z.number()});S.MediaTypeSchema=m.z.enum(["image","color","gif","shape","illustration","video","audio"]);S.MediaSourceSchema=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]);S.CropDataSchema=m.z.object({x:m.z.number(),y:m.z.number(),width:m.z.number(),height:m.z.number(),zoom:m.z.number().optional(),rotation:m.z.number().optional(),aspect:m.z.number().optional()});S.VideoSettingsSchema=m.z.object({autoplay:m.z.boolean().optional(),loop:m.z.boolean().optional(),muted:m.z.boolean().optional(),controls:m.z.boolean().optional(),poster:m.z.string().optional(),volume:m.z.number().optional()});S.MediaItemSchema=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:S.MediaTypeSchema,source:S.MediaSourceSchema.optional(),alt:m.z.string().optional(),width:m.z.number().optional(),height:m.z.number().optional(),format:m.z.enum(["cover","contain"]).optional(),color:m.z.string().optional(),cropData:S.CropDataSchema.optional(),duration:m.z.number().optional(),videoSettings:S.VideoSettingsSchema.optional()});S.MediaRefSchema=S.MediaItemSchema});var pe=g(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ShapeBlockThemeSchema=r.MatchPairsBlockThemeSchema=r.FlashcardBlockThemeSchema=r.CardDeckBlockThemeSchema=r.ClozeBlockThemeSchema=r.SpinningWheelBlockThemeSchema=r.MemoryBlockThemeSchema=r.WordSearchBlockThemeSchema=r.CrosswordBlockThemeSchema=r.DiceBlockThemeSchema=r.AnagramBlockThemeSchema=r.EditorBlockThemeSchema=r.DragAndDropBlockThemeSchema=r.QuizBlockThemeSchema=r.HotpointBlockThemeSchema=r.BlockThemeSchema=r.TextStylesSchema=r.BoxStylesSchema=r.RadiusSchema=r.BoxSideSchema=r.AnimationSchema=void 0;var o=require("zod"),je=L();r.AnimationSchema=o.z.object({type:o.z.union([o.z.enum(["none","fade","direction","bounce","scale","rotate"]),o.z.string()]),duration:o.z.number().optional(),delay:o.z.number().optional(),phase:o.z.enum(["in","both","out"]).optional(),direction:o.z.enum(["up","right","down","left"]).optional()});r.BoxSideSchema=o.z.object({top:o.z.union([o.z.string(),o.z.number()]).optional(),right:o.z.union([o.z.string(),o.z.number()]).optional(),bottom:o.z.union([o.z.string(),o.z.number()]).optional(),left:o.z.union([o.z.string(),o.z.number()]).optional()});r.RadiusSchema=o.z.object({topLeft:o.z.union([o.z.string(),o.z.number()]).optional(),topRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomLeft:o.z.union([o.z.string(),o.z.number()]).optional()});r.BoxStylesSchema=o.z.object({background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),backgroundOpacity:o.z.number().optional(),backgroundMedia:je.MediaItemSchema.optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:r.BoxSideSchema.optional(),borderRadius:r.RadiusSchema.optional(),padding:o.z.union([o.z.string(),o.z.number(),r.BoxSideSchema]).optional()});r.TextStylesSchema=o.z.object({color:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),fontWeight:o.z.union([o.z.string(),o.z.number()]).optional(),textAlign:o.z.enum(["left","center","right","justify"]).optional()});var K=r.BoxStylesSchema.merge(r.TextStylesSchema);r.BlockThemeSchema=o.z.object({spacing:o.z.enum(["no-spacing","small","medium","large"]).optional(),animation:r.AnimationSchema.optional(),styles:o.z.record(o.z.record(o.z.any())).optional()});r.HotpointBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({hotpoint:o.z.object({icon:o.z.string().optional(),iconPosition:o.z.enum(["left","right"]).optional(),iconSize:o.z.string().optional(),iconColor:o.z.string().optional(),image:je.MediaItemSchema.optional(),imageFormat:o.z.enum(["circle","square","custom"]).optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:o.z.string().optional(),borderRadius:o.z.string().optional(),glow:o.z.boolean().optional(),glowColor:o.z.string().optional(),background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),textColor:o.z.string().optional()}).optional()}).optional()});r.QuizBlockThemeSchema=r.BlockThemeSchema.extend({layout:o.z.enum(["horizontal","vertical","grid"]),gridColumns:o.z.number().optional(),preset:o.z.enum(["default","modern","trivia","custom"]),styles:o.z.object({general:K,question:K,answers:K.extend({customStyles:o.z.array(o.z.object({color:o.z.string().optional(),backgroundColor:o.z.string().optional(),targets:o.z.string().optional()})).optional(),hover:K.optional()}),button:K.extend({variant:o.z.enum(["default","outline","ghost"]).optional(),hover:K.optional()})}).optional()});r.DragAndDropBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),gridColumns:o.z.number().optional(),gridGap:o.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:o.z.object({x:o.z.number().optional(),y:o.z.number().optional(),width:o.z.number().optional(),height:o.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:o.z.object({title:r.TextStylesSchema.optional(),sandbox:r.BoxStylesSchema.optional(),item:K.optional(),group:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.extend({url:o.z.string().optional(),type:je.MediaTypeSchema.optional()}).optional(),groups:K.optional(),feedback:o.z.object({correct:o.z.string().optional(),incorrect:o.z.string().optional(),active:o.z.string().optional()}).optional(),referenceSize:o.z.object({width:o.z.number(),height:o.z.number()}).optional()}).optional()});r.EditorBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({editor:r.BoxStylesSchema.optional()}).optional()});r.AnagramBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({letter:r.BoxStylesSchema.optional(),letterText:r.TextStylesSchema.optional(),slot:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.DiceBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({button:r.BoxStylesSchema.extend({hover:K.optional()}).optional(),buttonText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.CrosswordBlockThemeSchema=r.BlockThemeSchema.extend({primaryColor:o.z.string().optional(),layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),clueContainer:r.BoxStylesSchema.optional(),clueText:r.TextStylesSchema.optional(),clueTitle:r.TextStylesSchema.optional()}).optional()});r.WordSearchBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({wordSearch:o.z.object({primaryColor:o.z.string().optional(),highlightColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),textColor:o.z.string().optional(),cellBackgroundColor:o.z.string().optional()}).optional(),text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),wordListContainer:r.BoxStylesSchema.optional(),wordListText:r.TextStylesSchema.optional(),wordListTitle:r.TextStylesSchema.optional()}).optional()});r.MemoryBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),infoContainer:r.BoxStylesSchema.optional(),infoText:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional()}).optional()});r.SpinningWheelBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({wheelText:r.TextStylesSchema.optional()}).optional()});r.ClozeBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),wordBank:r.BoxStylesSchema.optional(),word:r.BoxStylesSchema.optional(),blank:r.BoxStylesSchema.optional()}).optional()});r.CardDeckBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({card:r.BoxStylesSchema.optional(),cardText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.FlashcardBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({cardFront:r.BoxStylesSchema.optional(),cardBack:r.BoxStylesSchema.optional(),frontText:r.TextStylesSchema.optional(),backText:r.TextStylesSchema.optional(),navigation:r.BoxStylesSchema.optional(),navigationText:r.TextStylesSchema.optional()}).optional()});r.MatchPairsBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.ShapeBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({shape:K.extend({fillColor:o.z.string().optional(),textColor:o.z.string().optional(),borderStyle:o.z.enum(["solid","dashed","dotted"]).optional(),padding:o.z.number().optional()}).optional()}).optional()})});var Ve=g(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.UNSTYLEABLE_BLOCKS=C.BLOCK_STYLE_KEYS=C.STYLE_TARGET_MAP=void 0;C.realStyleKeysFor=xo;C.styleTargetsHelpFor=Co;C.mapLogicalThemeStyles=Ie;C.mergeTheme=wo;C.STYLE_TARGET_MAP={quiz:{title:["question"],answers:["answers"],button:["button"],general:["general"]},poll:{title:["question"],answers:["answers"],button:["button"],general:["general"]},flashcard:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},memory:{title:["text"],answers:["card"],general:["container"]},matchpairs:{title:["text"],answers:["card"],general:["container"]},cloze:{title:["text"],answers:["word","blank"],general:["container"]},carddeck:{title:["cardText"],answers:["card"],general:["container"]},anagram:{title:["letterText"],answers:["letter","slot"],general:["container"]},dice:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},crossword:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},wordsearch:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},spinningwheel:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},shape:{title:["shape"],answers:["shape"],general:["shape"]},hotpoint:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},editor:{title:["editor"],answers:["editor"],general:["editor"]},draganddrop:{title:["title"],answers:["item"],general:["container"]}};function xo(a){let i=C.STYLE_TARGET_MAP[a.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let l of c??[])n.add(l);return[...n]}C.BLOCK_STYLE_KEYS={quiz:["general","question","answers","button"],poll:["general","question","answers","button"],flashcard:["cardFront","cardBack","frontText","backText","navigation","navigationText"],memory:["container","card","text","infoContainer","infoText"],matchpairs:["container","card","text"],cloze:["container","text","wordBank","word","blank"],carddeck:["container","card","cardText"],anagram:["container","letter","letterText","slot"],dice:["container","button","buttonText"],crossword:["grid","cell","text","clueContainer","clueTitle","clueText"],wordsearch:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],spinningwheel:["wheelText"],shape:["shape"],editor:["editor"],hotpoint:["hotpoint"],draganddrop:["container","title","sandbox","groups","item","group"]};C.UNSTYLEABLE_BLOCKS=new Set(["chart","media","image","puzzle"]);function Co(a){if(!a)return"";let i=a.toLowerCase();if(C.UNSTYLEABLE_BLOCKS.has(i))return`
|
|
2
|
+
[STYLE TARGETS] Il blocco "${a}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let n=C.BLOCK_STYLE_KEYS[i];if(!n||n.length===0)return"";let c=C.STYLE_TARGET_MAP[i]??{},l=["general","title","answers","button"].filter(h=>c[h]).map(h=>`${h}\u2192${c[h].join("/")}`).join(", ");return`
|
|
3
|
+
[STYLE TARGETS for ${a}] Logical targets (update_block_theme): ${l}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Ie(a,i){if(!a)return a;let n={...a};for(let[Z,W]of Object.entries(n))if(W&&typeof W=="object"){let E={...W},k=!1;E.backgroundColor!==void 0&&E.background===void 0&&(E.background=!0,k=!0),E.borderColor!==void 0&&E.border===void 0&&(E.border=!0,k=!0),k&&(n[Z]=E)}if(!i)return n;let c=C.STYLE_TARGET_MAP[i.toLowerCase()];if(!c)return n;let l=(Z,W)=>{W&&(n[Z]={...n[Z]||{},...W})},h=["title","answers","button","general"],u={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let Z of h){let W=u[Z],E=c[Z];if(W&&E)for(let k of E)l(k,W)}return n}function wo(a,i,n){if(!a){let u={...i};return u.styles&&(u.styles=Ie(u.styles,n)),u}if(!i)return a;let c={...a,...i},l=Ie(i.styles,n),h=a.styles||{};if(a.styles||l){c.styles={...h,...l};for(let u of Object.keys(c.styles))h[u]&&l?.[u]&&(c.styles[u]={...h[u],...l[u]})}return c}});var Me=g(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.BlockEventSchema=d.ActivityVariableSchema=d.ActionSchema=d.ActionVariableSchema=d.ActionTypeSchema=d.MathOperationSchema=d.ActionConditionSchema=d.KeyPressConditionSchema=d.ClickConditionSchema=d.TimerConditionSchema=d.QuizConditionSchema=d.ConditionOperatorSchema=d.BlockEventTypeSchema=void 0;var s=require("zod");d.BlockEventTypeSchema=s.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]);d.ConditionOperatorSchema=s.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]);d.QuizConditionSchema=s.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]);d.TimerConditionSchema=s.z.enum(["completed","half_way"]);d.ClickConditionSchema=s.z.enum(["single_click","double_click"]);d.KeyPressConditionSchema=s.z.literal("key_pressed");d.ActionConditionSchema=s.z.object({event:d.BlockEventTypeSchema.optional(),variableName:s.z.string().optional(),operator:d.ConditionOperatorSchema.optional(),value:s.z.any()});d.MathOperationSchema=s.z.enum(["set","add","subtract","multiply","divide"]);d.ActionTypeSchema=s.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]);d.ActionVariableSchema=s.z.object({name:s.z.string(),value:s.z.union([s.z.number(),s.z.string(),s.z.boolean()]),operation:d.MathOperationSchema.optional()});d.ActionSchema=s.z.object({id:s.z.string(),type:d.ActionTypeSchema,condition:d.ActionConditionSchema.optional(),conditions:s.z.array(d.ActionConditionSchema).optional(),conditionsOperator:s.z.enum(["and","or"]).optional(),modalContent:s.z.string().optional(),audioUrl:s.z.string().optional(),linkUrl:s.z.string().optional(),targetSceneId:s.z.string().optional(),targetBlockId:s.z.string().optional(),direction:s.z.enum(["up","down","left","right"]).optional(),distance:s.z.number().optional(),variable:d.ActionVariableSchema.optional()});d.ActivityVariableSchema=s.z.object({name:s.z.string(),defaultValue:s.z.union([s.z.string(),s.z.number(),s.z.boolean()])});d.BlockEventSchema=s.z.object({type:d.BlockEventTypeSchema,blockId:s.z.string(),data:s.z.record(s.z.any()).optional()})});var ue=g(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.QuestionSchema=z.TextQuestionSchema=z.TrueFalseQuestionSchema=z.ChoiceQuestionSchema=z.QuestionOptionSchema=z.ImageSizeSchema=z.ImageAlignSchema=z.QuestionTypeSchema=void 0;var b=require("zod"),Ue=L();z.QuestionTypeSchema=b.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);z.ImageAlignSchema=b.z.enum(["left","right","center"]);z.ImageSizeSchema=b.z.object({width:b.z.number().optional(),height:b.z.number().optional()});z.QuestionOptionSchema=b.z.object({id:b.z.string(),text:b.z.string(),isCorrect:b.z.boolean(),image:Ue.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()});var ve={id:b.z.string(),text:b.z.string(),score:b.z.number().optional(),image:Ue.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()};z.ChoiceQuestionSchema=b.z.object({...ve,type:b.z.enum(["single-choice","multiple-choice"]),options:b.z.array(z.QuestionOptionSchema)});z.TrueFalseQuestionSchema=b.z.object({...ve,type:b.z.literal("true-false"),correctAnswer:b.z.boolean()});z.TextQuestionSchema=b.z.object({...ve,type:b.z.enum(["short-answers","long-answers"]),minCharacters:b.z.number().optional(),maxCharacters:b.z.number().optional()});z.QuestionSchema=b.z.discriminatedUnion("type",[z.ChoiceQuestionSchema,z.TrueFalseQuestionSchema,z.TextQuestionSchema])});var Ae=g(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.PuzzleContentSchema=Y.PuzzleTypeSchema=Y.PuzzleGameModeSchema=void 0;var H=require("zod"),_o=L();Y.PuzzleGameModeSchema=H.z.enum(["scattered","rotated","scattered_rotated"]);Y.PuzzleTypeSchema=H.z.enum(["swap","slide"]);Y.PuzzleContentSchema=H.z.object({image:H.z.union([H.z.string(),_o.MediaItemSchema]).optional().describe("Image URL or MediaItem for puzzle."),pieces:H.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:Y.PuzzleGameModeSchema.optional(),puzzleType:Y.PuzzleTypeSchema.optional(),showNumbers:H.z.union([H.z.boolean(),H.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:H.z.string().optional().describe("Deterministic seed for piece placement.")})});var Je=g(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CanvasDragItemSchema=t.ActivityContentSchema=t.SceneSchema=t.BlockGroupSchema=t.BlockSchema=t.ArrowBlockSchema=t.ShapeBlockSchema=t.CardDeckBlockSchema=t.ClozeBlockSchema=t.MatchPairsBlockSchema=t.ChartBlockSchema=t.SpinningWheelBlockSchema=t.FlashcardBlockSchema=t.MemoryBlockSchema=t.WordSearchBlockSchema=t.WordSearchDifficultySchema=t.CrosswordBlockSchema=t.PuzzleBlockSchema=t.DiceBlockSchema=t.AnagramBlockSchema=t.DragAndDropBlockSchema=t.EmbedBlockSchema=t.MediaBlockSchema=t.EditorBlockSchema=t.HotpointBlockSchema=t.QuizBlockSchema=t.ArrowLabelSchema=t.ArrowHeadTypeSchema=t.ShapeTypeSchema=t.MatchPairsPairSchema=t.CardItemSchema=t.FlashcardItemSchema=t.FlashcardContentSchema=t.WheelSliceSchema=t.MemoryPairSchema=t.WordSearchDataSchema=t.CrosswordLayoutOutputSchema=t.CrosswordLayoutWordSchema=t.CrosswordCellSchema=t.DiceTypeSchema=t.DragAndDropGroupSchema=t.DragAndDropItemSchema=t.ActionBlockSchema=t.SceneTypeSchema=void 0;var e=require("zod"),jo=_e(),B=L(),y=pe(),Io=ue(),Mo=Me(),vo=Ae();t.SceneTypeSchema=e.z.enum(["2D","360\xB0"]);var se={id:e.z.string(),type:jo.BlockTypeSchema,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:B.PositionSchema.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:B.SizeSchema.optional(),minSize:B.SizeSchema.optional(),maxSize:B.SizeSchema.optional(),theme:y.BlockThemeSchema.optional()},w={...se,actions:e.z.array(Mo.ActionSchema).optional(),score:e.z.number().optional()};t.ActionBlockSchema=e.z.object(w);t.DragAndDropItemSchema=e.z.object({id:e.z.string(),text:e.z.string(),background:B.MediaItemSchema.optional(),opacity:e.z.number().optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional()});t.DragAndDropGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),background:B.MediaItemSchema.optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),singleItem:e.z.boolean().optional(),opacity:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional(),items:e.z.array(t.DragAndDropItemSchema)});t.DiceTypeSchema=e.z.enum(["d4","d6","d8","d10","d12","d20"]);t.CrosswordCellSchema=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()});t.CrosswordLayoutWordSchema=e.z.object({answer:e.z.string(),clue:e.z.string(),image:B.MediaItemSchema.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()});t.CrosswordLayoutOutputSchema=e.z.object({grid:e.z.array(e.z.array(t.CrosswordCellSchema)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(t.CrosswordLayoutWordSchema)});t.WordSearchDataSchema=e.z.object({grid:e.z.array(e.z.array(e.z.string())),placedWords:e.z.array(e.z.object({word:e.z.string(),clean:e.z.string(),path:e.z.array(e.z.object({x:e.z.number(),y:e.z.number()}))}))});t.MemoryPairSchema=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]),content:e.z.tuple([e.z.string(),e.z.string()])});t.WheelSliceSchema=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional(),image:B.MediaItemSchema.optional()});t.FlashcardContentSchema=e.z.object({type:e.z.enum(["text","image"]),content:e.z.any()});t.FlashcardItemSchema=e.z.object({id:e.z.string(),front:t.FlashcardContentSchema,back:t.FlashcardContentSchema});t.CardItemSchema=e.z.object({id:e.z.string(),frontImage:B.MediaItemSchema.optional(),frontText:e.z.string().optional()});t.MatchPairsPairSchema=e.z.object({id:e.z.string(),leftLabel:e.z.string(),rightLabel:e.z.string(),leftImage:e.z.any().optional(),rightImage:e.z.any().optional()});t.ShapeTypeSchema=e.z.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]);t.ArrowHeadTypeSchema=e.z.enum(["none","arrow","circle","square"]);t.ArrowLabelSchema=e.z.object({id:e.z.string(),text:e.z.string(),t:e.z.number(),offsetX:e.z.number().optional(),offsetY:e.z.number().optional(),fontSize:e.z.number().optional(),color:e.z.string().optional(),backgroundColor:e.z.string().optional()});t.QuizBlockSchema=e.z.object({...w,type:e.z.literal("Quiz"),questions:e.z.array(Io.QuestionSchema).optional(),previewIndex:e.z.number().optional(),required:e.z.boolean().optional(),showResults:e.z.boolean().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional(),submitText:e.z.string().optional(),timer:e.z.string().optional(),showQuestionCount:e.z.boolean().optional(),theme:y.QuizBlockThemeSchema});t.HotpointBlockSchema=e.z.object({...w,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional(),element:e.z.enum(["image","button"]),theme:y.HotpointBlockThemeSchema.optional()});t.EditorBlockSchema=e.z.object({...w,type:e.z.literal("Editor"),content:e.z.any().optional(),readonly:e.z.boolean().optional(),theme:y.EditorBlockThemeSchema.optional()});t.MediaBlockSchema=e.z.object({...se,type:e.z.literal("Media"),media:B.MediaItemSchema.optional()});t.EmbedBlockSchema=e.z.object({...se,type:e.z.literal("Embed"),url:e.z.string().optional(),readOnly:e.z.boolean().optional()});t.DragAndDropBlockSchema=e.z.object({...w,type:e.z.literal("DragAndDrop"),groups:e.z.array(t.DragAndDropGroupSchema),theme:y.DragAndDropBlockThemeSchema.optional(),showResults:e.z.boolean().optional(),layout:e.z.enum(["manual","split"]).optional(),itemArrangement:e.z.enum(["random","list","grid"]).optional(),groupBackground:B.MediaItemSchema.optional(),enableWrongAnswers:e.z.boolean().optional(),itemBackground:B.MediaItemSchema.optional(),groupBackgroundOpacity:e.z.number().optional(),itemBackgroundOpacity:e.z.number().optional(),splitRatio:e.z.number().optional()});t.AnagramBlockSchema=e.z.object({...w,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()),correctWord:e.z.string(),theme:y.AnagramBlockThemeSchema.optional(),clue:e.z.string().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional()});t.DiceBlockSchema=e.z.object({...w,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional(),diceType:t.DiceTypeSchema.optional(),faceOverrides:e.z.any().optional(),color:e.z.string().optional(),showNumber:e.z.boolean().optional(),diceCount:e.z.number().optional(),dicePool:e.z.record(e.z.number()).optional(),persistent:e.z.boolean().optional(),theme:y.DiceBlockThemeSchema.optional()});t.PuzzleBlockSchema=e.z.object({...w,type:e.z.literal("Puzzle"),image:B.MediaItemSchema.optional(),pieces:e.z.number().optional(),gameMode:vo.PuzzleGameModeSchema.optional(),puzzleType:e.z.enum(["swap","slide"]).optional(),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional(),seed:e.z.string().optional()});t.CrosswordBlockSchema=e.z.object({...w,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string(),clue:e.z.string(),image:B.MediaItemSchema.optional()})).optional(),layout:t.CrosswordLayoutOutputSchema.optional(),theme:y.CrosswordBlockThemeSchema.optional()});t.WordSearchDifficultySchema=e.z.enum(["easy","medium","hard"]);t.WordSearchBlockSchema=e.z.object({...w,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional(),gridSize:B.GridSizeSchema.optional(),difficulty:t.WordSearchDifficultySchema.optional(),data:t.WordSearchDataSchema.optional(),theme:y.WordSearchBlockThemeSchema.optional()});t.MemoryBlockSchema=e.z.object({...w,type:e.z.literal("Memory"),pairs:e.z.array(t.MemoryPairSchema),gridSize:B.GridSizeSchema.optional(),hideScore:e.z.boolean().optional(),theme:y.MemoryBlockThemeSchema.optional()});t.FlashcardBlockSchema=e.z.object({...w,type:e.z.literal("Flashcard"),cards:e.z.array(t.FlashcardItemSchema),theme:y.FlashcardBlockThemeSchema.optional()});t.SpinningWheelBlockSchema=e.z.object({...w,type:e.z.literal("SpinningWheel"),slices:e.z.array(t.WheelSliceSchema),spinDuration:e.z.number().optional(),theme:y.SpinningWheelBlockThemeSchema.optional()});t.ChartBlockSchema=e.z.object({...w,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),chartData:e.z.array(e.z.any()),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional(),xAxisLabel:e.z.string().optional(),yAxisLabel:e.z.string().optional(),showLegend:e.z.boolean().optional(),showTooltip:e.z.boolean().optional(),stacked:e.z.boolean().optional(),seriesNames:e.z.record(e.z.string()).optional()})});t.MatchPairsBlockSchema=e.z.object({...w,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional(),pairs:e.z.array(t.MatchPairsPairSchema),theme:y.MatchPairsBlockThemeSchema.optional()});t.ClozeBlockSchema=e.z.object({...w,type:e.z.literal("Cloze"),templateText:e.z.string().optional(),theme:y.ClozeBlockThemeSchema.optional(),mode:e.z.enum(["write","drag-drop"]).optional()});t.CardDeckBlockSchema=e.z.object({...w,type:e.z.literal("CardDeck"),cards:e.z.array(t.CardItemSchema),backImage:B.MediaItemSchema.optional(),discardLogic:e.z.enum(["delete","return"]),theme:y.CardDeckBlockThemeSchema.optional()});t.ShapeBlockSchema=e.z.object({...se,type:e.z.literal("Shape"),shapeType:t.ShapeTypeSchema.optional(),text:e.z.string().optional(),theme:y.ShapeBlockThemeSchema.optional()});t.ArrowBlockSchema=e.z.object({...se,type:e.z.literal("Arrow"),startBlockId:e.z.string(),endBlockId:e.z.string().optional(),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional(),startHandle:e.z.enum(["top","right","bottom","left"]),endHandle:e.z.enum(["top","right","bottom","left"]).optional(),connectionType:e.z.enum(["straight","orthogonal","curved"]),strokeColor:e.z.string().optional(),strokeWidth:e.z.number().optional(),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional(),showHead:e.z.boolean().optional(),startHead:t.ArrowHeadTypeSchema.optional(),endHead:t.ArrowHeadTypeSchema.optional(),bendOffsetX:e.z.number().optional(),bendOffsetY:e.z.number().optional(),segmentCount:e.z.number().optional(),bendOffsets:e.z.array(e.z.number()).optional(),labels:e.z.array(t.ArrowLabelSchema).optional()});t.BlockSchema=e.z.discriminatedUnion("type",[t.QuizBlockSchema,t.HotpointBlockSchema,t.EditorBlockSchema,t.EmbedBlockSchema,t.MediaBlockSchema,t.DragAndDropBlockSchema,t.AnagramBlockSchema,t.DiceBlockSchema,t.PuzzleBlockSchema,t.CrosswordBlockSchema,t.WordSearchBlockSchema,t.MemoryBlockSchema,t.FlashcardBlockSchema,t.SpinningWheelBlockSchema,t.ChartBlockSchema,t.MatchPairsBlockSchema,t.ShapeBlockSchema,t.ArrowBlockSchema,t.ClozeBlockSchema,t.CardDeckBlockSchema]);t.BlockGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()});t.SceneSchema=e.z.object({id:e.z.string(),title:e.z.string(),type:t.SceneTypeSchema,background:e.z.union([e.z.string(),e.z.array(e.z.string()),B.MediaItemSchema]).optional(),backgroundColor:e.z.string().optional(),backgroundAutoplay:e.z.boolean().optional(),backgroundLoop:e.z.boolean().optional(),secretCode:e.z.string().optional(),hidden:e.z.boolean().optional(),blocks:e.z.array(t.BlockSchema),groups:e.z.array(t.BlockGroupSchema).optional(),canvas:e.z.object({width:e.z.number().optional(),height:e.z.number().optional(),preset:e.z.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()});t.ActivityContentSchema=e.z.object({id:e.z.string(),title:e.z.string(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(t.SceneSchema),variables:e.z.array(e.z.object({name:e.z.string(),defaultValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean()])})).optional(),audio:e.z.array(e.z.object({id:e.z.string(),media:B.MediaItemSchema.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()});t.CanvasDragItemSchema=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:t.BlockSchema})});var Xe=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.ActivityContextSchema=$.SceneSummarySchema=$.SceneBlockRefSchema=void 0;var M=require("zod");$.SceneBlockRefSchema=M.z.object({id:M.z.string(),type:M.z.string(),title:M.z.string()});$.SceneSummarySchema=M.z.object({id:M.z.string(),title:M.z.string(),position:M.z.number(),blocks:M.z.array($.SceneBlockRefSchema).default([])});$.ActivityContextSchema=M.z.object({activity:M.z.object({id:M.z.string(),title:M.z.string(),scenes:M.z.array($.SceneSummarySchema).default([])}),activeSceneId:M.z.string().nullable().optional()})});var eo=g(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.QuizContentSchema=P.QuizQuestionSchema=P.QuizOptionSchema=P.QuizQuestionTypeSchema=void 0;var f=require("zod"),Ze=L(),he=ue();P.QuizQuestionTypeSchema=f.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);P.QuizOptionSchema=f.z.object({id:f.z.string().optional(),text:f.z.string(),isCorrect:f.z.boolean(),image:Ze.MediaItemSchema.optional().describe("Option image."),imageAlign:he.ImageAlignSchema.optional().describe("Option image alignment."),imageSize:he.ImageSizeSchema.optional().describe("Option image size.")});P.QuizQuestionSchema=f.z.object({id:f.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:P.QuizQuestionTypeSchema,text:f.z.string().describe("The question text."),score:f.z.number().optional(),options:f.z.array(P.QuizOptionSchema).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:f.z.boolean().optional().describe("Required for true-false."),image:Ze.MediaItemSchema.optional().describe("Question image."),imageAlign:he.ImageAlignSchema.optional().describe("Question image alignment."),imageSize:he.ImageSizeSchema.optional().describe("Question image size.")});P.QuizContentSchema=f.z.object({questions:f.z.array(P.QuizQuestionSchema).describe("Array of question objects."),showResults:f.z.boolean().optional(),allowRetry:f.z.boolean().optional(),maxRetry:f.z.string().optional(),required:f.z.boolean().optional(),submitText:f.z.string().optional().describe("Label for submit button."),timer:f.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:f.z.boolean().optional().describe("Show current/total questions count.")})});var oo=g(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.ClozeContentSchema=te.ClozeModeSchema=void 0;var Oe=require("zod");te.ClozeModeSchema=Oe.z.enum(["write","drag-drop"]);te.ClozeContentSchema=Oe.z.object({templateText:Oe.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:te.ClozeModeSchema.optional().describe("Input mode. Default: write.")})});var no=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.AnagramContentSchema=D.WordSearchContentSchema=D.CrosswordContentSchema=D.CrosswordWordSchema=D.WordGameBlockTypeSchema=void 0;var v=require("zod"),to=L();D.WordGameBlockTypeSchema=v.z.enum(["Crossword","WordSearch","Anagram"]);D.CrosswordWordSchema=v.z.object({answer:v.z.string(),clue:v.z.string(),image:to.MediaItemSchema.optional().describe("Clue image.")});D.CrosswordContentSchema=v.z.object({words:v.z.array(D.CrosswordWordSchema)});D.WordSearchContentSchema=v.z.object({words:v.z.array(v.z.string()),gridSize:to.GridSizeSchema.optional().describe("Grid dimensions."),difficulty:v.z.enum(["easy","medium","hard"]).optional()});D.AnagramContentSchema=v.z.object({correctWord:v.z.string().describe("The correct word."),letters:v.z.array(v.z.string()).optional(),clue:v.z.string().optional().describe("A hint.")})});var ao=g(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.PairGameContentSchema=F.PairSchema=F.MemoryPairTypeSchema=F.PairGameBlockTypeSchema=void 0;var N=require("zod"),Pe=L();F.PairGameBlockTypeSchema=N.z.enum(["Memory","MatchPairs"]);F.MemoryPairTypeSchema=N.z.enum(["img-img","img-word","word-word"]);F.PairSchema=N.z.object({id:N.z.string().optional(),type:F.MemoryPairTypeSchema.optional().describe("For Memory: pair type."),content:N.z.array(N.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:N.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:N.z.string().optional().describe("For MatchPairs: right side text."),leftImage:Pe.MediaItemSchema.optional().describe("For MatchPairs: left side image."),rightImage:Pe.MediaItemSchema.optional().describe("For MatchPairs: right side image.")});F.PairGameContentSchema=N.z.object({pairs:N.z.array(F.PairSchema).describe("Array of pair objects."),gridSize:Pe.GridSizeSchema.optional().describe("For Memory: grid dimensions."),instructions:N.z.string().optional().describe("For MatchPairs: instruction text.")})});var io=g(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.DeckContentSchema=q.CardSchema=q.CardFaceSchema=q.DeckBlockTypeSchema=void 0;var R=require("zod");q.DeckBlockTypeSchema=R.z.enum(["Flashcard","CardDeck"]);q.CardFaceSchema=R.z.object({type:R.z.enum(["text","image"]),content:R.z.any()});q.CardSchema=R.z.object({id:R.z.string().optional(),front:q.CardFaceSchema.optional().describe("For Flashcard: front side."),back:q.CardFaceSchema.optional().describe("For Flashcard: back side."),frontText:R.z.string().optional().describe("For CardDeck: front text."),frontImage:R.z.any().optional().describe("For CardDeck: front image.")});q.DeckContentSchema=R.z.object({cards:R.z.array(q.CardSchema).describe("Array of card objects."),backImage:R.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:R.z.enum(["delete","return"]).optional().describe("For CardDeck.")})});var ro=g(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.DiceContentSchema=ne.DieTypeSchema=void 0;var ce=require("zod");ne.DieTypeSchema=ce.z.enum(["d4","d6","d8","d10","d12","d20"]);ne.DiceContentSchema=ce.z.object({diceType:ne.DieTypeSchema.optional(),diceCount:ce.z.number().int().min(1).max(10).optional(),color:ce.z.string().optional().describe("CSS color for dice."),showNumber:ce.z.boolean().optional(),persistent:ce.z.boolean().optional().describe("Keep dice visible after roll.")})});var co=g(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.SpinnerContentSchema=ie.SpinnerSliceSchema=void 0;var ae=require("zod"),Ao=L();ie.SpinnerSliceSchema=ae.z.object({id:ae.z.string().optional(),text:ae.z.string(),color:ae.z.string().optional().describe("CSS color for slice."),image:Ao.MediaItemSchema.optional().describe("Slice image.")});ie.SpinnerContentSchema=ae.z.object({slices:ae.z.array(ie.SpinnerSliceSchema).min(2).describe("Wheel slices (min 2)."),spinDuration:ae.z.number().optional().describe("Spin duration in seconds.")})});var lo=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.DragAndDropContentSchema=V.DragGroupSchema=V.DragItemSchema=void 0;var p=require("zod"),ze=L(),Se=pe();V.DragItemSchema=p.z.object({id:p.z.string().optional(),text:p.z.string(),background:ze.MediaItemSchema.optional().describe("Background image/color for item."),opacity:p.z.number().optional().describe("Opacity of the item (0-1)."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),styles:Se.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:Se.TextStylesSchema.optional().describe("Text custom styling styles.")});V.DragGroupSchema=p.z.object({id:p.z.string().optional(),name:p.z.string().describe("Group/dropzone name."),singleItem:p.z.boolean().optional().describe("Accept only one item inside."),background:ze.MediaItemSchema.optional().describe("Background image/color for group."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),opacity:p.z.number().optional().describe("Opacity of the group (0-1)."),styles:Se.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:Se.TextStylesSchema.optional().describe("Text custom styling styles."),items:p.z.array(V.DragItemSchema).describe("Items that belong in this group.")});V.DragAndDropContentSchema=p.z.object({groups:p.z.array(V.DragGroupSchema).min(1).describe("Drag-and-drop groups."),layout:p.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:p.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:p.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:p.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:p.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:ze.MediaItemSchema.optional().describe("Shared background image/color for all groups."),itemBackground:ze.MediaItemSchema.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:p.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:p.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:p.z.number().optional().describe("Proportion ratio for split layout.")})});var so=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.ChartContentSchema=U.ChartConfigSchema=U.ChartTypeSchema=void 0;var A=require("zod");U.ChartTypeSchema=A.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]);U.ChartConfigSchema=A.z.object({colors:A.z.array(A.z.string()).optional(),xAxisLabel:A.z.string().optional(),yAxisLabel:A.z.string().optional(),showLegend:A.z.boolean().optional(),showTooltip:A.z.boolean().optional(),stacked:A.z.boolean().optional(),seriesNames:A.z.record(A.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")});U.ChartContentSchema=A.z.object({chartType:U.ChartTypeSchema.optional(),chartData:A.z.array(A.z.record(A.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:U.ChartConfigSchema.optional()})});var mo=g(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.BasicContentSchema=void 0;var be=require("zod"),Oo=L();ge.BasicContentSchema=be.z.object({content:be.z.any().optional().describe("For Editor: Plate JSON content array."),url:be.z.string().optional().describe("For Media or Embed: content URL."),text:be.z.string().optional().describe("For Shape: text inside shape."),mediaType:Oo.MediaTypeSchema.optional().describe("For Media: media type.")})});var De=g(_=>{"use strict";var Po=_&&_.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),G=_&&_.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Po(i,a,n)};Object.defineProperty(_,"__esModule",{value:!0});G(eo(),_);G(oo(),_);G(no(),_);G(ao(),_);G(io(),_);G(ro(),_);G(co(),_);G(lo(),_);G(so(),_);G(Ae(),_);G(mo(),_)});var po=g(Q=>{"use strict";var Do=Q&&Q.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),qo=Q&&Q.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),Eo=Q&&Q.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(n){var c=[];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(c[c.length]=l);return c},a(i)};return function(i){if(i&&i.__esModule)return i;var n={};if(i!=null)for(var c=a(i),l=0;l<c.length;l++)c[l]!=="default"&&Do(n,i,c[l]);return qo(n,i),n}})();Object.defineProperty(Q,"__esModule",{value:!0});Q.BLOCK_CONTENT_SCHEMAS=void 0;Q.generateBlockReference=Qo;var Lo=Eo(require("zod-to-json-schema")),Fo=Lo.zodToJsonSchema,T=De();Q.BLOCK_CONTENT_SCHEMAS={Quiz:T.QuizContentSchema,Cloze:T.ClozeContentSchema,Crossword:T.CrosswordContentSchema,WordSearch:T.WordSearchContentSchema,Anagram:T.AnagramContentSchema,Memory:T.PairGameContentSchema,MatchPairs:T.PairGameContentSchema,Flashcard:T.DeckContentSchema,CardDeck:T.DeckContentSchema,Dice:T.DiceContentSchema,SpinningWheel:T.SpinnerContentSchema,DragAndDrop:T.DragAndDropContentSchema,Chart:T.ChartContentSchema,Puzzle:T.PuzzleContentSchema,Editor:T.BasicContentSchema,Media:T.BasicContentSchema,Embed:T.BasicContentSchema,Shape:T.BasicContentSchema};function Ro(a,i,n,c){let l=n?"*required*":"optional",h=qe(i),u=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${a}\` (${h}, ${l})${u}`}function qe(a){return a.enum?`enum: ${a.enum.map(i=>JSON.stringify(i)).join(" | ")}`:a.anyOf||a.oneOf?(a.anyOf||a.oneOf).map(qe).join(" | "):Array.isArray(a.type)?a.type.join(" | "):a.type==="array"&&a.items?`array<${qe(a.items)}>`:a.type==="object"?"object":a.type??"any"}function Ee(a,i){let n=[],c=new Set(a.required??[]),l=a.properties??{};for(let[h,u]of Object.entries(l))n.push(Ro(h,u,c.has(h),i)),u.type==="object"&&u.properties?n.push(Ee(u,i+" ")):u.type==="array"&&u.items?.type==="object"&&n.push(Ee(u.items,i+" "));return n.join(`
|
|
4
|
+
`)}function Qo(){let a=[],i=new Map;for(let[n,c]of Object.entries(Q.BLOCK_CONTENT_SCHEMAS)){let l=i.get(c)??[];l.push(n),i.set(c,l)}for(let[n,c]of i.entries()){let l=c.join(" / "),h=Fo(n,{target:"jsonSchema7"}),u=Ee(h,"");a.push(`### ${l}
|
|
5
|
+
${u||"_(no configurable fields)_"}`)}return a.join(`
|
|
4
6
|
|
|
5
|
-
`)}});var
|
|
7
|
+
`)}});var Le=g(j=>{"use strict";var Wo=j&&j.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),J=j&&j.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Wo(i,a,n)};Object.defineProperty(j,"__esModule",{value:!0});J(_e(),j);J(L(),j);J(pe(),j);J(Ve(),j);J(Me(),j);J(ue(),j);J(Je(),j);J(Xe(),j);J(De(),j);J(po(),j)});var ke={};Be(ke,{CANVAS_OP_NAMES:()=>We,CANVAS_OP_REQUIRED:()=>le,applyItemPatch:()=>Ge,detectConflict:()=>Ke,entitySignature:()=>Ce,getAllBlockJsonSchemas:()=>Re,getBlockJsonSchema:()=>fe,isKnownCanvasOp:()=>Te,listBlockTypes:()=>ye,opConflictStamp:()=>He,opTarget:()=>xe,parseMentions:()=>Ye,resolveMentions:()=>$e,stableStringify:()=>re,validateCanvasOp:()=>Ne});module.exports=fo(ke);var X={};Be(X,{CANVAS_OP_NAMES:()=>We,CANVAS_OP_REQUIRED:()=>le,applyItemPatch:()=>Ge,detectConflict:()=>Ke,entitySignature:()=>Ce,getAllBlockJsonSchemas:()=>Re,getBlockJsonSchema:()=>fe,isKnownCanvasOp:()=>Te,listBlockTypes:()=>ye,opConflictStamp:()=>He,opTarget:()=>xe,parseMentions:()=>Ye,resolveMentions:()=>$e,stableStringify:()=>re,validateCanvasOp:()=>Ne});var le={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},We=Object.keys(le);function Te(a){return Object.prototype.hasOwnProperty.call(le,a)}function Ne(a,i){if(!Te(a))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${a}"`]};if(typeof i!="object"||i===null||Array.isArray(i))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=i,c=le[a].filter(l=>n[l]===void 0||n[l]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(l=>`missing field: ${l}`)}:a==="groupBlocks"&&(!Array.isArray(n.blockIds)||n.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function Ge(a,i,n){let c=Array.isArray(a)?[...a]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let l=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(l,c.length)),0,n.item),c}return i==="updateItem"?c.map(l=>l&&typeof l=="object"&&l.id===n.itemId?{...l,...n.item??{}}:l):c.filter(l=>!(l&&typeof l=="object"&&l.id===n.itemId))}var ko=new Set(["position","size","rotation","zIndex","z"]);function re(a){return a===null||typeof a!="object"?JSON.stringify(a)??"null":Array.isArray(a)?"["+a.map(re).join(",")+"]":"{"+Object.keys(a).sort().map(n=>JSON.stringify(n)+":"+re(a[n])).join(",")+"}"}function xe(a,i){let n=i??{};switch(a){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return n.blockId?{kind:"block",blockId:n.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return n.blockId&&n.collection&&n.itemId?{kind:"item",blockId:n.blockId,collection:n.collection,itemId:n.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function Bo(a,i){if(Array.isArray(a))for(let n of a){let c=n?.blocks?.find?.(l=>l&&l.id===i);if(c)return c}}function Ce(a,i){if(i.kind==="untracked")return null;let n=i.blockId?Bo(a,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let h={};for(let u of Object.keys(n))ko.has(u)||(h[u]=n[u]);return re(h)}let c=n[i.collection];if(!Array.isArray(c))return null;let l=c.find(h=>h&&h.id===i.itemId);return l?re(l):null}function Ke(a,i){return a==null?"apply":i==null?"missing":a===i?"apply":"stale"}function He(a,i,n){let c=xe(a,i);return{target:c,baseSignature:Ce(n,c)}}var we=/@\[([^\]|]+)\|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\]/g;function Ye(a){let i=[];for(let n of(a??"").matchAll(we))i.push({name:n[1].trim(),id:n[2]});return i}function $e(a,i){let n=new Map,c=new Map;for(let k of i?.scenes??[]){k?.id&&n.set(k.id,k);for(let x of k?.blocks??[])x?.id&&c.set(x.id,{block:x,sceneId:k.id})}let l=[],h=new Set,u=k=>c.has(k)?"il blocco selezionato":n.has(k)?"la scena selezionata":"l'elemento selezionato",Z=(k,x)=>{if(!h.has(x))if(c.has(x)){let{block:ee,sceneId:ho}=c.get(x);l.push({id:x,name:k,kind:"block",blockType:ee?.type,sceneId:ho}),h.add(x)}else n.has(x)&&(l.push({id:x,name:k,kind:"scene"}),h.add(x))},W=(a??"").replace(we,(k,x,ee)=>(Z(x.trim(),ee),x.trim())),E=(a??"").replace(we,(k,x,ee)=>c.has(ee)||n.has(ee)?u(ee):x.trim());return{cleanedText:W,agentText:E,entities:l}}var O={};Be(O,{getAllBlockJsonSchemas:()=>Re,getBlockJsonSchema:()=>fe,listBlockTypes:()=>ye});var uo=require("zod-to-json-schema"),Fe=Qe(Le());I(O,Qe(Le()));function ye(){return Object.keys(Fe.BLOCK_CONTENT_SCHEMAS)}function fe(a){let i=Fe.BLOCK_CONTENT_SCHEMAS[a];if(i)return(0,uo.zodToJsonSchema)(i,{target:"jsonSchema7",$refStrategy:"none"})}function Re(){return Object.fromEntries(ye().map(a=>[a,fe(a)]))}I(X,O);I(ke,X,module.exports);0&&(module.exports={CANVAS_OP_NAMES,CANVAS_OP_REQUIRED,applyItemPatch,detectConflict,entitySignature,getAllBlockJsonSchemas,getBlockJsonSchema,isKnownCanvasOp,listBlockTypes,opConflictStamp,opTarget,parseMentions,resolveMentions,stableStringify,validateCanvasOp});
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
var je=Object.create;var ie=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var y=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(n,i)=>(typeof require<"u"?require:n)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,n)=>()=>{try{return n||t((n={exports:{}}).exports,n),n.exports}catch(i){throw n=0,i}};var ve=(t,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Me(n))!Oe.call(t,a)&&a!==i&&ie(t,a,{get:()=>n[a],enumerable:!(r=_e(n,a))||r.enumerable});return t};var Pe=(t,n,i)=>(i=t!=null?je(we(t)):{},ve(n||!t||!t.__esModule?ie(i,"default",{value:t,enumerable:!0}):i,t));var O=g(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.MediaRefSchema=m.MediaItemSchema=m.VideoSettingsSchema=m.CropDataSchema=m.MediaSourceSchema=m.MediaTypeSchema=m.GridSizeSchema=m.SizeSchema=m.PositionSchema=void 0;var c=y("zod");m.PositionSchema=c.z.object({x:c.z.number(),y:c.z.number(),z:c.z.number().optional()});m.SizeSchema=c.z.object({width:c.z.number().optional(),height:c.z.number().optional()});m.GridSizeSchema=c.z.object({rows:c.z.number(),cols:c.z.number()});m.MediaTypeSchema=c.z.enum(["image","color","gif","shape","illustration","video","audio"]);m.MediaSourceSchema=c.z.enum(["unsplash","pexels","upload","url","library","tenor"]);m.CropDataSchema=c.z.object({x:c.z.number(),y:c.z.number(),width:c.z.number(),height:c.z.number(),zoom:c.z.number().optional(),rotation:c.z.number().optional(),aspect:c.z.number().optional()});m.VideoSettingsSchema=c.z.object({autoplay:c.z.boolean().optional(),loop:c.z.boolean().optional(),muted:c.z.boolean().optional(),controls:c.z.boolean().optional(),poster:c.z.string().optional(),volume:c.z.number().optional()});m.MediaItemSchema=c.z.object({id:c.z.string().optional(),url:c.z.string().optional(),title:c.z.string().optional(),type:m.MediaTypeSchema,source:m.MediaSourceSchema.optional(),alt:c.z.string().optional(),width:c.z.number().optional(),height:c.z.number().optional(),format:c.z.enum(["cover","contain"]).optional(),color:c.z.string().optional(),cropData:m.CropDataSchema.optional(),duration:c.z.number().optional(),videoSettings:m.VideoSettingsSchema.optional()});m.MediaRefSchema=m.MediaItemSchema});var re=g(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.QuestionSchema=l.TextQuestionSchema=l.TrueFalseQuestionSchema=l.ChoiceQuestionSchema=l.QuestionOptionSchema=l.ImageSizeSchema=l.ImageAlignSchema=l.QuestionTypeSchema=void 0;var d=y("zod"),ae=O();l.QuestionTypeSchema=d.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);l.ImageAlignSchema=d.z.enum(["left","right","center"]);l.ImageSizeSchema=d.z.object({width:d.z.number().optional(),height:d.z.number().optional()});l.QuestionOptionSchema=d.z.object({id:d.z.string(),text:d.z.string(),isCorrect:d.z.boolean(),image:ae.MediaItemSchema.optional(),imageAlign:l.ImageAlignSchema.optional(),imageSize:l.ImageSizeSchema.optional()});var X={id:d.z.string(),text:d.z.string(),score:d.z.number().optional(),image:ae.MediaItemSchema.optional(),imageAlign:l.ImageAlignSchema.optional(),imageSize:l.ImageSizeSchema.optional()};l.ChoiceQuestionSchema=d.z.object({...X,type:d.z.enum(["single-choice","multiple-choice"]),options:d.z.array(l.QuestionOptionSchema)});l.TrueFalseQuestionSchema=d.z.object({...X,type:d.z.literal("true-false"),correctAnswer:d.z.boolean()});l.TextQuestionSchema=d.z.object({...X,type:d.z.enum(["short-answers","long-answers"]),minCharacters:d.z.number().optional(),maxCharacters:d.z.number().optional()});l.QuestionSchema=d.z.discriminatedUnion("type",[l.ChoiceQuestionSchema,l.TrueFalseQuestionSchema,l.TextQuestionSchema])});var se=g(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.QuizContentSchema=T.QuizQuestionSchema=T.QuizOptionSchema=T.QuizQuestionTypeSchema=void 0;var u=y("zod"),ce=O(),K=re();T.QuizQuestionTypeSchema=u.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);T.QuizOptionSchema=u.z.object({id:u.z.string().optional(),text:u.z.string(),isCorrect:u.z.boolean(),image:ce.MediaItemSchema.optional().describe("Option image."),imageAlign:K.ImageAlignSchema.optional().describe("Option image alignment."),imageSize:K.ImageSizeSchema.optional().describe("Option image size.")});T.QuizQuestionSchema=u.z.object({id:u.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:T.QuizQuestionTypeSchema,text:u.z.string().describe("The question text."),score:u.z.number().optional(),options:u.z.array(T.QuizOptionSchema).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:u.z.boolean().optional().describe("Required for true-false."),image:ce.MediaItemSchema.optional().describe("Question image."),imageAlign:K.ImageAlignSchema.optional().describe("Question image alignment."),imageSize:K.ImageSizeSchema.optional().describe("Question image size.")});T.QuizContentSchema=u.z.object({questions:u.z.array(T.QuizQuestionSchema).describe("Array of question objects."),showResults:u.z.boolean().optional(),allowRetry:u.z.boolean().optional(),maxRetry:u.z.string().optional(),required:u.z.boolean().optional(),submitText:u.z.string().optional().describe("Label for submit button."),timer:u.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:u.z.boolean().optional().describe("Show current/total questions count.")})});var le=g(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.ClozeContentSchema=F.ClozeModeSchema=void 0;var Z=y("zod");F.ClozeModeSchema=Z.z.enum(["write","drag-drop"]);F.ClozeContentSchema=Z.z.object({templateText:Z.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:F.ClozeModeSchema.optional().describe("Input mode. Default: write.")})});var de=g(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.AnagramContentSchema=C.WordSearchContentSchema=C.CrosswordContentSchema=C.CrosswordWordSchema=C.WordGameBlockTypeSchema=void 0;var f=y("zod"),me=O();C.WordGameBlockTypeSchema=f.z.enum(["Crossword","WordSearch","Anagram"]);C.CrosswordWordSchema=f.z.object({answer:f.z.string(),clue:f.z.string(),image:me.MediaItemSchema.optional().describe("Clue image.")});C.CrosswordContentSchema=f.z.object({words:f.z.array(C.CrosswordWordSchema)});C.WordSearchContentSchema=f.z.object({words:f.z.array(f.z.string()),gridSize:me.GridSizeSchema.optional().describe("Grid dimensions."),difficulty:f.z.enum(["easy","medium","hard"]).optional()});C.AnagramContentSchema=f.z.object({correctWord:f.z.string().describe("The correct word."),letters:f.z.array(f.z.string()).optional(),clue:f.z.string().optional().describe("A hint.")})});var ue=g(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.PairGameContentSchema=I.PairSchema=I.MemoryPairTypeSchema=I.PairGameBlockTypeSchema=void 0;var M=y("zod"),ee=O();I.PairGameBlockTypeSchema=M.z.enum(["Memory","MatchPairs"]);I.MemoryPairTypeSchema=M.z.enum(["img-img","img-word","word-word"]);I.PairSchema=M.z.object({id:M.z.string().optional(),type:I.MemoryPairTypeSchema.optional().describe("For Memory: pair type."),content:M.z.array(M.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:M.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:M.z.string().optional().describe("For MatchPairs: right side text."),leftImage:ee.MediaItemSchema.optional().describe("For MatchPairs: left side image."),rightImage:ee.MediaItemSchema.optional().describe("For MatchPairs: right side image.")});I.PairGameContentSchema=M.z.object({pairs:M.z.array(I.PairSchema).describe("Array of pair objects."),gridSize:ee.GridSizeSchema.optional().describe("For Memory: grid dimensions."),instructions:M.z.string().optional().describe("For MatchPairs: instruction text.")})});var pe=g(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.DeckContentSchema=B.CardSchema=B.CardFaceSchema=B.DeckBlockTypeSchema=void 0;var j=y("zod");B.DeckBlockTypeSchema=j.z.enum(["Flashcard","CardDeck"]);B.CardFaceSchema=j.z.object({type:j.z.enum(["text","image"]),content:j.z.any()});B.CardSchema=j.z.object({id:j.z.string().optional(),front:B.CardFaceSchema.optional().describe("For Flashcard: front side."),back:B.CardFaceSchema.optional().describe("For Flashcard: back side."),frontText:j.z.string().optional().describe("For CardDeck: front text."),frontImage:j.z.any().optional().describe("For CardDeck: front image.")});B.DeckContentSchema=j.z.object({cards:j.z.array(B.CardSchema).describe("Array of card objects."),backImage:j.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:j.z.enum(["delete","return"]).optional().describe("For CardDeck.")})});var he=g(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.DiceContentSchema=Q.DieTypeSchema=void 0;var G=y("zod");Q.DieTypeSchema=G.z.enum(["d4","d6","d8","d10","d12","d20"]);Q.DiceContentSchema=G.z.object({diceType:Q.DieTypeSchema.optional(),diceCount:G.z.number().int().min(1).max(10).optional(),color:G.z.string().optional().describe("CSS color for dice."),showNumber:G.z.boolean().optional(),persistent:G.z.boolean().optional().describe("Keep dice visible after roll.")})});var Se=g(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.SpinnerContentSchema=N.SpinnerSliceSchema=void 0;var E=y("zod"),Qe=O();N.SpinnerSliceSchema=E.z.object({id:E.z.string().optional(),text:E.z.string(),color:E.z.string().optional().describe("CSS color for slice."),image:Qe.MediaItemSchema.optional().describe("Slice image.")});N.SpinnerContentSchema=E.z.object({slices:E.z.array(N.SpinnerSliceSchema).min(2).describe("Wheel slices (min 2)."),spinDuration:E.z.number().optional().describe("Spin duration in seconds.")})});var be=g(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.ShapeBlockThemeSchema=o.MatchPairsBlockThemeSchema=o.FlashcardBlockThemeSchema=o.CardDeckBlockThemeSchema=o.ClozeBlockThemeSchema=o.SpinningWheelBlockThemeSchema=o.MemoryBlockThemeSchema=o.WordSearchBlockThemeSchema=o.CrosswordBlockThemeSchema=o.DiceBlockThemeSchema=o.AnagramBlockThemeSchema=o.EditorBlockThemeSchema=o.DragAndDropBlockThemeSchema=o.QuizBlockThemeSchema=o.HotpointBlockThemeSchema=o.BlockThemeSchema=o.TextStylesSchema=o.BoxStylesSchema=o.RadiusSchema=o.BoxSideSchema=o.AnimationSchema=void 0;var e=y("zod"),oe=O();o.AnimationSchema=e.z.object({type:e.z.union([e.z.enum(["none","fade","direction","bounce","scale","rotate"]),e.z.string()]),duration:e.z.number().optional(),delay:e.z.number().optional(),phase:e.z.enum(["in","both","out"]).optional(),direction:e.z.enum(["up","right","down","left"]).optional()});o.BoxSideSchema=e.z.object({top:e.z.union([e.z.string(),e.z.number()]).optional(),right:e.z.union([e.z.string(),e.z.number()]).optional(),bottom:e.z.union([e.z.string(),e.z.number()]).optional(),left:e.z.union([e.z.string(),e.z.number()]).optional()});o.RadiusSchema=e.z.object({topLeft:e.z.union([e.z.string(),e.z.number()]).optional(),topRight:e.z.union([e.z.string(),e.z.number()]).optional(),bottomRight:e.z.union([e.z.string(),e.z.number()]).optional(),bottomLeft:e.z.union([e.z.string(),e.z.number()]).optional()});o.BoxStylesSchema=e.z.object({background:e.z.boolean().optional(),backgroundColor:e.z.string().optional(),backgroundOpacity:e.z.number().optional(),backgroundMedia:oe.MediaItemSchema.optional(),border:e.z.boolean().optional(),borderColor:e.z.string().optional(),borderWidth:o.BoxSideSchema.optional(),borderRadius:o.RadiusSchema.optional(),padding:e.z.union([e.z.string(),e.z.number(),o.BoxSideSchema]).optional()});o.TextStylesSchema=e.z.object({color:e.z.string().optional(),fontSize:e.z.number().optional(),fontFamily:e.z.string().optional(),fontStyle:e.z.string().optional(),fontWeight:e.z.union([e.z.string(),e.z.number()]).optional(),textAlign:e.z.enum(["left","center","right","justify"]).optional()});var v=o.BoxStylesSchema.merge(o.TextStylesSchema);o.BlockThemeSchema=e.z.object({spacing:e.z.enum(["no-spacing","small","medium","large"]).optional(),animation:o.AnimationSchema.optional(),styles:e.z.record(e.z.record(e.z.any())).optional()});o.HotpointBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({hotpoint:e.z.object({icon:e.z.string().optional(),iconPosition:e.z.enum(["left","right"]).optional(),iconSize:e.z.string().optional(),iconColor:e.z.string().optional(),image:oe.MediaItemSchema.optional(),imageFormat:e.z.enum(["circle","square","custom"]).optional(),border:e.z.boolean().optional(),borderColor:e.z.string().optional(),borderWidth:e.z.string().optional(),borderRadius:e.z.string().optional(),glow:e.z.boolean().optional(),glowColor:e.z.string().optional(),background:e.z.boolean().optional(),backgroundColor:e.z.string().optional(),fontSize:e.z.number().optional(),fontFamily:e.z.string().optional(),fontStyle:e.z.string().optional(),textColor:e.z.string().optional()}).optional()}).optional()});o.QuizBlockThemeSchema=o.BlockThemeSchema.extend({layout:e.z.enum(["horizontal","vertical","grid"]),gridColumns:e.z.number().optional(),preset:e.z.enum(["default","modern","trivia","custom"]),styles:e.z.object({general:v,question:v,answers:v.extend({customStyles:e.z.array(e.z.object({color:e.z.string().optional(),backgroundColor:e.z.string().optional(),targets:e.z.string().optional()})).optional(),hover:v.optional()}),button:v.extend({variant:e.z.enum(["default","outline","ghost"]).optional(),hover:v.optional()})}).optional()});o.DragAndDropBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),splitRatio:e.z.number().optional(),gridColumns:e.z.number().optional(),gridGap:e.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:e.z.object({x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:e.z.object({title:o.TextStylesSchema.optional(),sandbox:o.BoxStylesSchema.optional(),item:v.optional(),group:o.BoxStylesSchema.optional(),container:o.BoxStylesSchema.extend({url:e.z.string().optional(),type:oe.MediaTypeSchema.optional()}).optional(),groups:v.optional(),feedback:e.z.object({correct:e.z.string().optional(),incorrect:e.z.string().optional(),active:e.z.string().optional()}).optional(),referenceSize:e.z.object({width:e.z.number(),height:e.z.number()}).optional()}).optional()});o.EditorBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({editor:o.BoxStylesSchema.optional()}).optional()});o.AnagramBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({letter:o.BoxStylesSchema.optional(),letterText:o.TextStylesSchema.optional(),slot:o.BoxStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.DiceBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({button:o.BoxStylesSchema.extend({hover:v.optional()}).optional(),buttonText:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.CrosswordBlockThemeSchema=o.BlockThemeSchema.extend({primaryColor:e.z.string().optional(),layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),splitRatio:e.z.number().optional(),styles:e.z.object({text:o.TextStylesSchema.optional(),cell:o.BoxStylesSchema.optional(),grid:o.BoxStylesSchema.optional(),clueContainer:o.BoxStylesSchema.optional(),clueText:o.TextStylesSchema.optional(),clueTitle:o.TextStylesSchema.optional()}).optional()});o.WordSearchBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),splitRatio:e.z.number().optional(),styles:e.z.object({wordSearch:e.z.object({primaryColor:e.z.string().optional(),highlightColor:e.z.string().optional(),fontSize:e.z.number().optional(),fontFamily:e.z.string().optional(),textColor:e.z.string().optional(),cellBackgroundColor:e.z.string().optional()}).optional(),text:o.TextStylesSchema.optional(),cell:o.BoxStylesSchema.optional(),grid:o.BoxStylesSchema.optional(),wordListContainer:o.BoxStylesSchema.optional(),wordListText:o.TextStylesSchema.optional(),wordListTitle:o.TextStylesSchema.optional()}).optional()});o.MemoryBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({text:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional(),infoContainer:o.BoxStylesSchema.optional(),infoText:o.TextStylesSchema.optional(),card:o.BoxStylesSchema.optional()}).optional()});o.SpinningWheelBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({wheelText:o.TextStylesSchema.optional()}).optional()});o.ClozeBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),styles:e.z.object({text:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional(),wordBank:o.BoxStylesSchema.optional(),word:o.BoxStylesSchema.optional(),blank:o.BoxStylesSchema.optional()}).optional()});o.CardDeckBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({card:o.BoxStylesSchema.optional(),cardText:o.TextStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.FlashcardBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({cardFront:o.BoxStylesSchema.optional(),cardBack:o.BoxStylesSchema.optional(),frontText:o.TextStylesSchema.optional(),backText:o.TextStylesSchema.optional(),navigation:o.BoxStylesSchema.optional(),navigationText:o.TextStylesSchema.optional()}).optional()});o.MatchPairsBlockThemeSchema=o.BlockThemeSchema.extend({layoutPosition:e.z.enum(["left","right","top","bottom"]).optional(),styles:e.z.object({text:o.TextStylesSchema.optional(),card:o.BoxStylesSchema.optional(),container:o.BoxStylesSchema.optional()}).optional()});o.ShapeBlockThemeSchema=o.BlockThemeSchema.extend({styles:e.z.object({shape:v.extend({fillColor:e.z.string().optional(),textColor:e.z.string().optional(),borderStyle:e.z.enum(["solid","dashed","dotted"]).optional(),padding:e.z.number().optional()}).optional()}).optional()})});var ze=g(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.DragAndDropContentSchema=P.DragGroupSchema=P.DragItemSchema=void 0;var s=y("zod"),$=O(),J=be();P.DragItemSchema=s.z.object({id:s.z.string().optional(),text:s.z.string(),background:$.MediaItemSchema.optional().describe("Background image/color for item."),opacity:s.z.number().optional().describe("Opacity of the item (0-1)."),x:s.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:s.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:s.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:s.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:s.z.number().optional().describe("Manual width in pixels."),height:s.z.number().optional().describe("Manual height in pixels."),styles:J.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:J.TextStylesSchema.optional().describe("Text custom styling styles.")});P.DragGroupSchema=s.z.object({id:s.z.string().optional(),name:s.z.string().describe("Group/dropzone name."),singleItem:s.z.boolean().optional().describe("Accept only one item inside."),background:$.MediaItemSchema.optional().describe("Background image/color for group."),x:s.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:s.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:s.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:s.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:s.z.number().optional().describe("Manual width in pixels."),height:s.z.number().optional().describe("Manual height in pixels."),opacity:s.z.number().optional().describe("Opacity of the group (0-1)."),styles:J.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:J.TextStylesSchema.optional().describe("Text custom styling styles."),items:s.z.array(P.DragItemSchema).describe("Items that belong in this group.")});P.DragAndDropContentSchema=s.z.object({groups:s.z.array(P.DragGroupSchema).min(1).describe("Drag-and-drop groups."),layout:s.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:s.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:s.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:s.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:s.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:$.MediaItemSchema.optional().describe("Shared background image/color for all groups."),itemBackground:$.MediaItemSchema.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:s.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:s.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:s.z.number().optional().describe("Proportion ratio for split layout.")})});var ge=g(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.ChartContentSchema=A.ChartConfigSchema=A.ChartTypeSchema=void 0;var x=y("zod");A.ChartTypeSchema=x.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]);A.ChartConfigSchema=x.z.object({colors:x.z.array(x.z.string()).optional(),xAxisLabel:x.z.string().optional(),yAxisLabel:x.z.string().optional(),showLegend:x.z.boolean().optional(),showTooltip:x.z.boolean().optional(),stacked:x.z.boolean().optional(),seriesNames:x.z.record(x.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")});A.ChartContentSchema=x.z.object({chartType:A.ChartTypeSchema.optional(),chartData:x.z.array(x.z.record(x.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:A.ChartConfigSchema.optional()})});var ye=g(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.PuzzleContentSchema=q.PuzzleTypeSchema=q.PuzzleGameModeSchema=void 0;var D=y("zod"),Ee=O();q.PuzzleGameModeSchema=D.z.enum(["scattered","rotated","scattered_rotated"]);q.PuzzleTypeSchema=D.z.enum(["swap","slide"]);q.PuzzleContentSchema=D.z.object({image:D.z.union([D.z.string(),Ee.MediaItemSchema]).optional().describe("Image URL or MediaItem for puzzle."),pieces:D.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:q.PuzzleGameModeSchema.optional(),puzzleType:q.PuzzleTypeSchema.optional(),showNumbers:D.z.union([D.z.boolean(),D.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:D.z.string().optional().describe("Deterministic seed for piece placement.")})});var fe=g(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.BasicContentSchema=void 0;var V=y("zod"),Ne=O();H.BasicContentSchema=V.z.object({content:V.z.any().optional().describe("For Editor: Plate JSON content array."),url:V.z.string().optional().describe("For Media or Embed: content URL."),text:V.z.string().optional().describe("For Shape: text inside shape."),mediaType:Ne.MediaTypeSchema.optional().describe("For Media: media type.")})});var xe=g(b=>{"use strict";var Ge=b&&b.__createBinding||(Object.create?(function(t,n,i,r){r===void 0&&(r=i);var a=Object.getOwnPropertyDescriptor(n,i);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,a)}):(function(t,n,i,r){r===void 0&&(r=i),t[r]=n[i]})),w=b&&b.__exportStar||function(t,n){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&Ge(n,t,i)};Object.defineProperty(b,"__esModule",{value:!0});w(se(),b);w(le(),b);w(de(),b);w(ue(),b);w(pe(),b);w(he(),b);w(Se(),b);w(ze(),b);w(ge(),b);w(ye(),b);w(fe(),b)});var ke=g(_=>{"use strict";var We=_&&_.__createBinding||(Object.create?(function(t,n,i,r){r===void 0&&(r=i);var a=Object.getOwnPropertyDescriptor(n,i);(!a||("get"in a?!n.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,r,a)}):(function(t,n,i,r){r===void 0&&(r=i),t[r]=n[i]})),Le=_&&_.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),Ke=_&&_.__importStar||(function(){var t=function(n){return t=Object.getOwnPropertyNames||function(i){var r=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[r.length]=a);return r},t(n)};return function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var r=t(n),a=0;a<r.length;a++)r[a]!=="default"&&We(i,n,r[a]);return Le(i,n),i}})();Object.defineProperty(_,"__esModule",{value:!0});_.BLOCK_CONTENT_SCHEMAS=void 0;_.generateBlockReference=He;var $e=Ke(y("zod-to-json-schema")),Je=$e.zodToJsonSchema,p=xe();_.BLOCK_CONTENT_SCHEMAS={Quiz:p.QuizContentSchema,Cloze:p.ClozeContentSchema,Crossword:p.CrosswordContentSchema,WordSearch:p.WordSearchContentSchema,Anagram:p.AnagramContentSchema,Memory:p.PairGameContentSchema,MatchPairs:p.PairGameContentSchema,Flashcard:p.DeckContentSchema,CardDeck:p.DeckContentSchema,Dice:p.DiceContentSchema,SpinningWheel:p.SpinnerContentSchema,DragAndDrop:p.DragAndDropContentSchema,Chart:p.ChartContentSchema,Puzzle:p.PuzzleContentSchema,Editor:p.BasicContentSchema,Media:p.BasicContentSchema,Embed:p.BasicContentSchema,Shape:p.BasicContentSchema};function Ve(t,n,i,r){let a=i?"*required*":"optional",z=te(n),h=n.description?` \u2014 ${n.description}`:"";return`${r}- \`${t}\` (${z}, ${a})${h}`}function te(t){return t.enum?`enum: ${t.enum.map(n=>JSON.stringify(n)).join(" | ")}`:t.anyOf||t.oneOf?(t.anyOf||t.oneOf).map(te).join(" | "):Array.isArray(t.type)?t.type.join(" | "):t.type==="array"&&t.items?`array<${te(t.items)}>`:t.type==="object"?"object":t.type??"any"}function ne(t,n){let i=[],r=new Set(t.required??[]),a=t.properties??{};for(let[z,h]of Object.entries(a))i.push(Ve(z,h,r.has(z),n)),h.type==="object"&&h.properties?i.push(ne(h,n+" ")):h.type==="array"&&h.items?.type==="object"&&i.push(ne(h.items,n+" "));return i.join(`
|
|
2
|
-
`)}function He(){let t=[],n=new Map;for(let[i,r]of Object.entries(_.BLOCK_CONTENT_SCHEMAS)){let a=n.get(r)??[];a.push(i),n.set(r,a)}for(let[i,r]of n.entries()){let a=r.join(" / "),z=Je(i,{target:"jsonSchema7"}),h=ne(z,"");t.push(`### ${a}
|
|
3
|
-
${
|
|
1
|
+
import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
|
|
2
|
+
var zo=Object.create;var Be=Object.defineProperty;var So=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var B=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(i,n)=>(typeof require<"u"?require:i)[n]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var g=(a,i)=>()=>{try{return i||a((i={exports:{}}).exports,i),i.exports}catch(n){throw i=0,n}},Te=(a,i)=>{for(var n in i)Be(a,n,{get:i[n],enumerable:!0})},ke=(a,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of bo(i))!yo.call(a,l)&&l!==n&&Be(a,l,{get:()=>i[l],enumerable:!(c=So(i,l))||c.enumerable});return a},M=(a,i,n)=>(ke(a,i,"default"),n&&ke(n,i,"default")),We=(a,i,n)=>(n=a!=null?zo(go(a)):{},ke(i||!a||!a.__esModule?Be(n,"default",{value:a,enumerable:!0}):n,a));var je=g(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.BlockTypeSchema=te.BLOCK_TYPES=void 0;var Bo=B("zod");te.BLOCK_TYPES=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"];te.BlockTypeSchema=Bo.z.enum(te.BLOCK_TYPES)});var F=g(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.MediaRefSchema=S.MediaItemSchema=S.VideoSettingsSchema=S.CropDataSchema=S.MediaSourceSchema=S.MediaTypeSchema=S.GridSizeSchema=S.SizeSchema=S.PositionSchema=void 0;var m=B("zod");S.PositionSchema=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()});S.SizeSchema=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()});S.GridSizeSchema=m.z.object({rows:m.z.number(),cols:m.z.number()});S.MediaTypeSchema=m.z.enum(["image","color","gif","shape","illustration","video","audio"]);S.MediaSourceSchema=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]);S.CropDataSchema=m.z.object({x:m.z.number(),y:m.z.number(),width:m.z.number(),height:m.z.number(),zoom:m.z.number().optional(),rotation:m.z.number().optional(),aspect:m.z.number().optional()});S.VideoSettingsSchema=m.z.object({autoplay:m.z.boolean().optional(),loop:m.z.boolean().optional(),muted:m.z.boolean().optional(),controls:m.z.boolean().optional(),poster:m.z.string().optional(),volume:m.z.number().optional()});S.MediaItemSchema=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:S.MediaTypeSchema,source:S.MediaSourceSchema.optional(),alt:m.z.string().optional(),width:m.z.number().optional(),height:m.z.number().optional(),format:m.z.enum(["cover","contain"]).optional(),color:m.z.string().optional(),cropData:S.CropDataSchema.optional(),duration:m.z.number().optional(),videoSettings:S.VideoSettingsSchema.optional()});S.MediaRefSchema=S.MediaItemSchema});var de=g(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ShapeBlockThemeSchema=r.MatchPairsBlockThemeSchema=r.FlashcardBlockThemeSchema=r.CardDeckBlockThemeSchema=r.ClozeBlockThemeSchema=r.SpinningWheelBlockThemeSchema=r.MemoryBlockThemeSchema=r.WordSearchBlockThemeSchema=r.CrosswordBlockThemeSchema=r.DiceBlockThemeSchema=r.AnagramBlockThemeSchema=r.EditorBlockThemeSchema=r.DragAndDropBlockThemeSchema=r.QuizBlockThemeSchema=r.HotpointBlockThemeSchema=r.BlockThemeSchema=r.TextStylesSchema=r.BoxStylesSchema=r.RadiusSchema=r.BoxSideSchema=r.AnimationSchema=void 0;var o=B("zod"),Ie=F();r.AnimationSchema=o.z.object({type:o.z.union([o.z.enum(["none","fade","direction","bounce","scale","rotate"]),o.z.string()]),duration:o.z.number().optional(),delay:o.z.number().optional(),phase:o.z.enum(["in","both","out"]).optional(),direction:o.z.enum(["up","right","down","left"]).optional()});r.BoxSideSchema=o.z.object({top:o.z.union([o.z.string(),o.z.number()]).optional(),right:o.z.union([o.z.string(),o.z.number()]).optional(),bottom:o.z.union([o.z.string(),o.z.number()]).optional(),left:o.z.union([o.z.string(),o.z.number()]).optional()});r.RadiusSchema=o.z.object({topLeft:o.z.union([o.z.string(),o.z.number()]).optional(),topRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomRight:o.z.union([o.z.string(),o.z.number()]).optional(),bottomLeft:o.z.union([o.z.string(),o.z.number()]).optional()});r.BoxStylesSchema=o.z.object({background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),backgroundOpacity:o.z.number().optional(),backgroundMedia:Ie.MediaItemSchema.optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:r.BoxSideSchema.optional(),borderRadius:r.RadiusSchema.optional(),padding:o.z.union([o.z.string(),o.z.number(),r.BoxSideSchema]).optional()});r.TextStylesSchema=o.z.object({color:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),fontWeight:o.z.union([o.z.string(),o.z.number()]).optional(),textAlign:o.z.enum(["left","center","right","justify"]).optional()});var H=r.BoxStylesSchema.merge(r.TextStylesSchema);r.BlockThemeSchema=o.z.object({spacing:o.z.enum(["no-spacing","small","medium","large"]).optional(),animation:r.AnimationSchema.optional(),styles:o.z.record(o.z.record(o.z.any())).optional()});r.HotpointBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({hotpoint:o.z.object({icon:o.z.string().optional(),iconPosition:o.z.enum(["left","right"]).optional(),iconSize:o.z.string().optional(),iconColor:o.z.string().optional(),image:Ie.MediaItemSchema.optional(),imageFormat:o.z.enum(["circle","square","custom"]).optional(),border:o.z.boolean().optional(),borderColor:o.z.string().optional(),borderWidth:o.z.string().optional(),borderRadius:o.z.string().optional(),glow:o.z.boolean().optional(),glowColor:o.z.string().optional(),background:o.z.boolean().optional(),backgroundColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),fontStyle:o.z.string().optional(),textColor:o.z.string().optional()}).optional()}).optional()});r.QuizBlockThemeSchema=r.BlockThemeSchema.extend({layout:o.z.enum(["horizontal","vertical","grid"]),gridColumns:o.z.number().optional(),preset:o.z.enum(["default","modern","trivia","custom"]),styles:o.z.object({general:H,question:H,answers:H.extend({customStyles:o.z.array(o.z.object({color:o.z.string().optional(),backgroundColor:o.z.string().optional(),targets:o.z.string().optional()})).optional(),hover:H.optional()}),button:H.extend({variant:o.z.enum(["default","outline","ghost"]).optional(),hover:H.optional()})}).optional()});r.DragAndDropBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),gridColumns:o.z.number().optional(),gridGap:o.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:o.z.object({x:o.z.number().optional(),y:o.z.number().optional(),width:o.z.number().optional(),height:o.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:o.z.object({title:r.TextStylesSchema.optional(),sandbox:r.BoxStylesSchema.optional(),item:H.optional(),group:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.extend({url:o.z.string().optional(),type:Ie.MediaTypeSchema.optional()}).optional(),groups:H.optional(),feedback:o.z.object({correct:o.z.string().optional(),incorrect:o.z.string().optional(),active:o.z.string().optional()}).optional(),referenceSize:o.z.object({width:o.z.number(),height:o.z.number()}).optional()}).optional()});r.EditorBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({editor:r.BoxStylesSchema.optional()}).optional()});r.AnagramBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({letter:r.BoxStylesSchema.optional(),letterText:r.TextStylesSchema.optional(),slot:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.DiceBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({button:r.BoxStylesSchema.extend({hover:H.optional()}).optional(),buttonText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.CrosswordBlockThemeSchema=r.BlockThemeSchema.extend({primaryColor:o.z.string().optional(),layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),clueContainer:r.BoxStylesSchema.optional(),clueText:r.TextStylesSchema.optional(),clueTitle:r.TextStylesSchema.optional()}).optional()});r.WordSearchBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),splitRatio:o.z.number().optional(),styles:o.z.object({wordSearch:o.z.object({primaryColor:o.z.string().optional(),highlightColor:o.z.string().optional(),fontSize:o.z.number().optional(),fontFamily:o.z.string().optional(),textColor:o.z.string().optional(),cellBackgroundColor:o.z.string().optional()}).optional(),text:r.TextStylesSchema.optional(),cell:r.BoxStylesSchema.optional(),grid:r.BoxStylesSchema.optional(),wordListContainer:r.BoxStylesSchema.optional(),wordListText:r.TextStylesSchema.optional(),wordListTitle:r.TextStylesSchema.optional()}).optional()});r.MemoryBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),infoContainer:r.BoxStylesSchema.optional(),infoText:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional()}).optional()});r.SpinningWheelBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({wheelText:r.TextStylesSchema.optional()}).optional()});r.ClozeBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional(),wordBank:r.BoxStylesSchema.optional(),word:r.BoxStylesSchema.optional(),blank:r.BoxStylesSchema.optional()}).optional()});r.CardDeckBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({card:r.BoxStylesSchema.optional(),cardText:r.TextStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.FlashcardBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({cardFront:r.BoxStylesSchema.optional(),cardBack:r.BoxStylesSchema.optional(),frontText:r.TextStylesSchema.optional(),backText:r.TextStylesSchema.optional(),navigation:r.BoxStylesSchema.optional(),navigationText:r.TextStylesSchema.optional()}).optional()});r.MatchPairsBlockThemeSchema=r.BlockThemeSchema.extend({layoutPosition:o.z.enum(["left","right","top","bottom"]).optional(),styles:o.z.object({text:r.TextStylesSchema.optional(),card:r.BoxStylesSchema.optional(),container:r.BoxStylesSchema.optional()}).optional()});r.ShapeBlockThemeSchema=r.BlockThemeSchema.extend({styles:o.z.object({shape:H.extend({fillColor:o.z.string().optional(),textColor:o.z.string().optional(),borderStyle:o.z.enum(["solid","dashed","dotted"]).optional(),padding:o.z.number().optional()}).optional()}).optional()})});var Ue=g(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.UNSTYLEABLE_BLOCKS=w.BLOCK_STYLE_KEYS=w.STYLE_TARGET_MAP=void 0;w.realStyleKeysFor=To;w.styleTargetsHelpFor=xo;w.mapLogicalThemeStyles=Me;w.mergeTheme=Co;w.STYLE_TARGET_MAP={quiz:{title:["question"],answers:["answers"],button:["button"],general:["general"]},poll:{title:["question"],answers:["answers"],button:["button"],general:["general"]},flashcard:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},memory:{title:["text"],answers:["card"],general:["container"]},matchpairs:{title:["text"],answers:["card"],general:["container"]},cloze:{title:["text"],answers:["word","blank"],general:["container"]},carddeck:{title:["cardText"],answers:["card"],general:["container"]},anagram:{title:["letterText"],answers:["letter","slot"],general:["container"]},dice:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},crossword:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},wordsearch:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},spinningwheel:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},shape:{title:["shape"],answers:["shape"],general:["shape"]},hotpoint:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},editor:{title:["editor"],answers:["editor"],general:["editor"]},draganddrop:{title:["title"],answers:["item"],general:["container"]}};function To(a){let i=w.STYLE_TARGET_MAP[a.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let l of c??[])n.add(l);return[...n]}w.BLOCK_STYLE_KEYS={quiz:["general","question","answers","button"],poll:["general","question","answers","button"],flashcard:["cardFront","cardBack","frontText","backText","navigation","navigationText"],memory:["container","card","text","infoContainer","infoText"],matchpairs:["container","card","text"],cloze:["container","text","wordBank","word","blank"],carddeck:["container","card","cardText"],anagram:["container","letter","letterText","slot"],dice:["container","button","buttonText"],crossword:["grid","cell","text","clueContainer","clueTitle","clueText"],wordsearch:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],spinningwheel:["wheelText"],shape:["shape"],editor:["editor"],hotpoint:["hotpoint"],draganddrop:["container","title","sandbox","groups","item","group"]};w.UNSTYLEABLE_BLOCKS=new Set(["chart","media","image","puzzle"]);function xo(a){if(!a)return"";let i=a.toLowerCase();if(w.UNSTYLEABLE_BLOCKS.has(i))return`
|
|
3
|
+
[STYLE TARGETS] Il blocco "${a}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let n=w.BLOCK_STYLE_KEYS[i];if(!n||n.length===0)return"";let c=w.STYLE_TARGET_MAP[i]??{},l=["general","title","answers","button"].filter(h=>c[h]).map(h=>`${h}\u2192${c[h].join("/")}`).join(", ");return`
|
|
4
|
+
[STYLE TARGETS for ${a}] Logical targets (update_block_theme): ${l}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Me(a,i){if(!a)return a;let n={...a};for(let[ee,N]of Object.entries(n))if(N&&typeof N=="object"){let L={...N},k=!1;L.backgroundColor!==void 0&&L.background===void 0&&(L.background=!0,k=!0),L.borderColor!==void 0&&L.border===void 0&&(L.border=!0,k=!0),k&&(n[ee]=L)}if(!i)return n;let c=w.STYLE_TARGET_MAP[i.toLowerCase()];if(!c)return n;let l=(ee,N)=>{N&&(n[ee]={...n[ee]||{},...N})},h=["title","answers","button","general"],u={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let ee of h){let N=u[ee],L=c[ee];if(N&&L)for(let k of L)l(k,N)}return n}function Co(a,i,n){if(!a){let u={...i};return u.styles&&(u.styles=Me(u.styles,n)),u}if(!i)return a;let c={...a,...i},l=Me(i.styles,n),h=a.styles||{};if(a.styles||l){c.styles={...h,...l};for(let u of Object.keys(c.styles))h[u]&&l?.[u]&&(c.styles[u]={...h[u],...l[u]})}return c}});var ve=g(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.BlockEventSchema=d.ActivityVariableSchema=d.ActionSchema=d.ActionVariableSchema=d.ActionTypeSchema=d.MathOperationSchema=d.ActionConditionSchema=d.KeyPressConditionSchema=d.ClickConditionSchema=d.TimerConditionSchema=d.QuizConditionSchema=d.ConditionOperatorSchema=d.BlockEventTypeSchema=void 0;var s=B("zod");d.BlockEventTypeSchema=s.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]);d.ConditionOperatorSchema=s.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]);d.QuizConditionSchema=s.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]);d.TimerConditionSchema=s.z.enum(["completed","half_way"]);d.ClickConditionSchema=s.z.enum(["single_click","double_click"]);d.KeyPressConditionSchema=s.z.literal("key_pressed");d.ActionConditionSchema=s.z.object({event:d.BlockEventTypeSchema.optional(),variableName:s.z.string().optional(),operator:d.ConditionOperatorSchema.optional(),value:s.z.any()});d.MathOperationSchema=s.z.enum(["set","add","subtract","multiply","divide"]);d.ActionTypeSchema=s.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]);d.ActionVariableSchema=s.z.object({name:s.z.string(),value:s.z.union([s.z.number(),s.z.string(),s.z.boolean()]),operation:d.MathOperationSchema.optional()});d.ActionSchema=s.z.object({id:s.z.string(),type:d.ActionTypeSchema,condition:d.ActionConditionSchema.optional(),conditions:s.z.array(d.ActionConditionSchema).optional(),conditionsOperator:s.z.enum(["and","or"]).optional(),modalContent:s.z.string().optional(),audioUrl:s.z.string().optional(),linkUrl:s.z.string().optional(),targetSceneId:s.z.string().optional(),targetBlockId:s.z.string().optional(),direction:s.z.enum(["up","down","left","right"]).optional(),distance:s.z.number().optional(),variable:d.ActionVariableSchema.optional()});d.ActivityVariableSchema=s.z.object({name:s.z.string(),defaultValue:s.z.union([s.z.string(),s.z.number(),s.z.boolean()])});d.BlockEventSchema=s.z.object({type:d.BlockEventTypeSchema,blockId:s.z.string(),data:s.z.record(s.z.any()).optional()})});var pe=g(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.QuestionSchema=z.TextQuestionSchema=z.TrueFalseQuestionSchema=z.ChoiceQuestionSchema=z.QuestionOptionSchema=z.ImageSizeSchema=z.ImageAlignSchema=z.QuestionTypeSchema=void 0;var b=B("zod"),Je=F();z.QuestionTypeSchema=b.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);z.ImageAlignSchema=b.z.enum(["left","right","center"]);z.ImageSizeSchema=b.z.object({width:b.z.number().optional(),height:b.z.number().optional()});z.QuestionOptionSchema=b.z.object({id:b.z.string(),text:b.z.string(),isCorrect:b.z.boolean(),image:Je.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()});var Ae={id:b.z.string(),text:b.z.string(),score:b.z.number().optional(),image:Je.MediaItemSchema.optional(),imageAlign:z.ImageAlignSchema.optional(),imageSize:z.ImageSizeSchema.optional()};z.ChoiceQuestionSchema=b.z.object({...Ae,type:b.z.enum(["single-choice","multiple-choice"]),options:b.z.array(z.QuestionOptionSchema)});z.TrueFalseQuestionSchema=b.z.object({...Ae,type:b.z.literal("true-false"),correctAnswer:b.z.boolean()});z.TextQuestionSchema=b.z.object({...Ae,type:b.z.enum(["short-answers","long-answers"]),minCharacters:b.z.number().optional(),maxCharacters:b.z.number().optional()});z.QuestionSchema=b.z.discriminatedUnion("type",[z.ChoiceQuestionSchema,z.TrueFalseQuestionSchema,z.TextQuestionSchema])});var Oe=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.PuzzleContentSchema=$.PuzzleTypeSchema=$.PuzzleGameModeSchema=void 0;var Y=B("zod"),wo=F();$.PuzzleGameModeSchema=Y.z.enum(["scattered","rotated","scattered_rotated"]);$.PuzzleTypeSchema=Y.z.enum(["swap","slide"]);$.PuzzleContentSchema=Y.z.object({image:Y.z.union([Y.z.string(),wo.MediaItemSchema]).optional().describe("Image URL or MediaItem for puzzle."),pieces:Y.z.number().int().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:$.PuzzleGameModeSchema.optional(),puzzleType:$.PuzzleTypeSchema.optional(),showNumbers:Y.z.union([Y.z.boolean(),Y.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:Y.z.string().optional().describe("Deterministic seed for piece placement.")})});var Xe=g(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CanvasDragItemSchema=t.ActivityContentSchema=t.SceneSchema=t.BlockGroupSchema=t.BlockSchema=t.ArrowBlockSchema=t.ShapeBlockSchema=t.CardDeckBlockSchema=t.ClozeBlockSchema=t.MatchPairsBlockSchema=t.ChartBlockSchema=t.SpinningWheelBlockSchema=t.FlashcardBlockSchema=t.MemoryBlockSchema=t.WordSearchBlockSchema=t.WordSearchDifficultySchema=t.CrosswordBlockSchema=t.PuzzleBlockSchema=t.DiceBlockSchema=t.AnagramBlockSchema=t.DragAndDropBlockSchema=t.EmbedBlockSchema=t.MediaBlockSchema=t.EditorBlockSchema=t.HotpointBlockSchema=t.QuizBlockSchema=t.ArrowLabelSchema=t.ArrowHeadTypeSchema=t.ShapeTypeSchema=t.MatchPairsPairSchema=t.CardItemSchema=t.FlashcardItemSchema=t.FlashcardContentSchema=t.WheelSliceSchema=t.MemoryPairSchema=t.WordSearchDataSchema=t.CrosswordLayoutOutputSchema=t.CrosswordLayoutWordSchema=t.CrosswordCellSchema=t.DiceTypeSchema=t.DragAndDropGroupSchema=t.DragAndDropItemSchema=t.ActionBlockSchema=t.SceneTypeSchema=void 0;var e=B("zod"),_o=je(),T=F(),y=de(),jo=pe(),Io=ve(),Mo=Oe();t.SceneTypeSchema=e.z.enum(["2D","360\xB0"]);var me={id:e.z.string(),type:_o.BlockTypeSchema,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:T.PositionSchema.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:T.SizeSchema.optional(),minSize:T.SizeSchema.optional(),maxSize:T.SizeSchema.optional(),theme:y.BlockThemeSchema.optional()},_={...me,actions:e.z.array(Io.ActionSchema).optional(),score:e.z.number().optional()};t.ActionBlockSchema=e.z.object(_);t.DragAndDropItemSchema=e.z.object({id:e.z.string(),text:e.z.string(),background:T.MediaItemSchema.optional(),opacity:e.z.number().optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional()});t.DragAndDropGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),background:T.MediaItemSchema.optional(),x:e.z.number().optional(),y:e.z.number().optional(),width:e.z.number().optional(),height:e.z.number().optional(),singleItem:e.z.boolean().optional(),opacity:e.z.number().optional(),styles:y.BoxStylesSchema.optional(),textStyles:y.TextStylesSchema.optional(),items:e.z.array(t.DragAndDropItemSchema)});t.DiceTypeSchema=e.z.enum(["d4","d6","d8","d10","d12","d20"]);t.CrosswordCellSchema=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()});t.CrosswordLayoutWordSchema=e.z.object({answer:e.z.string(),clue:e.z.string(),image:T.MediaItemSchema.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()});t.CrosswordLayoutOutputSchema=e.z.object({grid:e.z.array(e.z.array(t.CrosswordCellSchema)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(t.CrosswordLayoutWordSchema)});t.WordSearchDataSchema=e.z.object({grid:e.z.array(e.z.array(e.z.string())),placedWords:e.z.array(e.z.object({word:e.z.string(),clean:e.z.string(),path:e.z.array(e.z.object({x:e.z.number(),y:e.z.number()}))}))});t.MemoryPairSchema=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]),content:e.z.tuple([e.z.string(),e.z.string()])});t.WheelSliceSchema=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional(),image:T.MediaItemSchema.optional()});t.FlashcardContentSchema=e.z.object({type:e.z.enum(["text","image"]),content:e.z.any()});t.FlashcardItemSchema=e.z.object({id:e.z.string(),front:t.FlashcardContentSchema,back:t.FlashcardContentSchema});t.CardItemSchema=e.z.object({id:e.z.string(),frontImage:T.MediaItemSchema.optional(),frontText:e.z.string().optional()});t.MatchPairsPairSchema=e.z.object({id:e.z.string(),leftLabel:e.z.string(),rightLabel:e.z.string(),leftImage:e.z.any().optional(),rightImage:e.z.any().optional()});t.ShapeTypeSchema=e.z.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]);t.ArrowHeadTypeSchema=e.z.enum(["none","arrow","circle","square"]);t.ArrowLabelSchema=e.z.object({id:e.z.string(),text:e.z.string(),t:e.z.number(),offsetX:e.z.number().optional(),offsetY:e.z.number().optional(),fontSize:e.z.number().optional(),color:e.z.string().optional(),backgroundColor:e.z.string().optional()});t.QuizBlockSchema=e.z.object({..._,type:e.z.literal("Quiz"),questions:e.z.array(jo.QuestionSchema).optional(),previewIndex:e.z.number().optional(),required:e.z.boolean().optional(),showResults:e.z.boolean().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional(),submitText:e.z.string().optional(),timer:e.z.string().optional(),showQuestionCount:e.z.boolean().optional(),theme:y.QuizBlockThemeSchema});t.HotpointBlockSchema=e.z.object({..._,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional(),element:e.z.enum(["image","button"]),theme:y.HotpointBlockThemeSchema.optional()});t.EditorBlockSchema=e.z.object({..._,type:e.z.literal("Editor"),content:e.z.any().optional(),readonly:e.z.boolean().optional(),theme:y.EditorBlockThemeSchema.optional()});t.MediaBlockSchema=e.z.object({...me,type:e.z.literal("Media"),media:T.MediaItemSchema.optional()});t.EmbedBlockSchema=e.z.object({...me,type:e.z.literal("Embed"),url:e.z.string().optional(),readOnly:e.z.boolean().optional()});t.DragAndDropBlockSchema=e.z.object({..._,type:e.z.literal("DragAndDrop"),groups:e.z.array(t.DragAndDropGroupSchema),theme:y.DragAndDropBlockThemeSchema.optional(),showResults:e.z.boolean().optional(),layout:e.z.enum(["manual","split"]).optional(),itemArrangement:e.z.enum(["random","list","grid"]).optional(),groupBackground:T.MediaItemSchema.optional(),enableWrongAnswers:e.z.boolean().optional(),itemBackground:T.MediaItemSchema.optional(),groupBackgroundOpacity:e.z.number().optional(),itemBackgroundOpacity:e.z.number().optional(),splitRatio:e.z.number().optional()});t.AnagramBlockSchema=e.z.object({..._,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()),correctWord:e.z.string(),theme:y.AnagramBlockThemeSchema.optional(),clue:e.z.string().optional(),allowRetry:e.z.boolean().optional(),maxRetry:e.z.string().optional()});t.DiceBlockSchema=e.z.object({..._,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional(),diceType:t.DiceTypeSchema.optional(),faceOverrides:e.z.any().optional(),color:e.z.string().optional(),showNumber:e.z.boolean().optional(),diceCount:e.z.number().optional(),dicePool:e.z.record(e.z.number()).optional(),persistent:e.z.boolean().optional(),theme:y.DiceBlockThemeSchema.optional()});t.PuzzleBlockSchema=e.z.object({..._,type:e.z.literal("Puzzle"),image:T.MediaItemSchema.optional(),pieces:e.z.number().optional(),gameMode:Mo.PuzzleGameModeSchema.optional(),puzzleType:e.z.enum(["swap","slide"]).optional(),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional(),seed:e.z.string().optional()});t.CrosswordBlockSchema=e.z.object({..._,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string(),clue:e.z.string(),image:T.MediaItemSchema.optional()})).optional(),layout:t.CrosswordLayoutOutputSchema.optional(),theme:y.CrosswordBlockThemeSchema.optional()});t.WordSearchDifficultySchema=e.z.enum(["easy","medium","hard"]);t.WordSearchBlockSchema=e.z.object({..._,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional(),gridSize:T.GridSizeSchema.optional(),difficulty:t.WordSearchDifficultySchema.optional(),data:t.WordSearchDataSchema.optional(),theme:y.WordSearchBlockThemeSchema.optional()});t.MemoryBlockSchema=e.z.object({..._,type:e.z.literal("Memory"),pairs:e.z.array(t.MemoryPairSchema),gridSize:T.GridSizeSchema.optional(),hideScore:e.z.boolean().optional(),theme:y.MemoryBlockThemeSchema.optional()});t.FlashcardBlockSchema=e.z.object({..._,type:e.z.literal("Flashcard"),cards:e.z.array(t.FlashcardItemSchema),theme:y.FlashcardBlockThemeSchema.optional()});t.SpinningWheelBlockSchema=e.z.object({..._,type:e.z.literal("SpinningWheel"),slices:e.z.array(t.WheelSliceSchema),spinDuration:e.z.number().optional(),theme:y.SpinningWheelBlockThemeSchema.optional()});t.ChartBlockSchema=e.z.object({..._,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]),chartData:e.z.array(e.z.any()),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional(),xAxisLabel:e.z.string().optional(),yAxisLabel:e.z.string().optional(),showLegend:e.z.boolean().optional(),showTooltip:e.z.boolean().optional(),stacked:e.z.boolean().optional(),seriesNames:e.z.record(e.z.string()).optional()})});t.MatchPairsBlockSchema=e.z.object({..._,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional(),pairs:e.z.array(t.MatchPairsPairSchema),theme:y.MatchPairsBlockThemeSchema.optional()});t.ClozeBlockSchema=e.z.object({..._,type:e.z.literal("Cloze"),templateText:e.z.string().optional(),theme:y.ClozeBlockThemeSchema.optional(),mode:e.z.enum(["write","drag-drop"]).optional()});t.CardDeckBlockSchema=e.z.object({..._,type:e.z.literal("CardDeck"),cards:e.z.array(t.CardItemSchema),backImage:T.MediaItemSchema.optional(),discardLogic:e.z.enum(["delete","return"]),theme:y.CardDeckBlockThemeSchema.optional()});t.ShapeBlockSchema=e.z.object({...me,type:e.z.literal("Shape"),shapeType:t.ShapeTypeSchema.optional(),text:e.z.string().optional(),theme:y.ShapeBlockThemeSchema.optional()});t.ArrowBlockSchema=e.z.object({...me,type:e.z.literal("Arrow"),startBlockId:e.z.string(),endBlockId:e.z.string().optional(),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional(),startHandle:e.z.enum(["top","right","bottom","left"]),endHandle:e.z.enum(["top","right","bottom","left"]).optional(),connectionType:e.z.enum(["straight","orthogonal","curved"]),strokeColor:e.z.string().optional(),strokeWidth:e.z.number().optional(),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional(),showHead:e.z.boolean().optional(),startHead:t.ArrowHeadTypeSchema.optional(),endHead:t.ArrowHeadTypeSchema.optional(),bendOffsetX:e.z.number().optional(),bendOffsetY:e.z.number().optional(),segmentCount:e.z.number().optional(),bendOffsets:e.z.array(e.z.number()).optional(),labels:e.z.array(t.ArrowLabelSchema).optional()});t.BlockSchema=e.z.discriminatedUnion("type",[t.QuizBlockSchema,t.HotpointBlockSchema,t.EditorBlockSchema,t.EmbedBlockSchema,t.MediaBlockSchema,t.DragAndDropBlockSchema,t.AnagramBlockSchema,t.DiceBlockSchema,t.PuzzleBlockSchema,t.CrosswordBlockSchema,t.WordSearchBlockSchema,t.MemoryBlockSchema,t.FlashcardBlockSchema,t.SpinningWheelBlockSchema,t.ChartBlockSchema,t.MatchPairsBlockSchema,t.ShapeBlockSchema,t.ArrowBlockSchema,t.ClozeBlockSchema,t.CardDeckBlockSchema]);t.BlockGroupSchema=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()});t.SceneSchema=e.z.object({id:e.z.string(),title:e.z.string(),type:t.SceneTypeSchema,background:e.z.union([e.z.string(),e.z.array(e.z.string()),T.MediaItemSchema]).optional(),backgroundColor:e.z.string().optional(),backgroundAutoplay:e.z.boolean().optional(),backgroundLoop:e.z.boolean().optional(),secretCode:e.z.string().optional(),hidden:e.z.boolean().optional(),blocks:e.z.array(t.BlockSchema),groups:e.z.array(t.BlockGroupSchema).optional(),canvas:e.z.object({width:e.z.number().optional(),height:e.z.number().optional(),preset:e.z.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()});t.ActivityContentSchema=e.z.object({id:e.z.string(),title:e.z.string(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(t.SceneSchema),variables:e.z.array(e.z.object({name:e.z.string(),defaultValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean()])})).optional(),audio:e.z.array(e.z.object({id:e.z.string(),media:T.MediaItemSchema.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()});t.CanvasDragItemSchema=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:t.BlockSchema})});var Ze=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ActivityContextSchema=V.SceneSummarySchema=V.SceneBlockRefSchema=void 0;var v=B("zod");V.SceneBlockRefSchema=v.z.object({id:v.z.string(),type:v.z.string(),title:v.z.string()});V.SceneSummarySchema=v.z.object({id:v.z.string(),title:v.z.string(),position:v.z.number(),blocks:v.z.array(V.SceneBlockRefSchema).default([])});V.ActivityContextSchema=v.z.object({activity:v.z.object({id:v.z.string(),title:v.z.string(),scenes:v.z.array(V.SceneSummarySchema).default([])}),activeSceneId:v.z.string().nullable().optional()})});var oo=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.QuizContentSchema=D.QuizQuestionSchema=D.QuizOptionSchema=D.QuizQuestionTypeSchema=void 0;var f=B("zod"),eo=F(),ue=pe();D.QuizQuestionTypeSchema=f.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]);D.QuizOptionSchema=f.z.object({id:f.z.string().optional(),text:f.z.string(),isCorrect:f.z.boolean(),image:eo.MediaItemSchema.optional().describe("Option image."),imageAlign:ue.ImageAlignSchema.optional().describe("Option image alignment."),imageSize:ue.ImageSizeSchema.optional().describe("Option image size.")});D.QuizQuestionSchema=f.z.object({id:f.z.string().optional().describe("Question ID. Auto-generated if omitted."),type:D.QuizQuestionTypeSchema,text:f.z.string().describe("The question text."),score:f.z.number().optional(),options:f.z.array(D.QuizOptionSchema).optional().describe("Required for single-choice and multiple-choice."),correctAnswer:f.z.boolean().optional().describe("Required for true-false."),image:eo.MediaItemSchema.optional().describe("Question image."),imageAlign:ue.ImageAlignSchema.optional().describe("Question image alignment."),imageSize:ue.ImageSizeSchema.optional().describe("Question image size.")});D.QuizContentSchema=f.z.object({questions:f.z.array(D.QuizQuestionSchema).describe("Array of question objects."),showResults:f.z.boolean().optional(),allowRetry:f.z.boolean().optional(),maxRetry:f.z.string().optional(),required:f.z.boolean().optional(),submitText:f.z.string().optional().describe("Label for submit button."),timer:f.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:f.z.boolean().optional().describe("Show current/total questions count.")})});var to=g(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.ClozeContentSchema=ne.ClozeModeSchema=void 0;var Pe=B("zod");ne.ClozeModeSchema=Pe.z.enum(["write","drag-drop"]);ne.ClozeContentSchema=Pe.z.object({templateText:Pe.z.string().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),mode:ne.ClozeModeSchema.optional().describe("Input mode. Default: write.")})});var ao=g(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.AnagramContentSchema=q.WordSearchContentSchema=q.CrosswordContentSchema=q.CrosswordWordSchema=q.WordGameBlockTypeSchema=void 0;var A=B("zod"),no=F();q.WordGameBlockTypeSchema=A.z.enum(["Crossword","WordSearch","Anagram"]);q.CrosswordWordSchema=A.z.object({answer:A.z.string(),clue:A.z.string(),image:no.MediaItemSchema.optional().describe("Clue image.")});q.CrosswordContentSchema=A.z.object({words:A.z.array(q.CrosswordWordSchema)});q.WordSearchContentSchema=A.z.object({words:A.z.array(A.z.string()),gridSize:no.GridSizeSchema.optional().describe("Grid dimensions."),difficulty:A.z.enum(["easy","medium","hard"]).optional()});q.AnagramContentSchema=A.z.object({correctWord:A.z.string().describe("The correct word."),letters:A.z.array(A.z.string()).optional(),clue:A.z.string().optional().describe("A hint.")})});var io=g(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.PairGameContentSchema=R.PairSchema=R.MemoryPairTypeSchema=R.PairGameBlockTypeSchema=void 0;var G=B("zod"),De=F();R.PairGameBlockTypeSchema=G.z.enum(["Memory","MatchPairs"]);R.MemoryPairTypeSchema=G.z.enum(["img-img","img-word","word-word"]);R.PairSchema=G.z.object({id:G.z.string().optional(),type:R.MemoryPairTypeSchema.optional().describe("For Memory: pair type."),content:G.z.array(G.z.string()).optional().describe("For Memory: [item1, item2]."),leftLabel:G.z.string().optional().describe("For MatchPairs: left side text."),rightLabel:G.z.string().optional().describe("For MatchPairs: right side text."),leftImage:De.MediaItemSchema.optional().describe("For MatchPairs: left side image."),rightImage:De.MediaItemSchema.optional().describe("For MatchPairs: right side image.")});R.PairGameContentSchema=G.z.object({pairs:G.z.array(R.PairSchema).describe("Array of pair objects."),gridSize:De.GridSizeSchema.optional().describe("For Memory: grid dimensions."),instructions:G.z.string().optional().describe("For MatchPairs: instruction text.")})});var ro=g(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.DeckContentSchema=E.CardSchema=E.CardFaceSchema=E.DeckBlockTypeSchema=void 0;var Q=B("zod");E.DeckBlockTypeSchema=Q.z.enum(["Flashcard","CardDeck"]);E.CardFaceSchema=Q.z.object({type:Q.z.enum(["text","image"]),content:Q.z.any()});E.CardSchema=Q.z.object({id:Q.z.string().optional(),front:E.CardFaceSchema.optional().describe("For Flashcard: front side."),back:E.CardFaceSchema.optional().describe("For Flashcard: back side."),frontText:Q.z.string().optional().describe("For CardDeck: front text."),frontImage:Q.z.any().optional().describe("For CardDeck: front image.")});E.DeckContentSchema=Q.z.object({cards:Q.z.array(E.CardSchema).describe("Array of card objects."),backImage:Q.z.any().optional().describe("For CardDeck: shared back image."),discardLogic:Q.z.enum(["delete","return"]).optional().describe("For CardDeck.")})});var co=g(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.DiceContentSchema=ae.DieTypeSchema=void 0;var le=B("zod");ae.DieTypeSchema=le.z.enum(["d4","d6","d8","d10","d12","d20"]);ae.DiceContentSchema=le.z.object({diceType:ae.DieTypeSchema.optional(),diceCount:le.z.number().int().min(1).max(10).optional(),color:le.z.string().optional().describe("CSS color for dice."),showNumber:le.z.boolean().optional(),persistent:le.z.boolean().optional().describe("Keep dice visible after roll.")})});var lo=g(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.SpinnerContentSchema=re.SpinnerSliceSchema=void 0;var ie=B("zod"),vo=F();re.SpinnerSliceSchema=ie.z.object({id:ie.z.string().optional(),text:ie.z.string(),color:ie.z.string().optional().describe("CSS color for slice."),image:vo.MediaItemSchema.optional().describe("Slice image.")});re.SpinnerContentSchema=ie.z.object({slices:ie.z.array(re.SpinnerSliceSchema).min(2).describe("Wheel slices (min 2)."),spinDuration:ie.z.number().optional().describe("Spin duration in seconds.")})});var so=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.DragAndDropContentSchema=U.DragGroupSchema=U.DragItemSchema=void 0;var p=B("zod"),he=F(),ze=de();U.DragItemSchema=p.z.object({id:p.z.string().optional(),text:p.z.string(),background:he.MediaItemSchema.optional().describe("Background image/color for item."),opacity:p.z.number().optional().describe("Opacity of the item (0-1)."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),styles:ze.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:ze.TextStylesSchema.optional().describe("Text custom styling styles.")});U.DragGroupSchema=p.z.object({id:p.z.string().optional(),name:p.z.string().describe("Group/dropzone name."),singleItem:p.z.boolean().optional().describe("Accept only one item inside."),background:he.MediaItemSchema.optional().describe("Background image/color for group."),x:p.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:p.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),fx:p.z.number().optional().describe("Resize-invariant x as a fraction (0-1) of sandbox width. Preferred over x when present."),fy:p.z.number().optional().describe("Resize-invariant y as a fraction (0-1) of sandbox height. Preferred over y when present."),width:p.z.number().optional().describe("Manual width in pixels."),height:p.z.number().optional().describe("Manual height in pixels."),opacity:p.z.number().optional().describe("Opacity of the group (0-1)."),styles:ze.BoxStylesSchema.optional().describe("Box custom styling styles."),textStyles:ze.TextStylesSchema.optional().describe("Text custom styling styles."),items:p.z.array(U.DragItemSchema).describe("Items that belong in this group.")});U.DragAndDropContentSchema=p.z.object({groups:p.z.array(U.DragGroupSchema).min(1).describe("Drag-and-drop groups."),layout:p.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:p.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside sandbox."),showResults:p.z.boolean().optional().describe("Show result feedback immediately."),requireSubmit:p.z.boolean().optional().describe("Require an explicit 'Check' button to grade instead of auto-grading when all items are placed."),enableWrongAnswers:p.z.boolean().optional().describe("Allow placing items in incorrect groups."),groupBackground:he.MediaItemSchema.optional().describe("Shared background image/color for all groups."),itemBackground:he.MediaItemSchema.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:p.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:p.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:p.z.number().optional().describe("Proportion ratio for split layout.")})});var mo=g(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.ChartContentSchema=J.ChartConfigSchema=J.ChartTypeSchema=void 0;var O=B("zod");J.ChartTypeSchema=O.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]);J.ChartConfigSchema=O.z.object({colors:O.z.array(O.z.string()).optional(),xAxisLabel:O.z.string().optional(),yAxisLabel:O.z.string().optional(),showLegend:O.z.boolean().optional(),showTooltip:O.z.boolean().optional(),stacked:O.z.boolean().optional(),seriesNames:O.z.record(O.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")});J.ChartContentSchema=O.z.object({chartType:J.ChartTypeSchema.optional(),chartData:O.z.array(O.z.record(O.z.any())).optional().describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:J.ChartConfigSchema.optional()})});var po=g(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.BasicContentSchema=void 0;var Se=B("zod"),Ao=F();be.BasicContentSchema=Se.z.object({content:Se.z.any().optional().describe("For Editor: Plate JSON content array."),url:Se.z.string().optional().describe("For Media or Embed: content URL."),text:Se.z.string().optional().describe("For Shape: text inside shape."),mediaType:Ao.MediaTypeSchema.optional().describe("For Media: media type.")})});var qe=g(j=>{"use strict";var Oo=j&&j.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),K=j&&j.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Oo(i,a,n)};Object.defineProperty(j,"__esModule",{value:!0});K(oo(),j);K(to(),j);K(ao(),j);K(io(),j);K(ro(),j);K(co(),j);K(lo(),j);K(so(),j);K(mo(),j);K(Oe(),j);K(po(),j)});var uo=g(W=>{"use strict";var Po=W&&W.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),Do=W&&W.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),qo=W&&W.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(n){var c=[];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(c[c.length]=l);return c},a(i)};return function(i){if(i&&i.__esModule)return i;var n={};if(i!=null)for(var c=a(i),l=0;l<c.length;l++)c[l]!=="default"&&Po(n,i,c[l]);return Do(n,i),n}})();Object.defineProperty(W,"__esModule",{value:!0});W.BLOCK_CONTENT_SCHEMAS=void 0;W.generateBlockReference=Ro;var Eo=qo(B("zod-to-json-schema")),Lo=Eo.zodToJsonSchema,x=qe();W.BLOCK_CONTENT_SCHEMAS={Quiz:x.QuizContentSchema,Cloze:x.ClozeContentSchema,Crossword:x.CrosswordContentSchema,WordSearch:x.WordSearchContentSchema,Anagram:x.AnagramContentSchema,Memory:x.PairGameContentSchema,MatchPairs:x.PairGameContentSchema,Flashcard:x.DeckContentSchema,CardDeck:x.DeckContentSchema,Dice:x.DiceContentSchema,SpinningWheel:x.SpinnerContentSchema,DragAndDrop:x.DragAndDropContentSchema,Chart:x.ChartContentSchema,Puzzle:x.PuzzleContentSchema,Editor:x.BasicContentSchema,Media:x.BasicContentSchema,Embed:x.BasicContentSchema,Shape:x.BasicContentSchema};function Fo(a,i,n,c){let l=n?"*required*":"optional",h=Ee(i),u=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${a}\` (${h}, ${l})${u}`}function Ee(a){return a.enum?`enum: ${a.enum.map(i=>JSON.stringify(i)).join(" | ")}`:a.anyOf||a.oneOf?(a.anyOf||a.oneOf).map(Ee).join(" | "):Array.isArray(a.type)?a.type.join(" | "):a.type==="array"&&a.items?`array<${Ee(a.items)}>`:a.type==="object"?"object":a.type??"any"}function Le(a,i){let n=[],c=new Set(a.required??[]),l=a.properties??{};for(let[h,u]of Object.entries(l))n.push(Fo(h,u,c.has(h),i)),u.type==="object"&&u.properties?n.push(Le(u,i+" ")):u.type==="array"&&u.items?.type==="object"&&n.push(Le(u.items,i+" "));return n.join(`
|
|
5
|
+
`)}function Ro(){let a=[],i=new Map;for(let[n,c]of Object.entries(W.BLOCK_CONTENT_SCHEMAS)){let l=i.get(c)??[];l.push(n),i.set(c,l)}for(let[n,c]of i.entries()){let l=c.join(" / "),h=Lo(n,{target:"jsonSchema7"}),u=Le(h,"");a.push(`### ${l}
|
|
6
|
+
${u||"_(no configurable fields)_"}`)}return a.join(`
|
|
4
7
|
|
|
5
|
-
`)}});var
|
|
8
|
+
`)}});var Fe=g(I=>{"use strict";var Qo=I&&I.__createBinding||(Object.create?(function(a,i,n,c){c===void 0&&(c=n);var l=Object.getOwnPropertyDescriptor(i,n);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(a,c,l)}):(function(a,i,n,c){c===void 0&&(c=n),a[c]=i[n]})),X=I&&I.__exportStar||function(a,i){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&Qo(i,a,n)};Object.defineProperty(I,"__esModule",{value:!0});X(je(),I);X(F(),I);X(de(),I);X(Ue(),I);X(ve(),I);X(pe(),I);X(Xe(),I);X(Ze(),I);X(qe(),I);X(uo(),I)});var fe={};Te(fe,{CANVAS_OP_NAMES:()=>Ne,CANVAS_OP_REQUIRED:()=>se,applyItemPatch:()=>Ke,detectConflict:()=>He,entitySignature:()=>we,getAllBlockJsonSchemas:()=>Qe,getBlockJsonSchema:()=>ye,isKnownCanvasOp:()=>xe,listBlockTypes:()=>ge,opConflictStamp:()=>Ye,opTarget:()=>Ce,parseMentions:()=>$e,resolveMentions:()=>Ve,stableStringify:()=>ce,validateCanvasOp:()=>Ge});var Z={};Te(Z,{CANVAS_OP_NAMES:()=>Ne,CANVAS_OP_REQUIRED:()=>se,applyItemPatch:()=>Ke,detectConflict:()=>He,entitySignature:()=>we,getAllBlockJsonSchemas:()=>Qe,getBlockJsonSchema:()=>ye,isKnownCanvasOp:()=>xe,listBlockTypes:()=>ge,opConflictStamp:()=>Ye,opTarget:()=>Ce,parseMentions:()=>$e,resolveMentions:()=>Ve,stableStringify:()=>ce,validateCanvasOp:()=>Ge});var se={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},Ne=Object.keys(se);function xe(a){return Object.prototype.hasOwnProperty.call(se,a)}function Ge(a,i){if(!xe(a))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${a}"`]};if(typeof i!="object"||i===null||Array.isArray(i))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=i,c=se[a].filter(l=>n[l]===void 0||n[l]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(l=>`missing field: ${l}`)}:a==="groupBlocks"&&(!Array.isArray(n.blockIds)||n.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function Ke(a,i,n){let c=Array.isArray(a)?[...a]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let l=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(l,c.length)),0,n.item),c}return i==="updateItem"?c.map(l=>l&&typeof l=="object"&&l.id===n.itemId?{...l,...n.item??{}}:l):c.filter(l=>!(l&&typeof l=="object"&&l.id===n.itemId))}var fo=new Set(["position","size","rotation","zIndex","z"]);function ce(a){return a===null||typeof a!="object"?JSON.stringify(a)??"null":Array.isArray(a)?"["+a.map(ce).join(",")+"]":"{"+Object.keys(a).sort().map(n=>JSON.stringify(n)+":"+ce(a[n])).join(",")+"}"}function Ce(a,i){let n=i??{};switch(a){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return n.blockId?{kind:"block",blockId:n.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return n.blockId&&n.collection&&n.itemId?{kind:"item",blockId:n.blockId,collection:n.collection,itemId:n.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function ko(a,i){if(Array.isArray(a))for(let n of a){let c=n?.blocks?.find?.(l=>l&&l.id===i);if(c)return c}}function we(a,i){if(i.kind==="untracked")return null;let n=i.blockId?ko(a,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let h={};for(let u of Object.keys(n))fo.has(u)||(h[u]=n[u]);return ce(h)}let c=n[i.collection];if(!Array.isArray(c))return null;let l=c.find(h=>h&&h.id===i.itemId);return l?ce(l):null}function He(a,i){return a==null?"apply":i==null?"missing":a===i?"apply":"stale"}function Ye(a,i,n){let c=Ce(a,i);return{target:c,baseSignature:we(n,c)}}var _e=/@\[([^\]|]+)\|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\]/g;function $e(a){let i=[];for(let n of(a??"").matchAll(_e))i.push({name:n[1].trim(),id:n[2]});return i}function Ve(a,i){let n=new Map,c=new Map;for(let k of i?.scenes??[]){k?.id&&n.set(k.id,k);for(let C of k?.blocks??[])C?.id&&c.set(C.id,{block:C,sceneId:k.id})}let l=[],h=new Set,u=k=>c.has(k)?"il blocco selezionato":n.has(k)?"la scena selezionata":"l'elemento selezionato",ee=(k,C)=>{if(!h.has(C))if(c.has(C)){let{block:oe,sceneId:ho}=c.get(C);l.push({id:C,name:k,kind:"block",blockType:oe?.type,sceneId:ho}),h.add(C)}else n.has(C)&&(l.push({id:C,name:k,kind:"scene"}),h.add(C))},N=(a??"").replace(_e,(k,C,oe)=>(ee(C.trim(),oe),C.trim())),L=(a??"").replace(_e,(k,C,oe)=>c.has(oe)||n.has(oe)?u(oe):C.trim());return{cleanedText:N,agentText:L,entities:l}}var P={};Te(P,{getAllBlockJsonSchemas:()=>Qe,getBlockJsonSchema:()=>ye,listBlockTypes:()=>ge});var Re=We(Fe());M(P,We(Fe()));import{zodToJsonSchema as Wo}from"zod-to-json-schema";function ge(){return Object.keys(Re.BLOCK_CONTENT_SCHEMAS)}function ye(a){let i=Re.BLOCK_CONTENT_SCHEMAS[a];if(i)return Wo(i,{target:"jsonSchema7",$refStrategy:"none"})}function Qe(){return Object.fromEntries(ge().map(a=>[a,ye(a)]))}M(Z,P);M(fe,Z);export{Ne as CANVAS_OP_NAMES,se as CANVAS_OP_REQUIRED,Ke as applyItemPatch,He as detectConflict,we as entitySignature,Qe as getAllBlockJsonSchemas,ye as getBlockJsonSchema,xe as isKnownCanvasOp,ge as listBlockTypes,Ye as opConflictStamp,Ce as opTarget,$e as parseMentions,Ve as resolveMentions,ce as stableStringify,Ge as validateCanvasOp};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edugate/ai-agent",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -9,10 +9,16 @@
|
|
|
9
9
|
],
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
16
22
|
},
|
|
17
23
|
"private": false,
|
|
18
24
|
"publishConfig": {
|
|
@@ -30,8 +36,8 @@
|
|
|
30
36
|
"@edugate/types": "0.0.0"
|
|
31
37
|
},
|
|
32
38
|
"scripts": {
|
|
33
|
-
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsup
|
|
34
|
-
"dev": "tsup
|
|
39
|
+
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsup",
|
|
40
|
+
"dev": "tsup --watch",
|
|
35
41
|
"test": "vitest run",
|
|
36
42
|
"test:watch": "vitest"
|
|
37
43
|
}
|