1/*! For license information please see reactPlayerTiktok.fdbd57d2.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkams_pro=self.webpackChunkams_pro||[]).push([[85],{20155:(e,t,o)=>{o.r(t),o.d(t,{default:()=>w});var n=o(65043);const s=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,i={INIT:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3},r={[i.INIT]:"emptied",[i.PAUSED]:"pause",[i.ENDED]:"ended",[i.PLAYING]:"play",[i.BUFFERING]:"waiting"};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o={src:l(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(o["data-config"]=JSON.stringify(t.config)),`\n <style>\n :host {\n display:inline-block;\n min-width: 300px;\n min-height: 150px;\n position: relative;\n }\n iframe {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n height:100%;\n border:0;\n }\n </style>\n <iframe ${function(e){let t="";for(const o in e){const n=e[o];t+=""===n?` ${d(o)}`:` ${d(o)}="${d(`${n}`)}"`}return t}(o)} title="TikTok video"></iframe>\n `}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.src)return;const o=e.src.match(s);return`https://www.tiktok.com/player/v1/${o&&o[1]}?${function(e){return String(new URLSearchParams(function(e){let t={};for(let o in e){let n=e[o];!0===n||""===n?t[o]=1:!1===n?t[o]=0:null!=n&&(t[o]=n)}return t}(e)))}({controls:""===e.controls?null:0,autoplay:e.autoplay,muted:e.muted,loop:e.loop,rel:0,...t.config})}`}class u extends(globalThis.HTMLElement??class{}){static getTemplateHTML=(()=>a)();static shadowRootOptions={mode:"open"};static get observedAttributes(){return["src","controls","loop","autoplay","muted"]}loadComplete=(()=>new c)();#e;#t;#o=!1;#n=0;#s=!0;#i=null;#r=100;#a=0;#l;constructor(){super(),this.#u("config")}async load(){if(this.#e)return;this.shadowRoot||this.attachShadow(u.shadowRootOptions);const e=!this.#t;if(this.#t&&(this.loadComplete=new c),this.#t=!0,await(this.#e=Promise.resolve()),this.#e=null,this.#n=0,this.#o=!1,this.#s=!0,!this.src)return this.shadowRoot.innerHTML="",void globalThis.removeEventListener("message",this.#c);let t=this.shadowRoot.querySelector("iframe");const o=function(e){let t={};for(let o of e)t[o.name]=o.value;return t}(this.attributes);e&&t&&(this.#i=JSON.parse(t.getAttribute("data-config")||"{}")),(null==t?void 0:t.src)&&t.src===l(o,this)||(this.shadowRoot.innerHTML=a(o,this),t=this.shadowRoot.querySelector("iframe")),this.#l=t,globalThis.addEventListener("message",this.#c)}async attributeChangedCallback(e,t,o){if(t!==o)switch(e){case"muted":await this.loadComplete,this.muted=null!=o;break;case"autoplay":case"controls":case"loop":case"src":return void this.load()}}get config(){return this.#i}set config(e){this.#i=e}#c=e=>{var t;if(e.source!==(null==(t=this.#l)?void 0:t.contentWindow))return;const o=e.data;if(null==o?void 0:o["x-tiktok-player"])switch(o.type){case"onPlayerReady":this.loadComplete.resolve();break;case"onStateChange":{this.#s=[i.INIT,i.PAUSED,i.ENDED].includes(o.value);const e=r[o.value];e&&this.dispatchEvent(new Event(e));break}case"onCurrentTime":this.#n=o.value.currentTime,this.#a=o.value.duration,this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("timeupdate"));break;case"onVolumeChange":this.#r=o.value,this.dispatchEvent(new Event("volumechange"));break;case"onMute":this.#o=!!o.value,this.#r=o.value?0:this.#r,this.dispatchEvent(new Event("volumechange"));break;case"onError":this.dispatchEvent(new Event("error"));break;default:console.warn("Unhandled TikTok player message:",o)}};#d(e,t){var o;if(!(null==(o=this.#l)?void 0:o.contentWindow))return;const n={"x-tiktok-player":!0,type:e,...void 0!==t?{value:t}:{}};this.#l.contentWindow.postMessage(n,"*")}async play(){await this.loadComplete,this.#d("play")}async pause(){await this.loadComplete,this.#d("pause")}async#h(e){await this.loadComplete,this.#d("seekTo",Number(e))}async#p(){await this.loadComplete,this.#d("mute")}async#m(){await this.loadComplete,this.#d("unMute")}get volume(){return this.#r/100}set volume(e){console.warn("Volume control is not supported for TikTok videos.")}get currentTime(){return this.#n}set currentTime(e){this.#h(e)}get muted(){return this.#o}set muted(e){this.#o=e,e?this.#p():this.#m()}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.toggleAttribute("muted",!!e)}get paused(){return this.#s}get duration(){return this.#a}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e??"")}#u(e){if(Object.prototype.hasOwnProperty.call(this,e)){const t=this[e];delete this[e],this[e]=t}}}class c extends Promise{constructor(){let e,t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};super(((n,s)=>{o(n,s),e=n,t=s})),this.resolve=e,this.reject=t}}function d(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}globalThis.customElements&&!globalThis.customElements.get("tiktok-video")&&globalThis.customElements.define("tiktok-video",u);var h=u,p=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),m={className:"class",htmlFor:"for"};function f(e){return e.toLowerCase()}function v(e){return"boolean"===typeof e?e?"":void 0:"function"===typeof e||"object"===typeof e&&null!==e?void 0:e}function g(e,t,o){var n;e[t]=o,null==o&&t in((null==(n=globalThis.HTMLElement)?void 0:n.prototype)??{})&&e.removeAttribute(t)}var w=function(e){let{react:t,tagName:o,elementClass:n,events:s,displayName:i,defaultProps:r,toAttributeName:a=f,toAttributeValue:l=v}=e;const u=Number.parseInt(t.version)>=19,c=t.forwardRef(((e,i)=>{var c,d;const h=t.useRef(null),f=t.useRef(new Map),w={},y={},b={},T={};
2for(const[t,o]of Object.entries(e)){if(p.has(t)){b[t]=o;continue}const e=a(m[t]??t);if(n.prototype&&t in n.prototype&&!(t in((null==(c=globalThis.HTMLElement)?void 0:c.prototype)??{}))&&!(null==(d=n.observedAttributes)?void 0:d.some((t=>t===e)))){T[t]=o;continue}if(t.startsWith("on")){w[t]=o;continue}const s=l(o);if(e&&null!=s&&(y[e]=String(s),u||(b[e]=s)),e&&u){const t=v(o);b[e]=s!==t?s:o}}if("undefined"!==typeof window){for(const e in w){const o=w[e],n=e.endsWith("Capture"),i=((null==s?void 0:s[e])??e.slice(2).toLowerCase()).slice(0,n?-7:void 0);t.useLayoutEffect((()=>{const e=null==h?void 0:h.current;if(e&&"function"===typeof o)return e.addEventListener(i,o,n),()=>{e.removeEventListener(i,o,n)}}),[null==h?void 0:h.current,o])}t.useLayoutEffect((()=>{if(null===h.current)return;const e=new Map;for(const t in T)g(h.current,t,T[t]),f.current.delete(t),e.set(t,T[t]);for(const[t,o]of f.current)g(h.current,t,void 0);f.current=e}))}if("undefined"===typeof window&&(null==n?void 0:n.getTemplateHTML)&&(null==n?void 0:n.shadowRootOptions)){const{mode:o,delegatesFocus:s}=n.shadowRootOptions,i=t.createElement("template",{shadowrootmode:o,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:n.getTemplateHTML(y,e)}});b.children=[i,b.children]}return t.createElement(o,{...r,...b,ref:t.useCallback((e=>{h.current=e,"function"===typeof i?i(e):null!==i&&(i.current=e)}),[i])})}));return c.displayName=i??n.name,c}({react:n,tagName:"tiktok-video",elementClass:h,toAttributeName:e=>"muted"===e?"":"defaultMuted"===e?"muted":f(e)})}}]); 3//# sourceMappingURL=reactPlayerTiktok.fdbd57d2.chunk.js.map
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.