AI Sales Script Generator
Run ID: 69cb208861b1021a29a862442026-03-31Business
PantheraHive BOS
BOS Dashboard

AI Sales Script Generator: Conversion-Optimized Sales Scripts

This document provides a comprehensive suite of conversion-optimized sales scripts designed to empower your sales team across various stages of the sales cycle. Each script integrates industry-specific language (using "SaaS for B2B Sales Teams" as a primary example) to resonate deeply with prospects, address their specific pain points, and clearly articulate your unique value proposition.

Our goal is to equip your team with structured yet flexible communication tools that drive higher engagement, improve conversion rates, and streamline your sales process.


1. Core Principles of Effective Sales Scripts

Before diving into specific scripts, it's crucial to understand the foundational principles that make any sales script effective:


2. Sales Script Categories

We have generated scripts for the most critical sales interactions: Cold Calls, Product Demos, Follow-ups, and Objection Handling.

2.1. Cold Call Script

Purpose: To secure a discovery call or a qualified demo by introducing value and identifying a potential need.

Key Elements:

Example Script (Industry: SaaS for B2B Sales Teams)

text • 4,515 chars
**1. Opening & Recap (First 5-10 mins)**
**SALES REP:** "Hi [Prospect's Name], thanks for joining. To ensure we make the most of our time, let's quickly recap what we discussed last time. You mentioned that [Prospect's Company Name] is looking to [reiterate their primary goal, e.g., 'increase your sales team's productivity and improve your win rates']. Specifically, you highlighted concerns around [reiterate 1-2 key pain points, e.g., 'the manual effort in personalizing outreach' and 'lack of consistent follow-up leading to missed opportunities']. Is that still accurate, and have there been any new priorities since we last spoke?"

**PROSPECT:** [Confirms or adds context]

**SALES REP:** "Excellent. My goal today is to show you how [Your Company]'s AI Sales Assistant directly addresses these challenges, helping your sales reps focus on selling by automating the tedious parts of their day. We'll specifically look at how we can enhance your **lead qualification process**, ensure **consistent, personalized follow-ups**, and provide your sales leaders with **actionable insights** into team performance."

**2. Value-Driven Product Walkthrough (25-30 mins)**
**SALES REP:** "Let's start by looking at our **AI-powered personalization engine**. Many B2B sales teams struggle with crafting unique messages for every prospect at scale. With [Your Product Name], you can see how easily reps can generate highly personalized emails and LinkedIn messages based on prospect data, ensuring every outreach feels 1-to-1. Notice how it pulls information directly from your CRM, like [mention a specific CRM field, e.g., 'their industry' or 'recent company news']. How much time do you think your reps currently spend on personalization daily?"
**[DEMO SEGMENT 1: Show personalization features]**
**SALES REP:** "And then, once outreach is sent, a common issue is inconsistent follow-up. Our **automated sequence builder** ensures no lead is ever dropped. You can see here how you can set up multi-channel sequences – email, LinkedIn, even call tasks – that adapt based on prospect engagement. This dramatically improves your response rates. What's your current process for managing follow-ups after an initial touch?"
**[DEMO SEGMENT 2: Show automated sequences and engagement tracking]**
**SALES REP:** "Finally, for sales leaders like yourself, visibility into team performance and pipeline health is critical. Our **analytics dashboard** provides real-time insights into which messages are converting, which sequences perform best, and where reps might need coaching. This helps you optimize your sales enablement strategies and predict quota attainment more accurately. How do you currently track the effectiveness of your team's outreach?"
**[DEMO SEGMENT 3: Show analytics dashboard]**

**3. Q&A and Impact Discussion (10 mins)**
**SALES REP:** "That was a quick overview. What are your initial thoughts, [Prospect's Name]? Do you see how these capabilities could impact your team's efficiency and lead conversion?"
**PROSPECT:** [Asks questions, provides feedback]
**SALES REP:** "Those are great questions. To address [specific question], our integration with [Their CRM, e.g., Salesforce] is seamless and typically takes less than an hour to set up, pulling all relevant contact data directly. This ensures your sales reps have a unified view without toggling between systems.

Thinking about your team's current challenges, if you were able to [reiterate key benefit 1, e.g., 'reduce the time spent on manual personalization by 50%'] and [reiterate key benefit 2, e.g., 'increase your lead response rates by 15%'], what kind of impact would that have on your overall sales objectives for this quarter?"

**4. Next Steps & Close (5 mins)**
**SALES REP:** "Based on what we've discussed today, it sounds like [Your Product Name] could be a significant asset for [Prospect's Company Name] in achieving your sales efficiency goals.

