PageSourceSearch

https://podtoo.com/_next/static/chunks/pages/dashboard/syndication…/socials/shorts-8806eab4ad23d00a.js

js podtoo.com collected 2026-10-02 13:00:40 UTC 11,797 bytes, 246 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4fbc788a-dcc3-41ed-a978-c074d8579f20",e._sentryDebugIdIdentifier="sentry-dbid-4fbc788a-dcc3-41ed-a978-c074d8579f20");}catch(e){}}();
2(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2843],{
3
4/***/ 92058:
5/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
6
7
8    (window.__NEXT_P = window.__NEXT_P || []).push([
9      "/dashboard/syndication/[id]/[episodeid]/socials/shorts",
10      function () {
11        return __webpack_require__(51853);
12      }
13    ]);
14    if(false) {}
15  
16
17/***/ }),
18
19/***/ 61526:
20/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
21
22"use strict";
23/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);
24/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67294);
25/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87066);
26
27
28
29const TranscriptSelector = ()=>{
30    const [transcript, setTranscript] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
31    const [selectedSegments, setSelectedSegments] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
32    const [playingSegment, setPlayingSegment] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
33    const [currentTime, setCurrentTime] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
34    const transcriptRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
35    const audioRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
36    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
37        // Fetch the VTT file from the server
38        axios__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.get("https://cdn.podtoo.com/transcription/1718637914098full_episode_SPORTSWRAP170624-Final_2024-06-18T06:50:03.677926.vtt").then((response)=>{
39            const vttData = response.data;
40            // Parse VTT file here and set the transcript state
41            const parsedTranscript = parseVTT(vttData);
42            setTranscript(parsedTranscript);
43        });
44    }, []);
45    const parseVTT = (vttData)=>{
46        const transcript = [];
47        const vttLines = vttData.split("\n");
48        let currentCue = null;
49        const timePattern = /(\d{2}):(\d{2}):(\d{2})\.(\d{3,7}) --> (\d{2}):(\d{2}):(\d{2})\.(\d{3,7})/;
50        for(let i = 0; i < vttLines.length; i++){
51            const line = vttLines[i].trim();
52            if (timePattern.test(line)) {
53                const match = timePattern.exec(line);
54                if (match) {
55                    const startTime = parseTimeToSeconds(match[1], match[2], match[3], match[4]);
56                    const endTime = parseTimeToSeconds(match[5], match[6], match[7], match[8]);
57                    currentCue = {
58                        start: startTime,
59                        end: endTime,
60                        text: ""
61                    };
62                }
63            } else if (currentCue) {
64                if (line === "") {
65                    transcript.push(currentCue);
66                    currentCue = null;
67                } else {
68                    currentCue.text += (currentCue.text ? " " : "") + line;
69                }
70            }
71        }
72        return transcript;
73    };
74    const parseTimeToSeconds = (hours, minutes, seconds, milliseconds)=>{
75        return parseInt(hours) * 3600 + parseInt(minutes) * 60 + parseInt(seconds) + parseInt(milliseconds) / 1000;
76    };
77    const formatTime = (seconds)=>{
78        const hrs = Math.floor(seconds / 3600);
79        const mins = Math.floor(seconds % 3600 / 60);
80        const secs = Math.floor(seconds % 60);
81        const millis = Math.floor(seconds % 1 * 1000);
82        return "".concat(hrs.toString().padStart(2, "0"), ":").concat(mins.toString().padStart(2, "0"), ":").concat(secs.toString().padStart(2, "0"), ".").concat(millis.toString().padStart(3, "0"));
83    };
84    const handleSelectSegment = (segment)=>{
85        setSelectedSegments((prev)=>[
86                ...prev,
87                {
88                    start: segment.start,
89                    end: segment.end,
90                    text: segment.text
91                }
92            ]);
93    };
94    const handleGenerateClip = ()=>{
95        const totalDuration = selectedSegments.reduce((acc, seg)=>acc + (seg.end - seg.start), 0);
96        if (totalDuration <= 60) {
97            axios__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.post("/api/generate-clip", {
98                segments: selectedSegments
99            }).then((response)=>{
100            // Handle the response, e.g., provide a download link for the generated video
101            });
102        } else {
103            alert("Total duration of selected segments exceeds 60 seconds.");
104        }
105    };
106    const handleRemoveSegment = (index)=>{
107        setSelectedSegments((prev)=>prev.filter((_, i)=>i !== index));
108    };
109    const handlePlaySegment = (segment)=>{
110        alert(JSON.stringify(segment));
111        if (audioRef.current) {
112            audioRef.current.currentTime = parseFloat(segment.start.toFixed(3));
113            audioRef.current.play();
114            setPlayingSegment(segment);
115        }
116    };
117    const handleTimeUpdate = ()=>{
118        if (audioRef.current) {
119            setCurrentTime(audioRef.current.currentTime);
120            if (playingSegment && audioRef.current.currentTime >
120= playingSegment.end) {
121                audioRef.current.pause();
122                setPlayingSegment(null);
123            }
124        }
125    };
126    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
127        children: [
128            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
129                ref: transcriptRef,
130                children: transcript.map((item, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
131                        children: [
132                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
133                                children: [
134                                    formatTime(item.start),
135                                    " - ",
136                                    formatTime(item.end),
137                                    ": ",
138                                    item.text
139                                ]
140                            }),
141                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", {
142                                onClick: ()=>handleSelectSegment(item),
143                                children: "Select"
144                            })
145                        ]
146                    }, index))
147            }),
148            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
149                children: [
150                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", {
151                        children: "Selected Segments:"
152                    }),
153                    selectedSegments.map((seg, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
154                            children: [
155                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
156                                    children: [
157                                        formatTime(seg.start),
158                                        " - ",
159                                        formatTime(seg.end),
160                                        ": ",
161                                        seg.text
162                                    ]
163                                }),
164                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", {
165                                    onClick: ()=>handleRemoveSegment(index),
166                                    children: "Remove"
167                                }),
168                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", {
169                                    onClick: ()=>handlePlaySegment(seg),
170                                    children: "Play"
171                                })
172                            ]
173                        }, index)),
174                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", {
175                        onClick: handleGenerateClip,
176                        children: "Generate Clip"
177                    })
178                ]
179            }),
180            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
181                children: [
182                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
183                        children: [
184                            "Current Time: ",
185                            formatTime(currentTime)
186                        ]
187                    }),
188                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("audio", {
189                        ref: audioRef,
190                        onTimeUpdate: handleTimeUpdate,
191                        src: "https://cdn.podtoo.com/syndication/2024/06/1718637914098full_episode_SPORTSWRAP170624-Final.mp3",
192                        controls: true
193                    })
194                ]
195            })
196        ]
197    });
198};
199/* harmony default export */ __webpack_exports__.Z = (TranscriptSelector);
200
201
202/***/ }),
203
204/***/ 51853:
205/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
206
207"use strict";
208__webpack_require__.r(__webpack_exports__);
209/* harmony export */ __webpack_require__.d(__webpack_exports__, {
210/* harmony export */   __N_SSP: function() { return /* binding */ __N_SSP; }
211/* harmony export */ });
212/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);
213/* harmony import */ var _hocs_withTheme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23818);
214/* harmony import */ var _components_dashboard_marketing_socialMedia_TranscriptSelector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61526);
215/* harmony import */ var _barrel_optimize_names_Box_mui_material__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3314);
216
217
218
219
220const SocialShorts = (param)=>{
221    let { minimized, SyndicationId, apiData } = param;
222    const contentStyle = {
223        paddingLeft: minimized ? "70px" : "260px",
224        marginRight: "1em",
225        marginBottom: "1em"
226    };
227    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_barrel_optimize_names_Box_mui_material__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
228        pt: 10,
229        sx: contentStyle,
230        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_dashboard_marketing_socialMedia_TranscriptSelector__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {})
231    });
232};
233var __N_SSP = true;
234/* harmony default export */ __webpack_exports__["default"] = ((0,_hocs_withTheme__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(SocialShorts, "dashboard", true));
235
236
237/***/ })
238
239},
240/******/ function(__webpack_require__) { // webpackRuntimeModules
241/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
242/******/ __webpack_require__.O(0, [7466,1664,301,7066,3818,2888,9774,179], function() { return __webpack_exec__(92058); });
243/******/ var __webpack_exports__ = __webpack_require__.O();
244/******/ _N_E = __webpack_exports__;
245/******/ }
246]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.