var n=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(n==null||n.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var e=n.modules["@tiptap/core"];if(e==null)throw new Error('leptos-tiptap bridge module "@tiptap/core" is unavailable');var k=e.CommandManager,b=e.Editor,y=e.Extension,h=e.InputRule,i=e.Mark,R=e.Node,E=e.NodePos,f=e.NodeView,C=e.PasteRule,P=e.Tracker,T=e.callOrReturn,A=e.canInsertNode,S=e.combineTransactionSteps,w=e.createChainableState,N=e.createDocument,O=e.createNodeFromContent,B=e.createStyleTag,M=e.defaultBlockAt,v=e.deleteProps,I=e.elementFromString,F=e.escapeForRegEx,D=e.extensions,j=e.findChildren,L=e.findChildrenInRange,K=e.findDuplicates,H=e.findParentNode,q=e.findParentNodeClosestToPos,G=e.fromString,z=e.generateHTML,J=e.generateJSON,U=e.generateText,V=e.getAttributes,Y=e.getAttributesFromExtensions,Q=e.getChangedRanges,W=e.getDebugJSON,X=e.getExtensionField,Z=e.getHTMLFromFragment,$=e.getMarkAttributes,ee=e.getMarkRange,te=e.getMarkType,ne=e.getMarksBetween,oe=e.getNodeAtPosition,re=e.getNodeAttributes,ie=e.getNodeType,se=e.getRenderedAttributes,le=e.getSchema,ae=e.getSchemaByResolvedExtensions,de=e.getSchemaTypeByName,pe=e.getSchemaTypeNameByName,ce=e.getSplittedAttributes,ue=e.getText,ge=e.getTextBetween,_e=e.getTextContentFromNodes,xe=e.getTextSerializersFromSchema,me=e.injectExtensionAttributesToParseRule,ke=e.inputRulesPlugin,be=e.isActive,ye=e.isAtEndOfNode,he=e.isAtStartOfNode,Re=e.isEmptyObject,Ee=e.isExtensionRulesEnabled,fe=e.isFunction,Ce=e.isList,Pe=e.isMacOS,Te=e.isMarkActive,Ae=e.isNodeActive,Se=e.isNodeEmpty,we=e.isNodeSelection,Ne=e.isNumber,Oe=e.isPlainObject,Be=e.isRegExp,Me=e.isSafari,ve=e.isString,Ie=e.isTextSelection,Fe=e.isiOS,s=e.markInputRule,l=e.markPasteRule,a=e.mergeAttributes,De=e.mergeDeep,je=e.minMax,Le=e.nodeInputRule,Ke=e.nodePasteRule,He=e.objectIncludes,qe=e.pasteRulesPlugin,Ge=e.posToDOMRect,ze=e.removeDuplicates,Je=e.resolveFocusPosition,Ue=e.rewriteUnknownContent,Ve=e.selectionToInsertionEnd,Ye=e.splitExtensions,Qe=e.textInputRule,We=e.textPasteRule,Xe=e.textblockTypeInputRule,Ze=e.wrappingInputRule;var g=/(^|[^`])`([^`]+)`(?!`)/,_=/(^|[^`])`([^`]+)`(?!`)/g,d=i.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",a(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[s({find:g,type:this.type})]},addPasteRules(){return[l({find:_,type:this.type})]}});var p="__LEPTOS_TIPTAP_BRIDGE__";function x(){let t=globalThis,o=t[p];if(o!=null)return o;let r={modules:{},registerExtension:()=>{throw new Error("leptos-tiptap bridge runtime is not initialized")}};return t[p]=r,r}function c(){return x()}function u(t){c().registerExtension(t)}var m={name:"code",create:()=>d,commands:{set_code:t=>t.chain().focus().setCode().run(),toggle_code:t=>t.chain().focus().toggleCode().run(),unset_code:t=>t.chain().focus().unsetCode().run()}};function lt(){u(m)}export{lt as register_code};