The usual next step for our clients is a brief follow-up call with your [relevant stakeholder, e.g., Head of Sales Operations or IT] to discuss integration specifics and a proposal outlining the ROI. Would you be open to scheduling that for early next week? Perhaps Tuesday morning or Thursday afternoon?"

**PROSPECT:** [Responds]

**SALES REP (if yes):** "Excellent. I'll send over a calendar invite shortly, along with a brief summary of what we covered today and a link to a relevant case study of a company similar to yours. Thank you for your time, [Prospect's Name]."
Sandboxed live preview

Marketing Strategy for AI Sales Script Generator

This comprehensive marketing strategy outlines the approach to effectively position, promote, and scale the "AI Sales Script Generator" in the market. It covers target audience analysis, recommended channels, a robust messaging framework, and key performance indicators to measure success.


1. Target Audience Analysis

Understanding who benefits most from the AI Sales Script Generator is crucial for precise targeting and messaging.

1.1. Primary Audience

  • Job Titles: VP of Sales, Sales Director, Sales Manager, Sales Enablement Manager, Head of Business Development, Chief Revenue Officer (CRO).
  • Company Size: Small to Medium-sized Businesses (SMBs) and Mid-Market Enterprises.

Rationale:* SMBs often lack dedicated sales enablement resources and need efficiency boosts. Mid-market companies seek to standardize processes and scale effectively. Large enterprises may have existing solutions but could benefit from advanced AI capabilities for niche teams or new product launches.

  • Industries: B2B SaaS, Technology, Financial Services, Real Estate, Healthcare, Consulting, Insurance, Telecommunications – any industry with a structured, high-volume, or complex sales process.
  • Geographic Focus: Initially, focus on markets with high technology adoption and competitive sales environments (e.g., North America, Western Europe).

1.2. Psychographics & Pain Points

  • Inconsistent Messaging: Sales teams struggle to deliver a consistent, on-brand message across all reps and interactions, leading to diluted brand perception and lower conversion rates.
  • Low Sales Productivity/Efficiency: Reps spend too much time crafting scripts, researching prospects, or struggling with objections, reducing actual selling time.
  • High Rep Onboarding/Ramp-up Time: New sales hires take too long to become productive due to extensive training on product knowledge, sales techniques, and objection handling.
  • Suboptimal Conversion Rates: Existing scripts or ad-hoc approaches fail to consistently convert prospects into customers.
  • Difficulty with Objection Handling: Sales reps lack confidence or effective strategies to handle complex or common objections, leading to stalled deals.
  • Lack of Personalization at Scale: Inability to personalize outreach and conversations efficiently for a large volume of prospects.
  • Fear of Cold Calling/Initial Outreach: New or less experienced reps lack confidence in initiating calls without a solid script.

1.3. Goals & Motivations

  • Increase Sales Efficiency & Productivity: Streamline script generation and reduce time spent on preparation.
  • Boost Conversion Rates: Improve the effectiveness of sales conversations across all stages.
  • Ensure Message Consistency & Brand Alignment: Standardize communication to reflect brand values and product messaging.
  • Reduce Sales Cycle Length: Move prospects through the funnel faster with compelling, relevant communication.
  • Empower Sales Reps: Provide tools that build confidence and effectiveness, especially for new hires.
  • Scale Sales Operations: Facilitate rapid growth by providing a repeatable, high-performance sales communication framework.
  • Gain Competitive Advantage: Leverage AI to outperform competitors with superior sales interactions.

1.4. Buyer Personas

  1. "The Strategic Sales Leader" (VP of Sales/CRO):

* Focus: Revenue growth, market share, team performance, scalability, ROI.

* Needs: A solution that provides data-driven insights, ensures consistent messaging across large teams, reduces ramp-up time, and contributes directly to hitting revenue targets.

* Quote: "I need to equip my team with tools that guarantee consistent, high-performing conversations and help us scale without sacrificing quality."

  1. "The Sales Enablement Architect" (Sales Enablement Manager/Director):

* Focus: Training, content management, sales process optimization, rep productivity.

* Needs: A tool that simplifies script creation, facilitates easy distribution, helps track script effectiveness, and integrates seamlessly into existing enablement workflows.

* Quote: "My priority is to ensure every rep has access to the best possible content and training to close deals faster and more effectively."

  1. "The Ambitious Account Executive" (Individual Sales Rep):

* Focus: Hitting quota, personal development, closing deals, overcoming challenges.

* Needs: Practical, easy-to-use scripts that help them confidently handle cold calls, deliver impactful demos, respond to objections, and personalize outreach quickly.

