var n=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(n==null||n.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var t=n.modules["@tiptap/core"];if(t==null)throw new Error('leptos-tiptap bridge module "@tiptap/core" is unavailable');var y=t.CommandManager,h=t.Editor,R=t.Extension,f=t.InputRule,l=t.Mark,E=t.Node,P=t.NodePos,A=t.NodeView,C=t.PasteRule,T=t.Tracker,S=t.callOrReturn,B=t.canInsertNode,N=t.combineTransactionSteps,O=t.createChainableState,w=t.createDocument,M=t.createNodeFromContent,v=t.createStyleTag,I=t.defaultBlockAt,F=t.deleteProps,D=t.elementFromString,j=t.escapeForRegEx,L=t.extensions,K=t.findChildren,H=t.findChildrenInRange,q=t.findDuplicates,G=t.findParentNode,z=t.findParentNodeClosestToPos,J=t.fromString,$=t.generateHTML,U=t.generateJSON,V=t.generateText,Y=t.getAttributes,W=t.getAttributesFromExtensions,Q=t.getChangedRanges,X=t.getDebugJSON,Z=t.getExtensionField,tt=t.getHTMLFromFragment,et=t.getMarkAttributes,nt=t.getMarkRange,ot=t.getMarkType,rt=t.getMarksBetween,it=t.getNodeAtPosition,st=t.getNodeAttributes,lt=t.getNodeType,at=t.getRenderedAttributes,dt=t.getSchema,pt=t.getSchemaByResolvedExtensions,ct=t.getSchemaTypeByName,ut=t.getSchemaTypeNameByName,gt=t.getSplittedAttributes,_t=t.getText,xt=t.getTextBetween,mt=t.getTextContentFromNodes,kt=t.getTextSerializersFromSchema,bt=t.injectExtensionAttributesToParseRule,yt=t.inputRulesPlugin,ht=t.isActive,Rt=t.isAtEndOfNode,ft=t.isAtStartOfNode,Et=t.isEmptyObject,Pt=t.isExtensionRulesEnabled,At=t.isFunction,Ct=t.isList,Tt=t.isMacOS,St=t.isMarkActive,Bt=t.isNodeActive,Nt=t.isNodeEmpty,Ot=t.isNodeSelection,wt=t.isNumber,Mt=t.isPlainObject,vt=t.isRegExp,It=t.isSafari,Ft=t.isString,Dt=t.isTextSelection,jt=t.isiOS,o=t.markInputRule,r=t.markPasteRule,a=t.mergeAttributes,Lt=t.mergeDeep,Kt=t.minMax,Ht=t.nodeInputRule,qt=t.nodePasteRule,Gt=t.objectIncludes,zt=t.pasteRulesPlugin,Jt=t.posToDOMRect,$t=t.removeDuplicates,Ut=t.resolveFocusPosition,Vt=t.rewriteUnknownContent,Yt=t.selectionToInsertionEnd,Wt=t.splitExtensions,Qt=t.textInputRule,Xt=t.textPasteRule,Zt=t.textblockTypeInputRule,te=t.wrappingInputRule;var g=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,x=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,m=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,d=l.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",a(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o({find:g,type:this.type}),o({find:x,type:this.type})]},addPasteRules(){return[r({find:_,type:this.type}),r({find:m,type:this.type})]}});var p="__LEPTOS_TIPTAP_BRIDGE__";function k(){let e=globalThis,i=e[p];if(i!=null)return i;let s={modules:{},registerExtension:()=>{throw new Error("leptos-tiptap bridge runtime is not initialized")}};return e[p]=s,s}function c(){return k()}function u(e){c().registerExtension(e)}var b={name:"bold",create:()=>d,commands:{set_bold:e=>e.chain().focus().setBold().run(),toggle_bold:e=>e.chain().focus().toggleBold().run(),unset_bold:e=>e.chain().focus().unsetBold().run()},selection_keys:["bold"],selection_state:e=>({bold:e.isActive("bold")})};function de(){u(b)}export{de as register_bold};