* Quote: "I need smart scripts that give me the right words at the right time, so I can focus on building rapport and closing deals."


2. Channel Recommendations

A multi-channel approach will ensure maximum reach and engagement with the defined target audience.

2.1. Digital Marketing Channels

  • Content Marketing:

* Blog Posts: "How AI is Revolutionizing Sales Scripting," "X Ways to Boost Cold Call Conversions with AI," "Master Objection Handling: An AI-Powered Guide."

* Whitepapers/eBooks: "The Definitive Guide to AI in Sales Enablement," "Scaling Your Sales Team with Intelligent Scripting."

* Case Studies: Detailed success stories showcasing ROI for different industries (e.g., "How a SaaS Company Increased Demo-to-Opportunity by 20% with AI Scripts").

* Webinars/Workshops: Host live sessions demonstrating the product, inviting sales thought leaders, and discussing industry trends.

* Templates/Checklists: Offer free, basic AI-generated script templates or checklists as lead magnets.

  • Search Engine Optimization (SEO):

* Keyword Targeting: Optimize for high-intent keywords like "AI sales script generator," "sales script software," "cold call script AI," "objection handling AI," "sales enablement tools," "sales productivity AI," "conversion optimized scripts."

* Technical SEO: Ensure fast loading times, mobile responsiveness, and clean site architecture.

* Local SEO: If relevant for specific regions or in-person events.

  • Paid Advertising (SEM & Social Ads):

* Google Ads (Search & Display): Target users actively searching for sales script solutions, sales enablement tools, or solutions to specific pain points (e.g., "improve cold call success").

* LinkedIn Ads: Highly effective for B2B. Target by job title (VP Sales, Sales Manager), industry, company size, and specific skills (e.g., "sales enablement"). Focus on pain points and ROI.

* Facebook/Instagram Ads: Primarily for retargeting website visitors, lead nurturing, and lookalike audiences based on existing customer data.

* Software Review Sites (e.g., G2, Capterra): Paid placements and organic presence on relevant comparison pages.

  • Email Marketing:

* Nurture Sequences: For leads acquired through content downloads, webinars, or demo requests. Progress from awareness to consideration to decision.

* Product Updates & Feature Announcements: Keep existing and potential customers informed.

* Personalized Outreach: Targeted campaigns to specific accounts or personas identified through account-based marketing (ABM).

  • Social Media Marketing:

* LinkedIn: Establish thought leadership, share company news, post sales tips, engage in sales-focused groups, and showcase product features.

* Twitter: Share industry news, quick tips, engage with sales influencers, and promote content.

* YouTube: Product demos, tutorials, "how-to" videos, customer testimonials, and short explainer videos.

2.2. Strategic Partnerships & Offline Channels

  • Integrations & Ecosystem Partnerships:

* Develop seamless integrations with leading CRMs (Salesforce, HubSpot), Sales Engagement Platforms (Outreach, Salesloft), Call Intelligence tools (Gong, Chorus.ai), and communication platforms (Zoom).

* Co-marketing efforts with complementary sales tech providers.

  • Industry Events & Conferences:

* Sponsor or exhibit at major sales conferences (e.g., Dreamforce, Sales 3.0 Conference, Forrester B2B Summit).

* Host speaking sessions or workshops demonstrating the power of AI in sales scripting.

  • Referral Programs:

* Incentivize existing satisfied customers to refer new leads.

* Partner with sales consultants, coaches, and enablement agencies for referrals.

  • PR & Media Relations:

* Target tech and sales industry publications for product announcements, thought leadership articles, and expert commentary.


3. Messaging Framework

The messaging framework will ensure consistent, compelling communication that resonates with the target audience's pain points and aspirations.

3.1. Core Value Proposition

"Empower your sales team with AI-driven, conversion-optimized scripts that adapt to any sales scenario, boosting consistency, confidence, and closing rates across the board."

3.2. Key Benefits (by Use Case)

  • For Cold Calls: "Break the ice and qualify leads faster with compelling, personalized opening lines and dynamic conversation starters."
  • For Demos: "Structure your product demos for maximum impact, highlighting features that resonate with specific client needs and anticipated questions."
  • For Follow-ups: "Craft persuasive follow-up emails and calls that re-engage prospects, address concerns, and effectively move deals forward."
  • For Objection Handling: "Anticipate and overcome common and complex objections with intelligent, pre-vetted responses that keep the conversation flowing and build trust."
  • Overall: "Reduce sales rep ramp-up time by X%," "Ensure brand messaging consistency across your entire sales force," "Increase sales efficiency and productivity by

2.3. Follow-Up Scripts

Purpose: To maintain engagement, provide value, recap discussions, and move the sales process forward after various interactions.

Key Elements:

  • Timeliness:
gemini Output

AI Sales Script Generator: Your Conversion-Optimized Toolkit

Welcome to your AI Sales Script Generator! This comprehensive toolkit is designed to equip your sales team with highly effective, conversion-optimized scripts tailored for various stages of the sales cycle. Leveraging advanced AI, we generate professional, industry-specific language that resonates with your target audience, ensuring every interaction is impactful and drives results.

How It Works: Crafting High-Impact Sales Conversations

Our AI system analyzes your specific product/service, target audience, industry nuances, and desired sales outcomes to construct scripts that are not only persuasive but also natural and adaptable. This process ensures:

  • Relevance: Scripts are precisely aligned with your offerings and customer needs.
  • Persuasiveness: Engineered with proven sales methodologies to maximize conversion rates.
  • Professionalism: Polished language that enhances your brand's credibility.
  • Adaptability: Designed with flexibility in mind, allowing your team to personalize interactions while staying on message.

Core Elements of a Winning Sales Script

Every script generated incorporates key elements essential for a successful sales conversation:

  • Compelling Opening/Hook: Immediately grabs attention and establishes relevance.
  • Problem Identification: Articulates common pain points or challenges your target audience faces.
  • Solution Presentation: Clearly positions your product/service as the ideal solution.
  • Unique Value Proposition: Highlights what makes your offering superior and distinct.
  • Benefit-Oriented Language: Focuses on the positive outcomes for the customer, not just features.
  • Clear Call to Action (CTA): Guides the prospect to the next logical step (e.g., demo, meeting, trial).
  • Anticipated Objection Handling: Prepares your team to address common concerns confidently.
  • Professional Close: Ensures a positive and clear conclusion to the interaction.

Script Categories & Detailed Examples

We provide a range of scripts to cover critical sales scenarios, each optimized for its specific purpose:

1. Cold Call Scripts

Designed to break through the noise, generate interest, and secure initial discovery calls or meetings.

  • Purpose: To quickly qualify a lead, identify a potential need, and secure a commitment for a follow-up conversation.
  • Structure:

1. Permission-Based Opening: Respects the prospect's time.

2. Brief Introduction: State who you are and your company.

3. Value Proposition/Hook: Immediately connect to a common pain point relevant to their industry.

4. Open-Ended Question: To gauge interest and confirm relevance.

5. Proposed Next Step: A low-pressure commitment (e.g., "Would you be open to a brief 15-minute call next week?").

  • Example Snippet (Industry: SaaS for Marketing Agencies):

> "Hi [Prospect Name], this is [Your Name] from [Your Company]. I know you're busy, so I'll be brief. We specialize in helping marketing agencies like yours streamline their client reporting and campaign analytics, often reducing manual work by up to 50%. Many of our clients struggled with inconsistent data and time-consuming report generation. Is that something you've encountered at [Prospect Company]?"

2. Demo Presentation Scripts

Structured to guide prospects through your product/service, highlighting key features and benefits in a logical, impactful manner.

  • Purpose: To showcase your solution's capabilities, address specific prospect needs identified during discovery, and build excitement.
  • Structure:

1. Recap & Agenda: Reiterate understanding of their needs and outline what will be covered.

2. Problem-Solution Framework: For each key feature, state the problem it solves, demonstrate the feature, and explain the benefit.

3. Interactive Elements: Encourage questions and feedback.

4. Addressing Key Pain Points: Directly show how your solution alleviates their specific challenges.

5. Future Vision: Illustrate how their business will improve with your solution.

6. Next Steps & Q&A: Clearly define what happens after the demo.

  • Example Snippet (Industry: FinTech for Small Businesses):

> "Based on our earlier conversation, [Prospect Name], I understand that managing cash flow and automating invoice reconciliation are top priorities for [Prospect Company]. Let's dive into how our 'SmartFlow Accounting' module directly addresses this. As you can see here, our AI-powered reconciliation automatically matches incoming payments to invoices, reducing manual input errors and freeing up your team's time from hours to just minutes each week. How do you currently handle this process, and what challenges do you face?"

3. Follow-Up Scripts (Email & Call)

Designed to maintain engagement, provide additional value, and move the sales process forward after initial contact or a demo.

  • Purpose: To reinforce value, answer lingering questions, provide relevant resources, and prompt the next action.
  • Structure (Email):

1. Clear Subject Line: Remind them of the previous interaction.

2. Personalized Opening: Reference specifics from your last conversation.

3. Value Reinforcement: Briefly reiterate a key benefit or solution discussed.

4. Resource/Information: Provide something valuable (e.g., case study, relevant article, personalized summary).

5. Clear Call to Action: Suggest the next logical step.

  • Example Snippet (Email - After Demo, Industry: Cybersecurity for Enterprises):

> Subject: Following Up: Your Cybersecurity Posture with [Your Company Name]

>

> "Hi [Prospect Name],

>

> Great speaking with you yesterday and demonstrating how [Your Product Name] can enhance [Prospect Company]'s threat detection and incident response capabilities.

>

> I recall you were particularly interested in our real-time anomaly detection for zero-day threats. I've attached a brief case study on how a similar enterprise achieved a 30% reduction in critical security incidents within the first six months using our platform.

>

> Would you be available for a quick 15-minute call next Tuesday to discuss any lingering questions and explore setting up a proof of concept?"

4. Objection Handling Frameworks

Provides structured responses to common objections, empowering your sales team to overcome hurdles confidently and effectively.

  • Purpose: To acknowledge, understand, and skillfully address prospect concerns, turning potential roadblocks into opportunities.
  • Framework (Acknowledge, Clarify, Reframe, Solution):

1. Acknowledge: Validate their concern ("I understand," "That's a fair point").

2. Clarify: Ask open-ended questions to understand the root cause ("Could you tell me more about what concerns you about X?").

3. Reframe: Shift their perspective or provide new information.

4. Solution: Offer a direct solution, a workaround, or a different angle.

  • Common Objections & Example Responses: (Industry: B2B Marketing Automation)

* Objection: "It's too expensive."

* Response: "I understand budget is a significant consideration, and you want to ensure a strong ROI. Can you share a bit more about what you're currently spending on marketing efforts, and what kind of return you're expecting from a solution like ours? Many of our clients find that the efficiency gains and increased lead quality quickly offset the investment, often within the first year, by reducing manual labor and improving conversion rates."

* Objection: "We're happy with our current solution."

* Response: "That's great to hear, and it sounds like you've already invested in marketing automation. Many of our customers were also using existing platforms before they explored [Your Product Name]. They often find that while their current solution handles basic tasks, [Your Product Name]'s advanced AI segmentation and predictive analytics offer a deeper level of personalization and campaign optimization that wasn't possible before. Could I briefly highlight one or two key differentiators that might provide additional value?"

* Objection: "I need to talk to my manager/team."

* Response: "Absolutely, that's completely understandable. It's important that everyone involved feels confident in the decision. What information or aspects of [Your Product Name] do you think would be most important for your manager/team to review? Perhaps I could put together a brief summary or even join a call with them to answer any questions directly?"

The Power of Industry-Specific Language

A critical differentiator of our AI Sales Script Generator is its ability to integrate authentic, industry-specific terminology and address sector-specific pain points. This ensures:

  • Instant Credibility: Your sales team speaks the prospect's language, building trust.
  • Enhanced Relevance: Messages directly address challenges unique to their industry, making solutions more compelling.
  • Reduced Friction: Avoids generic jargon, allowing for clearer, more impactful communication.

Our AI models are trained on vast datasets encompassing various industries, enabling them to identify and utilize the most effective phrasing for your target market, whether it's healthcare, finance, manufacturing, tech, or any other sector.

Customization & Continuous Optimization

These scripts serve as a robust foundation, but we encourage active customization and continuous optimization.

  • Personalization: Your sales team should always personalize details to the individual prospect (e.g., company name, specific projects, recent news).
  • Feedback Loop: We recommend tracking script performance (e.g., call-to-meeting rates, demo-to-close rates) and providing feedback. Our AI can then learn and refine scripts over time for even better results.
  • A/B Testing: For critical stages, consider A/B testing different script variations to identify the most effective messaging.

Next Steps: Accessing and Implementing Your Scripts

Your detailed, conversion-optimized sales scripts are now ready.

  1. Review Your Generated Scripts: You will find the full, comprehensive scripts tailored to your specific product/service and industry in the attached document/platform section.
  2. Train Your Team: Familiarize your sales team with these scripts, emphasizing the core messages and flexibility for personalization.
  3. Start Selling: Implement these scripts across your cold calls, demos, follow-ups, and objection handling scenarios.
  4. Provide Feedback: Share your experiences and results with us. Your insights are invaluable for future refinements and ensuring ongoing success.

We are confident that these AI-generated sales scripts will significantly enhance your sales team's effectiveness and drive higher conversion rates. Please reach out to your dedicated account manager for any questions or further customization requests.

ai_sales_script_generator.txt
Download source file
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}