{"id":20,"date":"2026-08-01T17:12:23","date_gmt":"2026-08-01T15:12:23","guid":{"rendered":"https:\/\/kink-website-mukelcannu.live-website.com\/?page_id=20"},"modified":"2026-10-27T13:45:24","modified_gmt":"2026-10-27T12:45:24","slug":"bar","status":"publish","type":"page","link":"https:\/\/kink-berlin.de\/en\/bar\/","title":{"rendered":"Bar"},"content":{"rendered":"\r\n<div class=\"et_pb_section_0 et_pb_section et_section_regular et_flex_section et-pb-has-background-video et_pb_preload kink-fixed-bg preset--module--divi-section--default\" id=\"hero\"><span class=\"et-pb-background-video\"><video autoplay loop playsinline muted><source type=\"video\/mp4\" data-src=\"https:\/\/kink-berlin.de\/wp-content\/uploads\/2026\/10\/10a_bar-m3_1_QUER.mp4\" \/><\/video><\/span><span class=\"et-pb-background-video et-pb-background-video_phone\"><video autoplay loop playsinline muted><source type=\"video\/mp4\" data-src=\"https:\/\/kink-berlin.de\/wp-content\/uploads\/2026\/10\/10a_bar_HANDY.mp4\" \/><\/video><\/span>\r\n<div class=\"et_pb_row_0 et_pb_row et_flex_row preset--module--divi-row--default\">\r\n<div class=\"et_pb_column_0 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone preset--module--divi-column--default\">\r\n<div class=\"et_pb_text_0 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p><span>BUZZY NIGHTS<\/span><\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_heading_0 et_pb_heading et_pb_module et_flex_module preset--module--divi-heading--default\"><div class=\"et_pb_heading_container\"><h1 class=\"et_pb_module_header\">Cocktailbar in <br class=\"kbr\">Berlin Mitte-Prenzlauer Berg.<\/h1><\/div><\/div>\r\n<div class=\"et_pb_text_1 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p>Kreative Cocktails unter acht Meter hohen Decken.<br \/>Klassiker mit Twist. \u00dcberraschende Aromen. Eine Atmosph\u00e4re, in der man gern bleibt.<\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_module et_pb_button_module_wrapper et_pb_button_0_wrapper preset--module--divi-button--default_wrapper\"><a class=\"et_pb_button_0 et_pb_button et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-button--default\" href=\"#drinks\">Zur Barkarte<\/a><\/div>\r\n<div class=\"et_pb_code_0 et_pb_code et_pb_module preset--group--divi-code--divi-background--nested--dlp-bg-surface-alt preset--group--divi-code--divi-border--nested--dlp-border-card preset--group--divi-code--divi-spacing--nested--dlp-spacing-x-m preset--group--divi-code--divi-spacing--nested--dlp-spacing-y-m\"><div class=\"et_pb_code_inner\"><style id=\"kink-fixed-video-effect\">\n\/* =========================================================\n   KINK \u00b7 FESTSTEHENDES HINTERGRUNDVIDEO\n   Desktop \u00b7 Tablet \u00b7 Smartphone\n========================================================= *\/\n\n.kink-fixed-bg {\n  position: relative !important;\n  overflow: hidden !important;\n  isolation: isolate;\n}\n\n\/* Normales Divi-Hintergrundvideo auf allen Ger\u00e4ten verwenden *\/\n.kink-fixed-bg\n> .et-pb-background-video:not(.et-pb-background-video_phone) {\n  display: block !important;\n  position: absolute !important;\n\n  top: 0 !important;\n  left: 0 !important;\n\n  width: 100% !important;\n  height: 100vh !important;\n  height: 100svh !important;\n\n  pointer-events: none !important;\n  will-change: transform;\n\n  z-index: 0 !important;\n}\n\n\/* Divis leeren mobilen Video-Container ausblenden *\/\n.kink-fixed-bg > .et-pb-background-video_phone {\n  display: none !important;\n}\n\n\/* Video immer fl\u00e4chendeckend darstellen *\/\n.kink-fixed-bg > .et-pb-background-video video {\n  position: absolute !important;\n\n  top: 0 !important;\n  left: 0 !important;\n\n  width: 100% !important;\n  height: 100% !important;\n\n  min-width: 100% !important;\n  min-height: 100% !important;\n  max-width: none !important;\n\n  object-fit: cover !important;\n  object-position: center center !important;\n\n  transform: none !important;\n}\n\n\/* S\u00e4mtliche Inhalte \u00fcber dem Video halten *\/\n.kink-fixed-bg > *:not(.et-pb-background-video) {\n  position: relative;\n  z-index: 1;\n}\n<\/style>\n\n<script>\n(function () {\n  let animationFrame = null;\n\n  function prepareVideos() {\n    document.querySelectorAll('.kink-fixed-bg').forEach(function (section) {\n      const videoLayer = section.querySelector(\n        ':scope > .et-pb-background-video:not(.et-pb-background-video_phone)'\n      );\n\n      if (!videoLayer) return;\n\n      const video = videoLayer.querySelector('video');\n\n      if (!video) return;\n\n      video.muted = true;\n      video.defaultMuted = true;\n      video.loop = true;\n      video.autoplay = true;\n      video.playsInline = true;\n\n      video.setAttribute('muted', '');\n      video.setAttribute('loop', '');\n      video.setAttribute('autoplay', '');\n      video.setAttribute('playsinline', '');\n      video.setAttribute('webkit-playsinline', '');\n\n      const playPromise = video.play();\n\n      if (playPromise && typeof playPromise.catch === 'function') {\n        playPromise.catch(function () {});\n      }\n    });\n\n    updateFixedVideos();\n  }\n\n  function updateFixedVideos() {\n    return; \/* 27.10.2026: abgeschaltet - Video steht jetzt per CSS (position:fixed + clip-path), Theme-Optionen Block \u201eKINK FESTER HINTERGRUND OHNE RUCKELN\u201c. Nachschieben ruckelte in Safari. *\/\n    const viewportHeight = window.visualViewport\n      ? window.visualViewport.height\n      : window.innerHeight;\n\n    document.querySelectorAll('.kink-fixed-bg').forEach(function (section) {\n      const videoLayer = section.querySelector(\n        ':scope > .et-pb-background-video:not(.et-pb-background-video_phone)'\n      );\n\n      if (!videoLayer) return;\n\n      const sectionRect = section.getBoundingClientRect();\n\n      videoLayer.style.height = Math.ceil(viewportHeight) + 'px';\n\n      \/*\n       * Das Video wird gegen die Bewegung der Sektion verschoben.\n       * Dadurch bleibt es optisch im Browserfenster stehen.\n       *\/\n      videoLayer.style.transform =\n        'translate3d(0,' + Math.round(-sectionRect.top) + 'px,0)';\n    });\n\n    animationFrame = null;\n  }\n\n  function requestVideoUpdate() {\n    if (!animationFrame) {\n      animationFrame = requestAnimationFrame(updateFixedVideos);\n    }\n  }\n\n  window.addEventListener('scroll', requestVideoUpdate, {\n    passive: true\n  });\n\n  window.addEventListener('resize', requestVideoUpdate);\n\n  if (window.visualViewport) {\n    window.visualViewport.addEventListener(\n      'resize',\n      requestVideoUpdate\n    );\n\n    window.visualViewport.addEventListener(\n      'scroll',\n      requestVideoUpdate\n    );\n  }\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', prepareVideos);\n  } else {\n    prepareVideos();\n  }\n})();\n<\/script><\/div><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div class=\"et_pb_section_1 et_pb_section et_section_regular et_flex_section preset--module--divi-section--default\" id=\"perfect-album\">\r\n<div class=\"et_pb_row_1 et_pb_row et_flex_row preset--module--divi-row--default\">\r\n<div class=\"et_pb_column_1 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone preset--module--divi-column--default\">\r\n<div class=\"et_pb_text_2 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p><span>NEUE BARKARTE<\/span><\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_heading_1 et_pb_heading et_pb_module et_flex_module preset--module--divi-heading--default\"><div class=\"et_pb_heading_container\"><h2 class=\"et_pb_module_header\">THE PERFECT ALBUM<\/h2><\/div><\/div>\r\n<div class=\"et_pb_text_3 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p>Unsere neue Barkarte ist gedacht wie eine Platte. Beverage Director Leo Foriglio und das Bar-Team haben acht Drinks entwickelt, jeder nach einem musikalischen Archetyp: vom Intro \u00fcber den One Hit Wonder und den Love Song bis zur Power Ballad.<\/p>\n<p>Manche gehen sofort ins Ohr, andere brauchen einen zweiten Schluck. An der Bar kommt die Karte in einer CD-H\u00fclle, als Booklet zum Bl\u00e4ttern, mit Bandfoto, Danksagung und einem QR-Code zur Playlist hinter den Drinks.<\/p>\n<p>Acht Tracks. Acht Cocktails. Ein perfektes Album.<\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_module et_pb_button_module_wrapper et_pb_button_1_wrapper preset--module--divi-button--default_wrapper\"><a class=\"et_pb_button_1 et_pb_button et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-button--default\" href=\"#drinks\">Karte aufklappen<\/a><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div class=\"et_pb_section_2 et_pb_section et_section_regular et_flex_section preset--module--divi-section--default\" id=\"drinks\">\r\n<div class=\"et_pb_row_2 et_pb_row et_flex_row preset--module--divi-row--default\">\r\n<div class=\"et_pb_column_2 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone preset--module--divi-column--default\">\r\n<div class=\"et_pb_text_4 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p><span>BARKARTE<\/span><\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_heading_2 et_pb_heading et_pb_module et_flex_module preset--module--divi-heading--default\"><div class=\"et_pb_heading_container\"><h2 class=\"et_pb_module_header\">Drinks und Bar Snacks<\/h2><\/div><\/div>\r\n<\/div>\r\n<\/div>\r\n<div class=\"et_pb_row_3 et_pb_row et_flex_row preset--module--divi-row--default\">\r\n<div class=\"et_pb_column_3 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone preset--module--divi-column--default\">\r\n<div class=\"et_pb_code_1 et_pb_code et_pb_module preset--group--divi-code--divi-background--nested--dlp-bg-surface-alt preset--group--divi-code--divi-border--nested--dlp-border-card preset--group--divi-code--divi-spacing--nested--dlp-spacing-x-m preset--group--divi-code--divi-spacing--nested--dlp-spacing-y-m\"><div class=\"et_pb_code_inner\"><style id=\"kink-barkarte-flipbook\">\n\/* =========================================================\n   KINK - BARKARTE FLIPBOOK (The Perfect Album)\n   Klassen kflip__*  |  Zustand: is-zu = geschlossen, is-hoch = Handy (eine Seite)\n   Seitenbilder: Mediathek, kink-perfect-album-v2-seite-01 bis 25\n========================================================= *\/\n\/* TEAMBILD der Ankuendigung (#perfect-album): ganzes Team sichtbar. Laptop: Bild in voller Hoehe rechts, links schwarz. Handy und Tablet: Bild oben in voller Breite, Tafel darunter. *\/\n\/* 11.10.2026 (Kiki): Bild beginnt direkt an der Abschnittskante, kein schwarzer Streifen zwischen Kopfvideo und Bild. Vorher 70px (Laptop) und 60px (Handy) Abstand. *\/\n#perfect-album{background-size:auto 100% !important;background-position:right bottom !important}\n\/* TAFEL NAEHER AM BILD (nur Laptop): Tafel rueckt ueber die Theke, Theke hinter der Tafel wird weichgezeichnet, linke Bildkante laeuft weich ins Schwarz. Ueberlappung = 0.28 x Bildhoehe, kleiner = weiter weg von den Barleuten *\/\n@media(min-width:981px){\n#perfect-album{background-image:linear-gradient(to left,rgba(0,0,0,0) calc(1.4*100vh - 180px),#000 calc(1.4*100vh)),url(\/wp-content\/uploads\/2026\/10\/kink-perfect-album-bar-team.webp) !important;background-size:100% 100%,auto 100% !important;background-position:center,right bottom !important}\n#perfect-album{padding-left:0 !important}\n#perfect-album .et_pb_row{margin-left:max(24px,calc(100vw - 1.12*100vh - 640px)) !important}\n#perfect-album .et_pb_column{-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}\n}\n\/* 11.10.2026: staerkerer Selektor, damit der Abstand fuer das Bild gegen die allgemeine Handy-Regel (56px, Theme-CSS mit zwei :not(#...)) gewinnt; die beiden :not(#k1):not(#k2) dienen nur dem Gewicht und die Tafel wirklich unter dem Bild steht *\/\n@media(max-width:980px){html body #page-container #perfect-album.et_pb_section:not(#k1):not(#k2){background-size:100% auto !important;background-position:center top !important;padding-top:calc(71.5vw + 24px) !important;min-height:0 !important}}\n.kflip{text-align:center;color:#FFEBD2}\n.kflip__buehne{max-width:1280px;margin:0 auto}\n.kflip__schieber{transition:transform .8s cubic-bezier(.4,0,.2,1)}\n.kflip.is-zu .kflip__schieber{transform:translateX(-25%)}\n.kflip.is-hoch .kflip__schieber{transform:none}\n.kflip__buch{margin:0 auto;filter:drop-shadow(0 30px 40px rgba(0,0,0,.7))}\n.kflip.is-zu .kflip__buch{cursor:pointer}\n.kflip__seite{background:#000;overflow:hidden}\n.kflip__seite img{width:100%;height:100%;display:block;object-fit:cover;user-select:none;-webkit-user-drag:none;max-width:none}\n\/* Hinweis unter dem Cover *\/\n.kflip__tipp{margin:18px 0 0;padding:0;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:#F04623;transition:opacity .4s}\n.kflip:not(.is-zu) .kflip__tipp{opacity:0}\n\/* Pfeile, Seitenstand, Ton *\/\n.kflip__leiste{display:flex;align-items:center;justify-content:center;gap:20px;margin-top:22px;font-size:13px;letter-spacing:.16em;text-transform:uppercase}\n.kflip__pfeil{background:none;border:1px solid rgba(255,235,210,.4);color:#FFEBD2;width:46px;height:46px;border-radius:50%;font:inherit;font-size:18px;line-height:1;cursor:pointer;transition:.2s;padding:0}\n.kflip__pfeil:hover{background:#F04623;border-color:#F04623;color:#000}\n.kflip__pfeil[disabled]{opacity:.25;pointer-events:none}\n.kflip__stand{min-width:9em}\n.kflip__ton{background:none;border:0;color:#FFEBD2;opacity:.55;font:inherit;font-size:11px;letter-spacing:.16em;text-transform:uppercase;cursor:pointer;padding:6px}\n.kflip__ton:hover{opacity:1}\n\/* Sprungleiste *\/\n.kflip__tracks{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;max-width:900px;margin:22px auto 0 !important;padding:0 !important;list-style:none !important;font-size:12px;letter-spacing:.1em;text-transform:uppercase}\n.kflip__tracks button{background:none;border:0;color:#FFEBD2;opacity:.55;font:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer;padding:6px 0}\n.kflip__tracks button:hover,.kflip__tracks button.an{opacity:1;color:#F04623}\n\/* Karte als Text (fuer Suchmaschinen und Vorleseprogramme) *\/\n.kflip__text{max-width:760px;margin:40px auto 0;text-align:left;font-size:14px;line-height:1.6;border-top:1px solid rgba(255,235,210,.25);padding-top:18px}\n.kflip__text summary{cursor:pointer;font-size:12px;letter-spacing:.14em;text-transform:uppercase;opacity:.7;text-align:center}\n.kflip__text summary:hover{opacity:1}\n.kflip__text h3{color:#FFEBD2;font-size:15px;letter-spacing:.06em;text-transform:uppercase;margin:26px 0 4px;padding:0}\n.kflip__text p{margin:0 0 4px;padding:0;opacity:.85}\n.kflip__text ul{list-style:none !important;margin:10px 0 0 !important;padding:0 !important}\n.kflip__text li{display:flex;justify-content:space-between;gap:16px;padding:7px 0;border-bottom:1px solid rgba(255,235,210,.15)}\n<\/style>\n\n<div class=\"kflip is-zu\" id=\"kflip\">\n  <div class=\"kflip__buehne\"><div class=\"kflip__schieber\"><div class=\"kflip__buch\" id=\"kflip-buch\"><\/div><\/div><\/div>\n  <p class=\"kflip__tipp\">Klick auf das Cover zum Aufklappen<\/p>\n  <div class=\"kflip__leiste\">\n    <button class=\"kflip__pfeil\" id=\"kflip-zurueck\" type=\"button\" aria-label=\"Seite zur&uuml;ck\" disabled>&larr;<\/button>\n    <span class=\"kflip__stand\" id=\"kflip-stand\" data-no-translation>Cover<\/span>\n    <button class=\"kflip__pfeil\" id=\"kflip-vor\" type=\"button\" aria-label=\"Seite vor\">&rarr;<\/button>\n    <button class=\"kflip__ton\" id=\"kflip-ton\" type=\"button\" aria-pressed=\"true\" data-no-translation>Ton an<\/button>\n  <\/div>\n  <ul class=\"kflip__tracks\" id=\"kflip-tracks\" data-no-translation><\/ul>\n\n  <details class=\"kflip__text\" data-no-translation>\n    <summary>Karte als Text lesen<\/summary>\n    <h3>Track 01 - Volare (The Intro)<\/h3><p>Spritz Style, 11.00. Light, bittersweet, fizzy.<\/p><p>42 Below Vodka, Campari, Strawberry, Tomato, Passion Fruit, Basil, Schweppes Dry Tonic. Studio and Unplugged.<\/p>\n    <h3>Track 02 - La Bamba (The One Hit Wonder)<\/h3><p>Paloma Style, 12.00. Energetic, spicy, fruity.<\/p><p>Cazadores Blanco Tequila, Prickly Pear, Lemon Balm, Lime H2O, Pasilla Chili, Agave, Salt. Studio.<\/p>\n    <h3>Track 03 - Nuevayoool! (The Summer Anthem)<\/h3><p>New York Sour Style, 12.00. Fruity, young, lively.<\/p><p>Buffalo Trace Bourbon, Plantation 3* Rum, White Peach, Green Apple, Coconut Water, Cinnamon, Lime, Port Wine. Studio.<\/p>\n    <h3>Track 04 - By Your Side (The Love Song)<\/h3><p>Clover Club Style, 13.00. Bright, romantic, silky.<\/p><p>Tanqueray Gin, Pisco Caravedo Quebranta, Dry Vermouth, Raspberry, Jasmine, White Chocolate, Lemon. Studio and Unplugged.<\/p>\n    <h3>Track 05 - Helden \/ Heroes (The Cover Song)<\/h3><p>Manhattan Style, 13.00. Rich, vinous, nutty.<\/p><p>Sazerac Rye, Ruby Port, Amaro Nonino, Amontillado, Chamomile, Quince, Amarena, Walnut. Studio.<\/p>\n    <h3>Track 06 - {Untitled 06} (The B-Side)<\/h3><p>Martini Style, 13.00. Smoky, savoury, experimental.<\/p><p>Cazadores Blanco Tequila, Zond5 Mezcal, Kumquat, Shiitake, White Vermouth, Citrivo Blood Orange, Olive, Salt&amp;Smoke, Agave. Studio.<\/p>\n    <h3>Track 07 - Believe (The Comeback Song)<\/h3><p>Bellini Style, 11.00. Sparkling, tropical, bold.<\/p><p>Guava Reduction, Star Anise, Pink Pepper, Lime, Prosecco, Absinthe. Studio and Unplugged.<\/p>\n    <h3>Track 08 - Total Eclipse of the Plum (The Power Ballad)<\/h3><p>White Russian Style, 12.00. Creamy, rich, playful.<\/p><p>Ferrand 1840 Cognac, Plum, Sweet Vermouth, Amontillado, Cacao, Coconut Cream, Banana, Mustard. Studio.<\/p>\n    <p>Studio: with alcohol. Unplugged: alcohol free.<\/p>\n    <h3>Bar Snacks (until 22:30)<\/h3>\n    <ul> <li><span>1 Oyster | 3 Oysters<\/span><span>4.50 | 12.00<\/span><\/li> <li><span>Sourdough Bread | Seasonal Butter<\/span><span>5.00<\/span><\/li> <li><span>Marinated Olives<\/span><span>4.00<\/span><\/li> <li><span>Pommes | Smoked Paprika Aioli<\/span><span>6.00<\/span><\/li> <li><span>Shrimp Toast | Yuzu Kosho Mayo<\/span><span>12.00<\/span><\/li> <li><span>Buffalo Squid | Ranch Sauce<\/span><span>15.00<\/span><\/li> <li><span>Tuna Tataki | Kiwi | Aguachile<\/span><span>16.00<\/span><\/li> <li><span>Papa Rellena | Salsa Criolla<\/span><span>11.00<\/span><\/li> <li><span>Beef Tartar | Tomate de Arbol | Egg<\/span><span>16.00<\/span><\/li> <\/ul>\n  <\/details>\n<\/div>\n\n<script data-kflip-lib>!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],e):e((t=t||self).St={})}(this,(function(t){\"use strict\";class e{constructor(t,e){this.state={angle:0,area:[],position:{x:0,y:0},hardAngle:0,hardDrawingAngle:0},this.createdDensity=e,this.nowDrawingDensity=this.createdDensity,this.render=t}setDensity(t){this.createdDensity=t,this.nowDrawingDensity=t}setDrawingDensity(t){this.nowDrawingDensity=t}setPosition(t){this.state.position=t}setAngle(t){this.state.angle=t}setArea(t){this.state.area=t}setHardDrawingAngle(t){this.state.hardDrawingAngle=t}setHardAngle(t){this.state.hardAngle=t,this.state.hardDrawingAngle=t}setOrientation(t){this.orientation=t}getDrawingDensity(){return this.nowDrawingDensity}getDensity(){return this.createdDensity}getHardAngle(){return this.state.hardAngle}}class i extends e{constructor(t,e,i){super(t,i),this.image=null,this.isLoad=!1,this.loadingAngle=0,this.image=new Image,this.image.src=e}draw(t){const e=this.render.getContext(),i=this.render.convertToGlobal(this.state.position),s=this.render.getRect().pageWidth,n=this.render.getRect().height;e.save(),e.translate(i.x,i.y),e.beginPath();for(let t of this.state.area)null!==t&&(t=this.render.convertToGlobal(t),e.lineTo(t.x-i.x,t.y-i.y));e.rotate(this.state.angle),e.clip(),this.isLoad?e.drawImage(this.image,0,0,s,n):this.drawLoader(e,{x:0,y:0},s,n),e.restore()}simpleDraw(t){const e=this.render.getRect(),i=this.render.getContext(),s=e.pageWidth,n=e.height,h=1===t?e.left+e.pageWidth:e.left,r=e.top;this.isLoad?i.drawImage(this.image,h,r,s,n):this.drawLoader(i,{x:h,y:r},s,n)}drawLoader(t,e,i,s){t.beginPath(),t.strokeStyle=\"rgb(200, 200, 200)\",t.fillStyle=\"rgb(255, 255, 255)\",t.lineWidth=1,t.rect(e.x+1,e.y+1,i-1,s-1),t.stroke(),t.fill();const n={x:e.x+i\/2,y:e.y+s\/2};t.beginPath(),t.lineWidth=10,t.arc(n.x,n.y,20,this.loadingAngle,3*Math.PI\/2+this.loadingAngle),t.stroke(),t.closePath(),this.loadingAngle+=.07,this.loadingAngle>=2*Math.PI&&(this.loadingAngle=0)}load(){this.isLoad||(this.image.onload=()=>{this.isLoad=!0})}newTemporaryCopy(){return this}getTemporaryCopy(){return this}hideTemporaryCopy(){}}class s{constructor(t,e){this.pages=[],this.currentPageIndex=0,this.currentSpreadIndex=0,this.landscapeSpread=[],this.portraitSpread=[],this.render=e,this.app=t,this.currentPageIndex=0,this.isShowCover=this.app.getSettings().showCover}destroy(){this.pages=[]}createSpread(){this.landscapeSpread=[],this.portraitSpread=[];for(let t=0;t<this.pages.length;t++)this.portraitSpread.push([t]);let t=0;this.isShowCover&&(this.pages[0].setDensity(\"hard\"),this.landscapeSpread.push([t]),t++);for(let e=t;e<this.pages.length;e+=2)e<this.pages.length-1?this.landscapeSpread.push([e,e+1]):(this.landscapeSpread.push([e]),this.pages[e].setDensity(\"hard\"))}getSpread(){return\"landscape\"===this.render.getOrientation()?this.landscapeSpread:this.portraitSpread}getSpreadIndexByPage(t){const e=this.getSpread();for(let i=0;i<e.length;i++)if(t===e[i][0]||t===e[i][1])return i;return null}getPageCount(){return this.pages.length}getPages(){return this.pages}getPage(t){if(t>=0&&t<this.pages.length)return this.pages[t];throw new Error(\"Invalid page number\")}nextBy(t){const e=this.pages.indexOf(t);return e<this.pages.length-1?this.pages[e+1]:null}prevBy(t){const e=this.pages.indexOf(t);return e>0?this.pages[e-1]:null}getFlippingPage(t){const e=this.currentSpreadIndex;if(\"portrait\"===this.render.getOrientation())return 0===t?this.pages[e].newTemporaryCopy():this.pages[e-1];{const i=0===t?this.getSpread()[e+1]:this.getSpread()[e-1];return 1===i.length||0===t?this.pages[i[0]]:this.pages[i[1]]}}getBottomPage(t){const e=this.currentSpreadIndex;if(\"portrait\"===this.render.getOrientation())return 0===t?this.pages[e+1]:this.pages[e-1];{const i=0===t?this.getSpread()[e+1]:this.getSpread()[e-1];return 1===i.length?this.pages[i[0]]:0===t?this.pages[i[1]]:this.pages[i[0]]}}showNext(){this.currentSpreadIndex<this.getSpread().length&&(this.currentSpreadIndex++,this.showSpread())}showPrev(){this.currentSpreadIndex>0&&(this.currentSpreadIndex--,this.showSpread())}getCurrentPageIndex(){return this.currentPageIndex}show(t=null){if(null===t&&(t=this.currentPageIndex),t<0||t>=this.pages.length)return;const e=this.getSpreadIndexByPage(t);null!==e&&(this.currentSpreadIndex=e,this.showSpread())}getCurrentSpreadIndex(){return this.currentSpreadIndex}setCurrentSpreadIndex(t){if(!(t>=0&&t<this.getSpread().length))throw new Error(\"Invalid page\");this.currentSpreadIndex=t}showSpread(){const t=this.getSpread()[this.currentSpreadIndex];2===t.length?(this.render.setLeftPage(this.pages[t[0]]),this.render.setRightPage(this.pages[t[1]])):\"landscape\"===this.render.getOrientation()&&t[0]===this.pages.length-1?(this.render.setLeftPage(this.pages[t[0]]),this.render.setRightPage(null)):(this.render.setLeftPage(null),this.render.setRightPage(this.pages[t[0]])),this.currentPageIndex=t[0],this.app.updatePageIndex(this.currentPageIndex)}}class n extends s{constructor(t,e,i){super(t,e),this.imagesHref=i}load(){for(const t of this.imagesHref){const e=new i(this.render,t,\"soft\");e.load(),this.pages.push(e)}this.createSpread()}}class h{static GetDistanceBetweenTwoPoint(t,e){return null===t||null===e?1\/0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static GetSegmentLength(t){return h.GetDistanceBetweenTwoPoint(t[0],t[1])}static GetAngleBetweenTwoLine(t,e){const i=t[0].y-t[1].y,s=e[0].y-e[1].y,n=t[1].x-t[0].x,h=e[1].x-e[0].x;return Math.acos((i*s+n*h)\/(Math.sqrt(i*i+n*n)*Math.sqrt(s*s+h*h)))}static PointInRect(t,e){return null===e?null:e.x>=t.left&&e.x<=t.width+t.left&&e.y>=t.top&&e.y<=t.top+t.height?e:null}static GetRotatedPoint(t,e,i){return{x:t.x*Math.cos(i)+t.y*Math.sin(i)+e.x,y:t.y*Math.cos(i)-t.x*Math.sin(i)+e.y}}static LimitPointToCircle(t,e,i){if(h.GetDistanceBetweenTwoPoint(t,i)<=e)return i;const s=t.x,n=t.y,r=i.x,o=i.y;let a=Math.sqrt(Math.pow(e,2)*Math.pow(s-r,2)\/(Math.pow(s-r,2)+Math.pow(n-o,2)))+s;i.x<0&&(a*=-1);let g=(a-s)*(n-o)\/(s-r)+n;return s-r+n===0&&(g=e),{x:a,y:g}}static GetIntersectBetweenTwoSegment(t,e,i){return h.PointInRect(t,h.GetIntersectBeetwenTwoLine(e,i))}static GetIntersectBeetwenTwoLine(t,e){const i=t[0].y-t[1].y,s=e[0].y-e[1].y,n=t[1].x-t[0].x,h=e[1].x-e[0].x,r=t[0].x*t[1].y-t[1].x*t[0].y,o=e[0].x*e[1].y-e[1].x*e[0].y,a=i*o-s*r,g=n*o-h*r,l=-(r*h-o*n)\/(i*h-s*n),d=-(i*o-s*r)\/(i*h-s*n);if(isFinite(l)&&isFinite(d))return{x:l,y:d};if(Math.abs(a-g)<.1)throw new Error(\"Segment included\");return null}static GetCordsFromTwoPoint(t,e){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y),n=Math.max(i,s),h=[t];function r(t,e,i,s,n){return e>t?t+n*(i\/s):e<t?t-n*(i\/s):t}for(let o=1;o<=n;o+=1)h.push({x:r(t.x,e.x,i,n,o),y:r(t.y,e.y,s,n,o)});return h}}class r extends e{constructor(t,e,i){super(t,i),this.copiedElement=null,this.temporaryCopy=null,this.isLoad=!1,this.element=e,this.element.classList.add(\"stf__item\"),this.element.classList.add(\"--\"+i)}newTemporaryCopy(){return\"hard\"===this.nowDrawingDensity?this:(null===this.temporaryCopy&&(this.copiedElement=this.element.cloneNode(!0),this.element.parentElement.appendChild(this.copiedElement),this.temporaryCopy=new r(this.render,this.copiedElement,this.nowDrawingDensity)),this.getTemporaryCopy())}getTemporaryCopy(){return this.temporaryCopy}hideTemporaryCopy(){null!==this.temporaryCopy&&(this.copiedElement.remove(),this.copiedElement=null,this.temporaryCopy=null)}draw(t){const e=t||this.nowDrawingDensity,i=this.render.convertToGlobal(this.state.position),s=this.render.getRect().pageWidth,n=this.render.getRect().height;this.element.classList.remove(\"--simple\");const h=`\\n            display: block;\\n            z-index: ${this.element.style.zIndex};\\n            left: 0;\\n            top: 0;\\n            width: ${s}px;\\n            height: ${n}px;\\n        `;\"hard\"===e?this.drawHard(h):this.drawSoft(i,h)}drawHard(t=\"\"){const e=this.render.getRect().left+this.render.getRect().width\/2,i=this.state.hardDrawingAngle,s=t+\"\\n                backface-visibility: hidden;\\n                -webkit-backface-visibility: hidden;\\n                clip-path: none;\\n                -webkit-clip-path: none;\\n            \"+(0===this.orientation?`transform-origin: ${this.render.getRect().pageWidth}px 0; \\n                   transform: translate3d(0, 0, 0) rotateY(${i}deg);`:`transform-origin: 0 0; \\n                   transform: translate3d(${e}px, 0, 0) rotateY(${i}deg);`);this.element.style.cssText=s}drawSoft(t,e=\"\"){let i=\"polygon( \";for(const t of this.state.area)if(null!==t){let e=1===this.render.getDirection()?{x:-t.x+this.state.position.x,y:t.y-this.state.position.y}:{x:t.x-this.state.position.x,y:t.y-this.state.position.y};e=h.GetRotatedPoint(e,{x:0,y:0},this.state.angle),i+=e.x+\"px \"+e.y+\"px, \"}i=i.slice(0,-2),i+=\")\";const s=e+`transform-origin: 0 0; clip-path: ${i}; -webkit-clip-path: ${i};`+(this.render.isSafari()&&0===this.state.angle?`transform: translate(${t.x}px, ${t.y}px);`:`transform: translate3d(${t.x}px, ${t.y}px, 0) rotate(${this.state.angle}rad);`);this.element.style.cssText=s}simpleDraw(t){const e=this.render.getRect(),i=e.pageWidth,s=e.height,n=1===t?e.left+e.pageWidth:e.left,h=e.top;this.element.classList.add(\"--simple\"),this.element.style.cssText=`\\n            position: absolute; \\n            display: block; \\n            height: ${s}px; \\n            left: ${n}px; \\n            top: ${h}px; \\n            width: ${i}px; \\n            z-index: ${this.render.getSettings().startZIndex+1};`}getElement(){return this.element}load(){this.isLoad=!0}setOrientation(t){super.setOrientation(t),this.element.classList.remove(\"--left\",\"--right\"),this.element.classList.add(1===t?\"--right\":\"--left\")}setDrawingDensity(t){this.element.classList.remove(\"--soft\",\"--hard\"),this.element.classList.add(\"--\"+t),super.setDrawingDensity(t)}}class o extends s{constructor(t,e,i,s){super(t,e),this.element=i,this.pagesElement=s}load(){for(const t of this.pagesElement){const e=new r(this.render,t,\"hard\"===t.dataset.density?\"hard\":\"soft\");e.load(),this.pages.push(e)}this.createSpread()}}class a{constructor(t,e,i,s){this.direction=t,this.corner=e,this.topIntersectPoint=null,this.sideIntersectPoint=null,this.bottomIntersectPoint=null,this.pageWidth=parseInt(i,10),this.pageHeight=parseInt(s,10)}calc(t){try{return this.position=this.calcAngleAndPosition(t),this.calculateIntersectPoint(this.position),!0}catch(t){return!1}}getFlippingClipArea(){const t=[];let e=!1;return t.push(this.rect.topLeft),t.push(this.topIntersectPoint),null===this.sideIntersectPoint?e=!0:(t.push(this.sideIntersectPoint),null===this.bottomIntersectPoint&&(e=!1)),t.push(this.bottomIntersectPoint),(e||\"bottom\"===this.corner)&&t.push(this.rect.bottomLeft),t}getBottomClipArea(){const t=[];return t.push(this.topIntersectPoint),\"top\"===this.corner?t.push({x:this.pageWidth,y:0}):(null!==this.topIntersectPoint&&t.push({x:this.pageWidth,y:0}),t.push({x:this.pageWidth,y:this.pageHeight})),null!==this.sideIntersectPoint?h.GetDistanceBetweenTwoPoint(this.sideIntersectPoint,this.topIntersectPoint)>=10&&t.push(this.sideIntersectPoint):\"top\"===this.corner&&t.push({x:this.pageWidth,y:this.pageHeight}),t.push(this.bottomIntersectPoint),t.push(this.topIntersectPoint),t}getAngle(){return 0===this.direction?-this.angle:this.angle}getRect(){return this.rect}getPosition(){return this.position}getActiveCorner(){return 0===this.direction?this.rect.topLeft:this.rect.topRight}getDirection(){return this.direction}getFlippingProgress(){return Math.abs((this.position.x-this.pageWidth)\/(2*this.pageWidth)*100)}getCorner(){return this.corner}getBottomPagePosition(){return 1===this.direction?{x:this.pageWidth,y:0}:{x:0,y:0}}getShadowStartPoint(){return\"top\"===this.corner?this.topIntersectPoint:null!==this.sideIntersectPoint?this.sideIntersectPoint:this.topIntersectPoint}getShadowAngle(){const t=h.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(),[{x:0,y:0},{x:this.pageWidth,y:0}]);return 0===this.direction?t:Math.PI-t}calcAngleAndPosition(t){let e=t;if(this.updateAngleAndGeometry(e),e=\"top\"===this.corner?this.checkPositionAtCenterLine(e,{x:0,y:0},{x:0,y:this.pageHeight}):this.checkPositionAtCenterLine(e,{x:0,y:this.pageHeight},{x:0,y:0}),Math.abs(e.x-this.pageWidth)<1&&Math.abs(e.y)<1)throw new Error(\"Point is too small\");return e}updateAngleAndGeometry(t){this.angle=this.calculateAngle(t),this.rect=this.getPageRect(t)}calculateAngle(t){const e=this.pageWidth-t.x+1,i=\"bottom\"===this.corner?this.pageHeight-t.y:t.y;let s=2*Math.acos(e\/Math.sqrt(i*i+e*e));i<0&&(s=-s);const n=Math.PI-s;if(!isFinite(s)||n>=0&&n<.003)throw new Error(\"The G point is too small\");return\"bottom\"===this.corner&&(s=-s),s}getPageRect(t){return\"top\"===this.corner?this.getRectFromBasePoint([{x:0,y:0},{x:this.pageWidth,y:0},{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}],t):this.getRectFromBasePoint([{x:0,y:-this.pageHeight},{x:this.pageWidth,y:-this.pageHeight},{x:0,y:0},{x:this.pageWidth,y:0}],t)}getRectFromBasePoint(t,e){return{topLeft:this.getRotatedPoint(t[0],e),topRight:this.getRotatedPoint(t[1],e),bottomLeft:this.getRotatedPoint(t[2],e),bottomRight:this.getRotatedPoint(t[3],e)}}getRotatedPoint(t,e){return{x:t.x*Math.cos(this.angle)+t.y*Math.sin(this.angle)+e.x,y:t.y*Math.cos(this.angle)-t.x*Math.sin(this.angle)+e.y}}calculateIntersectPoint(t){const e={left:-1,top:-1,width:this.pageWidth+2,height:this.pageHeight+2};\"top\"===this.corner?(this.topIntersectPoint=h.GetIntersectBetweenTwoSegment(e,[t,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=h.GetIntersectBetweenTwoSegment(e,[t,this.rect.bottomLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=h.GetIntersectBetweenTwoSegment(e,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])):(this.topIntersectPoint=h.GetIntersectBetweenTwoSegment(e,[this.rect.topLeft,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=h.GetIntersectBetweenTwoSegment(e,[t,this.rect.topLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=h.GetIntersectBetweenTwoSegment(e,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}]))}checkPositionAtCenterLine(t,e,i){let s=t;const n=h.LimitPointToCircle(e,this.pageWidth,s);s!==n&&(s=n,this.updateAngleAndGeometry(s));const r=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let o=this.rect.bottomRight,a=this.rect.topLeft;if(\"bottom\"===this.corner&&(o=this.rect.topRight,a=this.rect.bottomLeft),o.x<=0){const t=h.LimitPointToCircle(i,r,a);t!==s&&(s=t,this.updateAngleAndGeometry(s))}return s}getSegmentToShadowLine(){const t=this.getShadowStartPoint();return[t,t!==this.sideIntersectPoint&&null!==this.sideIntersectPoint?this.sideIntersectPoint:this.bottomIntersectPoint]}}class g{constructor(t,e){this.flippingPage=null,this.bottomPage=null,this.calc=null,this.state=\"read\",this.render=t,this.app=e}fold(t){this.setState(\"user_fold\"),null===this.calc&&this.start(t),this.do(this.render.convertToPage(t))}flip(t){if(this.app.getSettings().disableFlipByClick&&!this.isPointOnCorners(t))return;if(null!==this.calc&&this.render.finishAnimation(),!this.start(t))return;const e=this.getBoundsRect();this.setState(\"flipping\");const i=e.height\/10,s=\"bottom\"===this.calc.getCorner()?e.height-i:i,n=\"bottom\"===this.calc.getCorner()?e.height:0;this.calc.calc({x:e.pageWidth-i,y:s}),this.animateFlippingTo({x:e.pageWidth-i,y:s},{x:-e.pageWidth,y:n},!0)}start(t){this.reset();const e=this.render.convertToBook(t),i=this.getBoundsRect(),s=this.getDirectionByPoint(e),n=e.y>=i.height\/2?\"bottom\":\"top\";if(!this.checkDirection(s))return!1;try{if(this.flippingPage=this.app.getPageCollection().getFlippingPage(s),this.bottomPage=this.app.getPageCollection().getBottomPage(s),\"landscape\"===this.render.getOrientation())if(1===s){const t=this.app.getPageCollection().nextBy(this.flippingPage);null!==t&&this.flippingPage.getDensity()!==t.getDensity()&&(this.flippingPage.setDrawingDensity(\"hard\"),t.setDrawingDensity(\"hard\"))}else{const t=this.app.getPageCollection().prevBy(this.flippingPage);null!==t&&this.flippingPage.getDensity()!==t.getDensity()&&(this.flippingPage.setDrawingDensity(\"hard\"),t.setDrawingDensity(\"hard\"))}return this.render.setDirection(s),this.calc=new a(s,n,i.pageWidth.toString(10),i.height.toString(10)),!0}catch(t){return!1}}do(t){if(null!==this.calc&&this.calc.calc(t)){const t=this.calc.getFlippingProgress();this.bottomPage.setArea(this.calc.getBottomClipArea()),this.bottomPage.setPosition(this.calc.getBottomPagePosition()),this.bottomPage.setAngle(0),this.bottomPage.setHardAngle(0),this.flippingPage.setArea(this.calc.getFlippingClipArea()),this.flippingPage.setPosition(this.calc.getActiveCorner()),this.flippingPage.setAngle(this.calc.getAngle()),0===this.calc.getDirection()?this.flippingPage.setHardAngle(90*(200-2*t)\/100):this.flippingPage.setHardAngle(-90*(200-2*t)\/100),this.render.setPageRect(this.calc.getRect()),this.render.setBottomPage(this.bottomPage),this.render.setFlippingPage(this.flippingPage),this.render.setShadowData(this.calc.getShadowStartPoint(),this.calc.getShadowAngle(),t,this.calc.getDirection())}}flipToPage(t,e){const i=this.app.getPageCollection().getCurrentSpreadIndex(),s=this.app.getPageCollection().getSpreadIndexByPage(t);try{s>i&&(this.app.getPageCollection().setCurrentSpreadIndex(s-1),this.flipNext(e)),s<i&&(this.app.getPageCollection().setCurrentSpreadIndex(s+1),this.flipPrev(e))}catch(t){}}flipNext(t){this.flip({x:this.render.getRect().left+2*this.render.getRect().pageWidth-10,y:\"top\"===t?1:this.render.getRect().height-2})}flipPrev(t){this.flip({x:10,y:\"top\"===t?1:this.render.getRect().height-2})}stopMove(){if(null===this.calc)return;const t=this.calc.getPosition(),e=this.getBoundsRect(),i=\"bottom\"===this.calc.getCorner()?e.height:0;t.x<=0?this.animateFlippingTo(t,{x:-e.pageWidth,y:i},!0):this.animateFlippingTo(t,{x:e.pageWidth,y:i},!1)}showCorner(t){if(!this.checkState(\"read\",\"fold_corner\"))return;const e=this.getBoundsRect(),i=e.pageWidth;if(this.isPointOnCorners(t))if(null===this.calc){if(!this.start(t))return;this.setState(\"fold_corner\"),this.calc.calc({x:i-1,y:1});const s=50,n=\"bottom\"===this.calc.getCorner()?e.height-1:1,h=\"bottom\"===this.calc.getCorner()?e.height-s:s;this.animateFlippingTo({x:i-1,y:n},{x:i-s,y:h},!1,!1)}else this.do(this.render.convertToPage(t));else this.setState(\"read\"),this.render.finishAnimation(),this.stopMove()}animateFlippingTo(t,e,i,s=!0){const n=h.GetCordsFromTwoPoint(t,e),r=[];for(const t of n)r.push(()=>this.do(t));const o=this.getAnimationDuration(n.length);this.render.startAnimation(r,o,()=>{this.calc&&(i&&(1===this.calc.getDirection()?this.app.turnToPrevPage():this.app.turnToNextPage()),s&&(this.render.setBottomPage(null),this.render.setFlippingPage(null),this.render.clearShadow(),this.setState(\"read\"),this.reset()))})}getCalculation(){return this.calc}getState(){return this.state}setState(t){this.state!==t&&(this.app.updateState(t),this.state=t)}getDirectionByPoint(t){const e=this.getBoundsRect();if(\"portrait\"===this.render.getOrientation()){if(t.x-e.pageWidth<=e.width\/5)return 1}else if(t.x<e.width\/2)return 1;return 0}getAnimationDuration(t){const e=this.app.getSettings().flippingTime;return t>=1e3?e:t\/1e3*e}checkDirection(t){return 0===t?this.app.getCurrentPageIndex()<this.app.getPageCount()-1:this.app.getCurrentPageIndex()>=1}reset(){this.calc=null,this.flippingPage=null,this.bottomPage=null}getBoundsRect(){return this.render.getRect()}checkState(...t){for(const e of t)if(this.state===e)return!0;return!1}isPointOnCorners(t){const e=this.getBoundsRect(),i=e.pageWidth,s=Math.sqrt(Math.pow(i,2)+Math.pow(e.height,2))\/5,n=this.render.convertToBook(t);return n.x>0&&n.y>0&&n.x<e.width&&n.y<e.height&&(n.x<s||n.x>e.width-s)&&(n.y<s||n.y>e.height-s)}}class l{constructor(t,e){this.leftPage=null,this.rightPage=null,this.flippingPage=null,this.bottomPage=null,this.direction=null,this.orientation=null,this.shadow=null,this.animation=null,this.pageRect=null,this.boundsRect=null,this.timer=0,this.safari=!1,this.setting=e,this.app=t;const i=new RegExp(\"Version\\\\\/[\\\\d\\\\.]+.*Safari\/\");this.safari=null!==i.exec(window.navigator.userAgent)}render(t){if(null!==this.animation){const e=Math.round((t-this.animation.startedAt)\/this.animation.durationFrame);e<this.animation.frames.length?this.animation.frames[e]():(this.animation.onAnimateEnd(),this.animation=null)}this.timer=t,this.drawFrame()}start(){this.update();const t=e=>{this.render(e),requestAnimationFrame(t)};requestAnimationFrame(t)}startAnimation(t,e,i){this.finishAnimation(),this.animation={frames:t,duration:e,durationFrame:e\/t.length,onAnimateEnd:i,startedAt:this.timer}}finishAnimation(){null!==this.animation&&(this.animation.frames[this.animation.frames.length-1](),null!==this.animation.onAnimateEnd&&this.animation.onAnimateEnd()),this.animation=null}update(){this.boundsRect=null;const t=this.calculateBoundsRect();this.orientation!==t&&(this.orientation=t,this.app.updateOrientation(t))}calculateBoundsRect(){let t=\"landscape\";const e=this.getBlockWidth(),i=e\/2,s=this.getBlockHeight()\/2,n=this.setting.width\/this.setting.height;let h=this.setting.width,r=this.setting.height,o=i-h;return\"stretch\"===this.setting.size?(e<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(t=\"portrait\"),h=\"portrait\"===t?this.getBlockWidth():this.getBlockWidth()\/2,h>this.setting.maxWidth&&(h=this.setting.maxWidth),r=h\/n,r>this.getBlockHeight()&&(r=this.getBlockHeight(),h=r*n),o=\"portrait\"===t?i-h\/2-h:i-h):e<2*h&&this.app.getSettings().usePortrait&&(t=\"portrait\",o=i-h\/2-h),this.boundsRect={left:o,top:s-r\/2,width:2*h,height:r,pageWidth:h},t}setShadowData(t,e,i,s){if(!this.app.getSettings().drawShadow)return;const n=100*this.getSettings().maxShadowOpacity;this.shadow={pos:t,angle:e,width:3*this.getRect().pageWidth\/4*i\/100,opacity:(100-i)*n\/100\/100,direction:s,progress:2*i}}clearShadow(){this.shadow=null}getBlockWidth(){return this.app.getUI().getDistElement().offsetWidth}getBlockHeight(){return this.app.getUI().getDistElement().offsetHeight}getDirection(){return this.direction}getRect(){return null===this.boundsRect&&this.calculateBoundsRect(),this.boundsRect}getSettings(){return this.app.getSettings()}getOrientation(){return this.orientation}setPageRect(t){this.pageRect=t}setDirection(t){this.direction=t}setRightPage(t){null!==t&&t.setOrientation(1),this.rightPage=t}setLeftPage(t){null!==t&&t.setOrientation(0),this.leftPage=t}setBottomPage(t){null!==t&&t.setOrientation(1===this.direction?0:1),this.bottomPage=t}setFlippingPage(t){null!==t&&t.setOrientation(0===this.direction&&\"portrait\"!==this.orientation?0:1),this.flippingPage=t}convertToBook(t){const e=this.getRect();return{x:t.x-e.left,y:t.y-e.top}}isSafari(){return this.safari}convertToPage(t,e){e||(e=this.direction);const i=this.getRect();return{x:0===e?t.x-i.left-i.width\/2:i.width\/2-t.x+i.left,y:t.y-i.top}}convertToGlobal(t,e){if(e||(e=this.direction),null==t)return null;const i=this.getRect();return{x:0===e?t.x+i.left+i.width\/2:i.width\/2-t.x+i.left,y:t.y+i.top}}convertRectToGlobal(t,e){return e||(e=this.direction),{topLeft:this.convertToGlobal(t.topLeft,e),topRight:this.convertToGlobal(t.topRight,e),bottomLeft:this.convertToGlobal(t.bottomLeft,e),bottomRight:this.convertToGlobal(t.bottomRight,e)}}}class d extends l{constructor(t,e,i){super(t,e),this.canvas=i,this.ctx=i.getContext(\"2d\")}getContext(){return this.ctx}reload(){}drawFrame(){this.clear(),\"portrait\"!==this.orientation&&null!=this.leftPage&&this.leftPage.simpleDraw(0),null!=this.rightPage&&this.rightPage.simpleDraw(1),null!=this.bottomPage&&this.bottomPage.draw(),this.drawBookShadow(),null!=this.flippingPage&&this.flippingPage.draw(),null!=this.shadow&&(this.drawOuterShadow(),this.drawInnerShadow());const t=this.getRect();\"portrait\"===this.orientation&&(this.ctx.beginPath(),this.ctx.rect(t.left+t.pageWidth,t.top,t.width,t.height),this.ctx.clip())}drawBookShadow(){const t=this.getRect();this.ctx.save(),this.ctx.beginPath();const e=t.width\/20;this.ctx.rect(t.left,t.top,t.width,t.height);const i={x:t.left+t.width\/2-e\/2,y:0};this.ctx.translate(i.x,i.y);const s=this.ctx.createLinearGradient(0,0,e,0);s.addColorStop(0,\"rgba(0, 0, 0, 0)\"),s.addColorStop(.4,\"rgba(0, 0, 0, 0.2)\"),s.addColorStop(.49,\"rgba(0, 0, 0, 0.1)\"),s.addColorStop(.5,\"rgba(0, 0, 0, 0.5)\"),s.addColorStop(.51,\"rgba(0, 0, 0, 0.4)\"),s.addColorStop(1,\"rgba(0, 0, 0, 0)\"),this.ctx.clip(),this.ctx.fillStyle=s,this.ctx.fillRect(0,0,e,2*t.height),this.ctx.restore()}drawOuterShadow(){const t=this.getRect();this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(t.left,t.top,t.width,t.height);const e=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y});this.ctx.translate(e.x,e.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI\/2);const i=this.ctx.createLinearGradient(0,0,this.shadow.width,0);0===this.shadow.direction?(this.ctx.translate(0,-100),i.addColorStop(0,\"rgba(0, 0, 0, \"+this.shadow.opacity+\")\"),i.addColorStop(1,\"rgba(0, 0, 0, 0)\")):(this.ctx.translate(-this.shadow.width,-100),i.addColorStop(0,\"rgba(0, 0, 0, 0)\"),i.addColorStop(1,\"rgba(0, 0, 0, \"+this.shadow.opacity+\")\")),this.ctx.clip(),this.ctx.fillStyle=i,this.ctx.fillRect(0,0,this.shadow.width,2*t.height),this.ctx.restore()}drawInnerShadow(){const t=this.getRect();this.ctx.save(),this.ctx.beginPath();const e=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),i=this.convertRectToGlobal(this.pageRect);this.ctx.moveTo(i.topLeft.x,i.topLeft.y),this.ctx.lineTo(i.topRight.x,i.topRight.y),this.ctx.lineTo(i.bottomRight.x,i.bottomRight.y),this.ctx.lineTo(i.bottomLeft.x,i.bottomLeft.y),this.ctx.translate(e.x,e.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI\/2);const s=3*this.shadow.width\/4,n=this.ctx.createLinearGradient(0,0,s,0);0===this.shadow.direction?(this.ctx.translate(-s,-100),n.addColorStop(1,\"rgba(0, 0, 0, \"+this.shadow.opacity+\")\"),n.addColorStop(.9,\"rgba(0, 0, 0, 0.05)\"),n.addColorStop(.7,\"rgba(0, 0, 0, \"+this.shadow.opacity+\")\"),n.addColorStop(0,\"rgba(0, 0, 0, 0)\")):(this.ctx.translate(0,-100),n.addColorStop(0,\"rgba(0, 0, 0, \"+this.shadow.opacity+\")\"),n.addColorStop(.1,\"rgba(0, 0, 0, 0.05)\"),n.addColorStop(.3,\"rgba(0, 0, 0, \"+this.shadow.opacity+\")\"),n.addColorStop(1,\"rgba(0, 0, 0, 0)\")),this.ctx.clip(),this.ctx.fillStyle=n,this.ctx.fillRect(0,0,s,2*t.height),this.ctx.restore()}clear(){this.ctx.fillStyle=\"white\",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}}class p{constructor(t,e,i){this.touchPoint=null,this.swipeTimeout=250,this.onResize=()=>{this.update()},this.onMouseDown=t=>{if(this.checkTarget(t.target)){const e=this.getMousePos(t.clientX,t.clientY);this.app.startUserTouch(e),t.preventDefault()}},this.onTouchStart=t=>{if(this.checkTarget(t.target)&&t.changedTouches.length>0){const e=t.changedTouches[0],i=this.getMousePos(e.clientX,e.clientY);this.touchPoint={point:i,time:Date.now()},setTimeout(()=>{null!==this.touchPoint&&this.app.startUserTouch(i)},this.swipeTimeout),this.app.getSettings().mobileScrollSupport||t.preventDefault()}},this.onMouseUp=t=>{const e=this.getMousePos(t.clientX,t.clientY);this.app.userStop(e)},this.onMouseMove=t=>{const e=this.getMousePos(t.clientX,t.clientY);this.app.userMove(e,!1)},this.onTouchMove=t=>{if(t.changedTouches.length>0){const e=t.changedTouches[0],i=this.getMousePos(e.clientX,e.clientY);this.app.getSettings().mobileScrollSupport?(null!==this.touchPoint&&(Math.abs(this.touchPoint.point.x-i.x)>10||\"read\"!==this.app.getState())&&t.cancelable&&this.app.userMove(i,!0),\"read\"!==this.app.getState()&&t.preventDefault()):this.app.userMove(i,!0)}},this.onTouchEnd=t=>{if(t.changedTouches.length>0){const e=t.changedTouches[0],i=this.getMousePos(e.clientX,e.clientY);let s=!1;if(null!==this.touchPoint){const t=i.x-this.touchPoint.point.x,e=Math.abs(i.y-this.touchPoint.point.y);Math.abs(t)>this.swipeDistance&&e<2*this.swipeDistance&&Date.now()-this.touchPoint.time<this.swipeTimeout&&(t>0?this.app.flipPrev(this.touchPoint.point.y<this.app.getRender().getRect().height\/2?\"top\":\"bottom\"):this.app.flipNext(this.touchPoint.point.y<this.app.getRender().getRect().height\/2?\"top\":\"bottom\"),s=!0),this.touchPoint=null}this.app.userStop(i,s)}},this.parentElement=t,t.classList.add(\"stf__parent\"),t.insertAdjacentHTML(\"afterbegin\",'<div class=\"stf__wrapper\"><\/div>'),this.wrapper=t.querySelector(\".stf__wrapper\"),this.app=e;const s=this.app.getSettings().usePortrait?1:2;t.style.minWidth=i.minWidth*s+\"px\",t.style.minHeight=i.minHeight+\"px\",\"fixed\"===i.size&&(t.style.minWidth=i.width*s+\"px\",t.style.minHeight=i.height+\"px\"),i.autoSize&&(t.style.width=\"100%\",t.style.maxWidth=2*i.maxWidth+\"px\"),t.style.display=\"block\",window.addEventListener(\"resize\",this.onResize,!1),this.swipeDistance=i.swipeDistance}destroy(){this.app.getSettings().useMouseEvents&&this.removeHandlers(),this.distElement.remove(),this.wrapper.remove()}getDistElement(){return this.distElement}getWrapper(){return this.wrapper}setOrientationStyle(t){this.wrapper.classList.remove(\"--portrait\",\"--landscape\"),\"portrait\"===t?(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height\/this.app.getSettings().width*100+\"%\"),this.wrapper.classList.add(\"--portrait\")):(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height\/(2*this.app.getSettings().width)*100+\"%\"),this.wrapper.classList.add(\"--landscape\")),this.update()}removeHandlers(){window.removeEventListener(\"resize\",this.onResize),this.distElement.removeEventListener(\"mousedown\",this.onMouseDown),this.distElement.removeEventListener(\"touchstart\",this.onTouchStart),window.removeEventListener(\"mousemove\",this.onMouseMove),window.removeEventListener(\"touchmove\",this.onTouchMove),window.removeEventListener(\"mouseup\",this.onMouseUp),window.removeEventListener(\"touchend\",this.onTouchEnd)}setHandlers(){window.addEventListener(\"resize\",this.onResize,!1),this.app.getSettings().useMouseEvents&&(this.distElement.addEventListener(\"mousedown\",this.onMouseDown),this.distElement.addEventListener(\"touchstart\",this.onTouchStart),window.addEventListener(\"mousemove\",this.onMouseMove),window.addEventListener(\"touchmove\",this.onTouchMove,{passive:!this.app.getSettings().mobileScrollSupport}),window.addEventListener(\"mouseup\",this.onMouseUp),window.addEventListener(\"touchend\",this.onTouchEnd))}getMousePos(t,e){const i=this.distElement.getBoundingClientRect();return{x:t-i.left,y:e-i.top}}checkTarget(t){return!this.app.getSettings().clickEventForward||![\"a\",\"button\"].includes(t.tagName.toLowerCase())}}class c extends p{constructor(t,e,i,s){super(t,e,i),this.wrapper.insertAdjacentHTML(\"afterbegin\",'<div class=\"stf__block\"><\/div>'),this.distElement=t.querySelector(\".stf__block\"),this.items=s;for(const t of s)this.distElement.appendChild(t);this.setHandlers()}clear(){for(const t of this.items)this.parentElement.appendChild(t)}updateItems(t){this.removeHandlers(),this.distElement.innerHTML=\"\";for(const e of t)this.distElement.appendChild(e);this.items=t,this.setHandlers()}update(){this.app.getRender().update()}}class u extends p{constructor(t,e,i){super(t,e,i),this.wrapper.innerHTML='<canvas class=\"stf__canvas\"><\/canvas>',this.canvas=t.querySelectorAll(\"canvas\")[0],this.distElement=this.canvas,this.resizeCanvas(),this.setHandlers()}resizeCanvas(){const t=getComputedStyle(this.canvas),e=parseInt(t.getPropertyValue(\"width\"),10),i=parseInt(t.getPropertyValue(\"height\"),10);this.canvas.width=e,this.canvas.height=i}getCanvas(){return this.canvas}update(){this.resizeCanvas(),this.app.getRender().update()}}class w extends l{constructor(t,e,i){super(t,e),this.outerShadow=null,this.innerShadow=null,this.hardShadow=null,this.hardInnerShadow=null,this.element=i,this.createShadows()}createShadows(){this.element.insertAdjacentHTML(\"beforeend\",'<div class=\"stf__outerShadow\"><\/div>\\n             <div class=\"stf__innerShadow\"><\/div>\\n             <div class=\"stf__hardShadow\"><\/div>\\n             <div class=\"stf__hardInnerShadow\"><\/div>'),this.outerShadow=this.element.querySelector(\".stf__outerShadow\"),this.innerShadow=this.element.querySelector(\".stf__innerShadow\"),this.hardShadow=this.element.querySelector(\".stf__hardShadow\"),this.hardInnerShadow=this.element.querySelector(\".stf__hardInnerShadow\")}clearShadow(){super.clearShadow(),this.outerShadow.style.cssText=\"display: none\",this.innerShadow.style.cssText=\"display: none\",this.hardShadow.style.cssText=\"display: none\",this.hardInnerShadow.style.cssText=\"display: none\"}reload(){this.element.querySelector(\".stf__outerShadow\")||this.createShadows()}drawHardInnerShadow(){const t=this.getRect(),e=this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress;let i=(100-e)*(2.5*t.pageWidth)\/100+20;i>t.pageWidth&&(i=t.pageWidth);let s=`\\n            display: block;\\n            z-index: ${(this.getSettings().startZIndex+5).toString(10)};\\n            width: ${i}px;\\n            height: ${t.height}px;\\n            background: linear-gradient(to right,\\n                rgba(0, 0, 0, ${this.shadow.opacity*e\/100}) 5%,\\n                rgba(0, 0, 0, 0) 100%);\\n            left: ${t.left+t.width\/2}px;\\n            transform-origin: 0 0;\\n        `;s+=0===this.getDirection()&&this.shadow.progress>100||1===this.getDirection()&&this.shadow.progress<=100?\"transform: translate3d(0, 0, 0);\":\"transform: translate3d(0, 0, 0) rotateY(180deg);\",this.hardInnerShadow.style.cssText=s}drawHardOuterShadow(){const t=this.getRect();let e=(100-(this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress))*(2.5*t.pageWidth)\/100+20;e>t.pageWidth&&(e=t.pageWidth);let i=`\\n            display: block;\\n            z-index: ${(this.getSettings().startZIndex+4).toString(10)};\\n            width: ${e}px;\\n            height: ${t.height}px;\\n            background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%);\\n            left: ${t.left+t.width\/2}px;\\n            transform-origin: 0 0;\\n        `;i+=0===this.getDirection()&&this.shadow.progress>100||1===this.getDirection()&&this.shadow.progress<=100?\"transform: translate3d(0, 0, 0) rotateY(180deg);\":\"transform: translate3d(0, 0, 0);\",this.hardShadow.style.cssText=i}drawInnerShadow(){const t=this.getRect(),e=3*this.shadow.width\/4,i=0===this.getDirection()?e:0,s=0===this.getDirection()?\"to left\":\"to right\",n=this.convertToGlobal(this.shadow.pos),r=this.shadow.angle+3*Math.PI\/2,o=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let a=\"polygon( \";for(const t of o){let e=1===this.getDirection()?{x:-t.x+this.shadow.pos.x,y:t.y-this.shadow.pos.y}:{x:t.x-this.shadow.pos.x,y:t.y-this.shadow.pos.y};e=h.GetRotatedPoint(e,{x:i,y:100},r),a+=e.x+\"px \"+e.y+\"px, \"}a=a.slice(0,-2),a+=\")\";const g=`\\n            display: block;\\n            z-index: ${(this.getSettings().startZIndex+10).toString(10)};\\n            width: ${e}px;\\n            height: ${2*t.height}px;\\n            background: linear-gradient(${s},\\n                rgba(0, 0, 0, ${this.shadow.opacity}) 5%,\\n                rgba(0, 0, 0, 0.05) 15%,\\n                rgba(0, 0, 0, ${this.shadow.opacity}) 35%,\\n                rgba(0, 0, 0, 0) 100%);\\n            transform-origin: ${i}px 100px;\\n            transform: translate3d(${n.x-i}px, ${n.y-100}px, 0) rotate(${r}rad);\\n            clip-path: ${a};\\n            -webkit-clip-path: ${a};\\n        `;this.innerShadow.style.cssText=g}drawOuterShadow(){const t=this.getRect(),e=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),i=this.shadow.angle+3*Math.PI\/2,s=1===this.getDirection()?this.shadow.width:0,n=0===this.getDirection()?\"to right\":\"to left\",r=[{x:0,y:0},{x:t.pageWidth,y:0},{x:t.pageWidth,y:t.height},{x:0,y:t.height}];let o=\"polygon( \";for(const t of r)if(null!==t){let e=1===this.getDirection()?{x:-t.x+this.shadow.pos.x,y:t.y-this.shadow.pos.y}:{x:t.x-this.shadow.pos.x,y:t.y-this.shadow.pos.y};e=h.GetRotatedPoint(e,{x:s,y:100},i),o+=e.x+\"px \"+e.y+\"px, \"}o=o.slice(0,-2),o+=\")\";const a=`\\n            display: block;\\n            z-index: ${(this.getSettings().startZIndex+10).toString(10)};\\n            width: ${this.shadow.width}px;\\n            height: ${2*t.height}px;\\n            background: linear-gradient(${n}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));\\n            transform-origin: ${s}px 100px;\\n            transform: translate3d(${e.x-s}px, ${e.y-100}px, 0) rotate(${i}rad);\\n            clip-path: ${o};\\n            -webkit-clip-path: ${o};\\n        `;this.outerShadow.style.cssText=a}drawLeftPage(){\"portrait\"!==this.orientation&&null!==this.leftPage&&(1===this.direction&&null!==this.flippingPage&&\"hard\"===this.flippingPage.getDrawingDensity()?(this.leftPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.leftPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.leftPage.draw(this.flippingPage.getDrawingDensity())):this.leftPage.simpleDraw(0))}drawRightPage(){null!==this.rightPage&&(0===this.direction&&null!==this.flippingPage&&\"hard\"===this.flippingPage.getDrawingDensity()?(this.rightPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.rightPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.rightPage.draw(this.flippingPage.getDrawingDensity())):this.rightPage.simpleDraw(1))}drawBottomPage(){if(null===this.bottomPage)return;const t=null!=this.flippingPage?this.flippingPage.getDrawingDensity():null;\"portrait\"===this.orientation&&1===this.direction||(this.bottomPage.getElement().style.zIndex=(this.getSettings().startZIndex+3).toString(10),this.bottomPage.draw(t))}drawFrame(){this.clear(),this.drawLeftPage(),this.drawRightPage(),this.drawBottomPage(),null!=this.flippingPage&&(this.flippingPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.flippingPage.draw()),null!=this.shadow&&null!==this.flippingPage&&(\"soft\"===this.flippingPage.getDrawingDensity()?(this.drawOuterShadow(),this.drawInnerShadow()):(this.drawHardOuterShadow(),this.drawHardInnerShadow()))}clear(){for(const t of this.app.getPageCollection().getPages())t!==this.leftPage&&t!==this.rightPage&&t!==this.flippingPage&&t!==this.bottomPage&&(t.getElement().style.cssText=\"display: none\"),t.getTemporaryCopy()!==this.flippingPage&&t.hideTemporaryCopy()}update(){super.update(),null!==this.rightPage&&this.rightPage.setOrientation(1),null!==this.leftPage&&this.leftPage.setOrientation(0)}}class x{constructor(){this._default={startPage:0,size:\"fixed\",width:0,height:0,minWidth:0,maxWidth:0,minHeight:0,maxHeight:0,drawShadow:!0,flippingTime:1e3,usePortrait:!0,startZIndex:0,autoSize:!0,maxShadowOpacity:1,showCover:!1,mobileScrollSupport:!0,swipeDistance:30,clickEventForward:!0,useMouseEvents:!0,showPageCorners:!0,disableFlipByClick:!1}}getSettings(t){const e=this._default;if(Object.assign(e,t),\"stretch\"!==e.size&&\"fixed\"!==e.size)throw new Error('Invalid size type. Available only \"fixed\" and \"stretch\" value');if(e.width<=0||e.height<=0)throw new Error(\"Invalid width or height\");if(e.flippingTime<=0)throw new Error(\"Invalid flipping time\");return\"stretch\"===e.size?(e.minWidth<=0&&(e.minWidth=100),e.maxWidth<e.minWidth&&(e.maxWidth=2e3),e.minHeight<=0&&(e.minHeight=100),e.maxHeight<e.minHeight&&(e.maxHeight=2e3)):(e.minWidth=e.width,e.maxWidth=e.width,e.minHeight=e.height,e.maxHeight=e.height),e}}!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&\"undefined\"!=typeof document){var s=document.head||document.getElementsByTagName(\"head\")[0],n=document.createElement(\"style\");n.type=\"text\/css\",\"top\"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}(\".stf__parent {\\n  position: relative;\\n  display: block;\\n  box-sizing: border-box;\\n  transform: translateZ(0);\\n\\n  -ms-touch-action: pan-y;\\n  touch-action: pan-y;\\n}\\n\\n.sft__wrapper {\\n  position: relative;\\n  width: 100%;\\n  box-sizing: border-box;\\n}\\n\\n.stf__parent canvas {\\n  position: absolute;\\n  width: 100%;\\n  height: 100%;\\n  left: 0;\\n  top: 0;\\n}\\n\\n.stf__block {\\n  position: absolute;\\n  width: 100%;\\n  height: 100%;\\n  box-sizing: border-box;\\n  perspective: 2000px;\\n}\\n\\n.stf__item {\\n  display: none;\\n  position: absolute;\\n  transform-style: preserve-3d;\\n}\\n\\n.stf__outerShadow {\\n  position: absolute;\\n  left: 0;\\n  top: 0;\\n}\\n\\n.stf__innerShadow {\\n  position: absolute;\\n  left: 0;\\n  top: 0;\\n}\\n\\n.stf__hardShadow {\\n  position: absolute;\\n  left: 0;\\n  top: 0;\\n}\\n\\n.stf__hardInnerShadow {\\n  position: absolute;\\n  left: 0;\\n  top: 0;\\n}\");t.PageFlip=class extends class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)?this.events.get(t).push(e):this.events.set(t,[e]),this}off(t){this.events.delete(t)}trigger(t,e,i=null){if(this.events.has(t))for(const s of this.events.get(t))s({data:i,object:e})}}{constructor(t,e){super(),this.isUserTouch=!1,this.isUserMove=!1,this.setting=null,this.pages=null,this.setting=(new x).getSettings(e),this.block=t}destroy(){this.ui.destroy(),this.block.remove()}update(){this.render.update(),this.pages.show()}loadFromImages(t){this.ui=new u(this.block,this,this.setting);const e=this.ui.getCanvas();this.render=new d(this,this.setting,e),this.flipController=new g(this.render,this),this.pages=new n(this,this.render,t),this.pages.load(),this.render.start(),this.pages.show(this.setting.startPage),setTimeout(()=>{this.ui.update(),this.trigger(\"init\",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}loadFromHTML(t){this.ui=new c(this.block,this,this.setting,t),this.render=new w(this,this.setting,this.ui.getDistElement()),this.flipController=new g(this.render,this),this.pages=new o(this,this.render,this.ui.getDistElement(),t),this.pages.load(),this.render.start(),this.pages.show(this.setting.startPage),setTimeout(()=>{this.ui.update(),this.trigger(\"init\",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}updateFromImages(t){const e=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new n(this,this.render,t),this.pages.load(),this.pages.show(e),this.trigger(\"update\",this,{page:e,mode:this.render.getOrientation()})}updateFromHtml(t){const e=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new o(this,this.render,this.ui.getDistElement(),t),this.pages.load(),this.ui.updateItems(t),this.render.reload(),this.pages.show(e),this.trigger(\"update\",this,{page:e,mode:this.render.getOrientation()})}clear(){this.pages.destroy(),this.ui.clear()}turnToPrevPage(){this.pages.showPrev()}turnToNextPage(){this.pages.showNext()}turnToPage(t){this.pages.show(t)}flipNext(t=\"top\"){this.flipController.flipNext(t)}flipPrev(t=\"top\"){this.flipController.flipPrev(t)}flip(t,e=\"top\"){this.flipController.flipToPage(t,e)}updateState(t){this.trigger(\"changeState\",this,t)}updatePageIndex(t){this.trigger(\"flip\",this,t)}updateOrientation(t){this.ui.setOrientationStyle(t),this.update(),this.trigger(\"changeOrientation\",this,t)}getPageCount(){return this.pages.getPageCount()}getCurrentPageIndex(){return this.pages.getCurrentPageIndex()}getPage(t){return this.pages.getPage(t)}getRender(){return this.render}getFlipController(){return this.flipController}getOrientation(){return this.render.getOrientation()}getBoundsRect(){return this.render.getRect()}getSettings(){return this.setting}getUI(){return this.ui}getState(){return this.flipController.getState()}getPageCollection(){return this.pages}startUserTouch(t){this.mousePosition=t,this.isUserTouch=!0,this.isUserMove=!1}userMove(t,e){this.isUserTouch||e||!this.setting.showPageCorners?this.isUserTouch&&h.GetDistanceBetweenTwoPoint(this.mousePosition,t)>5&&(this.isUserMove=!0,this.flipController.fold(t)):this.flipController.showCorner(t)}userStop(t,e=!1){this.isUserTouch&&(this.isUserTouch=!1,e||(this.isUserMove?this.flipController.stopMove():this.flipController.flip(t)))}},Object.defineProperty(t,\"__esModule\",{value:!0})}));\n<\/script>\n<script>\n\/* KINK - BARKARTE FLIPBOOK: Seiten aufbauen, Blaettern, Ton *\/\n(function(){\n  var wrap=document.getElementById('kflip'),el=document.getElementById('kflip-buch');\n  if(!wrap||!el||!window.St)return;\n  var en=(document.documentElement.lang||'').toLowerCase().indexOf('en')===0;\n  var BASIS='\/wp-content\/uploads\/2026\/10\/kink-perfect-album-v2-seite-',ANZ=25;\n  var alt=['Cover: KINK - The Perfect Album','Intro','Tracklist','Track 01 Volare','Track 01 - The Intro','Track 02 La Bamba','Track 02 - The One Hit Wonder','Track 03 Nuevayoool!','Track 03 - The Summer Anthem','Track 04 By Your Side','Track 04 - The Love Song','Track 05 Helden \/ Heroes','Track 05 - The Cover Song','Track 06 {Untitled 06}','Track 06 - The B-Side','Track 07 Believe','Track 07 - The Comeback Song','Track 08 Total Eclipse of the Plum','Track 08 - The Power Ballad','Many thanks to','Hidden Track','KINK Bar Team','Playlist','Tracklist','Bar Snacks'];\n  var bilder=[];\n  for(var s=1;s<=ANZ;s++){\n    var d=document.createElement('div');d.className='kflip__seite';d.setAttribute('data-density','soft');\n    var im=document.createElement('img');im.alt=alt[s-1];im.draggable=false;\n    var u=BASIS+(s<10?'0':'')+s+'.jpg';\n    if(s===ANZ){u='\/wp-content\/uploads\/2026\/10\/kink-bar-snacks-2610.jpg'} \/* BAR SNACKS neu (26.10.2026): letzte Seite = neue Snack-Karte *\/\n    if(s<=3){im.src=u}else{im.setAttribute('data-src',u)}\n    d.appendChild(im);el.appendChild(d);bilder.push(im);\n  }\n  \/* restliche Seiten erst laden, wenn die Karte in die Naehe kommt *\/\n  function ladeAlle(){bilder.forEach(function(b){var q=b.getAttribute('data-src');if(q){b.src=q;b.removeAttribute('data-src')}})}\n  if('IntersectionObserver' in window){var io=new IntersectionObserver(function(e){if(e[0].isIntersecting){ladeAlle();io.disconnect()}},{rootMargin:'900px'});io.observe(wrap)}else{ladeAlle()}\n\n  var pf=new St.PageFlip(el,{width:520,height:520,size:'stretch',minWidth:320,maxWidth:640,minHeight:150,maxHeight:640,showCover:true,usePortrait:true,mobileScrollSupport:true,flippingTime:850,maxShadowOpacity:.55,drawShadow:true,autoSize:true,swipeDistance:20});\n  pf.loadFromHTML(el.querySelectorAll('.kflip__seite'));\n  var n=pf.getPageCount(),stand=document.getElementById('kflip-stand'),vor=document.getElementById('kflip-vor'),zur=document.getElementById('kflip-zurueck'),tl=document.getElementById('kflip-tracks');\n  var sprung=[['Intro',1],['01',3],['02',5],['03',7],['04',9],['05',11],['06',13],['07',15],['08',17],['Thanks',19],['Band',21],['Snacks',23]];\n  sprung.forEach(function(x){var li=document.createElement('li'),b=document.createElement('button');b.type='button';b.textContent=x[0];b.onclick=function(){ladeAlle();pf.flip(pf.getOrientation()==='portrait'&&x[0]==='Snacks'?24:x[1])};li.appendChild(b);tl.appendChild(li)});\n  function zeig(){\n    var i=pf.getCurrentPageIndex(),hoch=pf.getOrientation()==='portrait',w=en?'Page ':'Seite ';\n    wrap.classList.toggle('is-zu',i===0);wrap.classList.toggle('is-hoch',hoch);\n    stand.textContent=i===0?'Cover':(hoch?(w+(i+1)+' \/ '+n):(w+(i+1)+'-'+Math.min(i+2,n)+' \/ '+n));\n    zur.disabled=i===0;vor.disabled=i>=n-(hoch?1:2);\n    var bs=tl.querySelectorAll('button');for(var k=0;k<bs.length;k++){var a=sprung[k][1],e=k+1<sprung.length?sprung[k+1][1]:n;bs[k].classList.toggle('an',i>=a&&i<e)}\n  }\n  pf.on('flip',zeig);pf.on('changeOrientation',zeig);pf.on('init',zeig);zeig();\n  vor.onclick=function(){ladeAlle();pf.flipNext()};zur.onclick=function(){pf.flipPrev()};\n  document.addEventListener('keydown',function(e){var r=wrap.getBoundingClientRect();if(r.bottom<0||r.top>window.innerHeight)return;if(e.key==='ArrowRight')pf.flipNext();if(e.key==='ArrowLeft')pf.flipPrev()});\n\n  \/* Blaetter-Ton: wird im Browser erzeugt, keine Tondatei noetig *\/\n  var ac=null,tonAn=true,tonBtn=document.getElementById('kflip-ton');\n  function tonText(){tonBtn.textContent=en?(tonAn?'Sound on':'Sound off'):(tonAn?'Ton an':'Ton aus');tonBtn.setAttribute('aria-pressed',tonAn)}\n  tonText();\n\n  \/* EN-TEXTE TEXTFASSUNG DER KARTE (25.10.2026): Summary, Snack-Zeit, US-Schreibweise nur auf \/en\/ *\/\n  if(en){var kt=document.querySelector('.kflip__text');if(kt){var su=kt.querySelector('summary');if(su)su.textContent='Read the menu as text';kt.querySelectorAll('h3,p,li,span').forEach(function(n){if(n.children.length)return;n.textContent=n.textContent.replace('(until 22:30)','(until 10:30 pm)').replace(\/Savoury\/g,'Savory').replace(\/savoury\/g,'savory')})}}\n  function blatt(){\n    if(!tonAn)return;\n    try{\n      ac=ac||new (window.AudioContext||window.webkitAudioContext)();if(ac.state==='suspended')ac.resume();\n      var d=.42,t0=ac.currentTime,buf=ac.createBuffer(1,ac.sampleRate*d,ac.sampleRate),ch=buf.getChannelData(0);\n      for(var i=0;i<ch.length;i++)ch[i]=(Math.random()*2-1)*(.6+.4*Math.random());\n      var src=ac.createBufferSource();src.buffer=buf;\n      var bp=ac.createBiquadFilter();bp.type='bandpass';bp.Q.value=.9;\n      bp.frequency.setValueAtTime(900,t0);bp.frequency.exponentialRampToValueAtTime(4200,t0+.2);bp.frequency.exponentialRampToValueAtTime(1500,t0+d);\n      var hp=ac.createBiquadFilter();hp.type='highpass';hp.frequency.value=500;\n      var g=ac.createGain();g.gain.setValueAtTime(.0001,t0);g.gain.exponentialRampToValueAtTime(.16,t0+.07);g.gain.exponentialRampToValueAtTime(.05,t0+.22);g.gain.exponentialRampToValueAtTime(.2,t0+.31);g.gain.exponentialRampToValueAtTime(.0001,t0+d);\n      src.connect(bp);bp.connect(hp);hp.connect(g);g.connect(ac.destination);src.start(t0);\n    }catch(err){}\n  }\n  pf.on('changeState',function(e){if(e.data==='flipping'){ladeAlle();blatt()}});\n  tonBtn.onclick=function(){tonAn=!tonAn;tonText()};\n  \/* Groesse nachmessen, sobald die Seite fertig geladen ist oder sich die Breite aendert *\/\n  var letzte=0;\n  function neu(){var b=wrap.clientWidth;if(b===letzte)return;letzte=b;try{pf.update();zeig()}catch(err){}}\n  window.addEventListener('load',neu);setTimeout(neu,400);\n  if(window.ResizeObserver){new ResizeObserver(neu).observe(wrap)}\n})();\n<\/script>\n<\/div><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n<div class=\"et_pb_section_4 et_pb_section et_section_regular et_flex_section et-pb-has-background-video et_pb_preload kink-fixed-bg preset--module--divi-section--default\" id=\"ballsaal\"><span class=\"et-pb-background-video\"><video autoplay loop playsinline muted><source type=\"video\/mp4\" data-src=\"https:\/\/kink-berlin.de\/wp-content\/uploads\/2026\/10\/kink-bar-saal-quer-v2.mp4\" \/><source type=\"video\/webm\" data-src=\"https:\/\/kink-berlin.de\/wp-content\/uploads\/2026\/10\/kink-bar-saal-quer-v2.webm\" \/><\/video><\/span><span class=\"et-pb-background-video et-pb-background-video_phone\"><video autoplay loop playsinline muted><source type=\"video\/mp4\" data-src=\"https:\/\/kink-berlin.de\/wp-content\/uploads\/2026\/10\/kink-bar-saal-hoch-v2.mp4\" \/><source type=\"video\/webm\" data-src=\"https:\/\/kink-berlin.de\/wp-content\/uploads\/2026\/10\/kink-bar-saal-hoch-v2.webm\" \/><\/video><\/span>\r\n<div class=\"et_pb_row_5 et_pb_row et_flex_row preset--module--divi-row--default\">\r\n<div class=\"et_pb_column_5 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone preset--module--divi-column--default\">\r\n<div class=\"et_pb_text_7 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p><span>DER RAUM<\/span><\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_heading_4 et_pb_heading et_pb_module et_flex_module preset--module--divi-heading--default\"><div class=\"et_pb_heading_container\"><h2 class=\"et_pb_module_header\">Historische Architektur trifft zeitgen\u00f6ssische Kunst.<\/h2><\/div><\/div>\r\n<div class=\"et_pb_text_8 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p>Einst ein gro\u00dfer Ballsaal, heute ein Raum voller Charakter. Acht Meter hohe Decken, eindrucksvolle Fl\u00fcgelt\u00fcren und dar\u00fcber schwebend Kerim Seilers leuchtende Installation Space Knot, ein markantes Kunstwerk, das dem KINK seine unverwechselbare Atmosph\u00e4re gibt.<\/p>\n<p>Gleich nebenan geht es im Aroma-Labor weiter. Mit einem Rotationsverdampfer entwickelt unser Barteam eigene Destillate und besondere Aromen, auch f\u00fcr unsere alkoholfreien Drinks.<\/p>\n<\/div><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div class=\"et_pb_section_5 et_pb_section et_section_regular et_flex_section preset--module--divi-section--default\" id=\"gut-zu-wissen\">\r\n<div class=\"et_pb_row_6 et_pb_row et_flex_row preset--module--divi-row--default\">\r\n<div class=\"et_pb_column_6 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone preset--module--divi-column--default\">\r\n<div class=\"et_pb_text_9 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p><span>GUT ZU WISSEN<\/span><\/p>\n<\/div><\/div>\r\n<div class=\"et_pb_heading_5 et_pb_heading et_pb_module et_flex_module preset--module--divi-heading--default\"><div class=\"et_pb_heading_container\"><h2 class=\"et_pb_module_header\">Cocktailbar in Berlin Mitte-Prenzlauer Berg. \u00d6ffnungszeiten, Drinks und Reservierung.<\/h2><\/div><\/div>\r\n<div class=\"et_pb_text_10 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module preset--module--divi-text--default\"><div class=\"et_pb_text_inner\"><p>Die KINK Bar ist t\u00e4glich ab 18 Uhr ge\u00f6ffnet, donnerstags bis samstags bis 2 Uhr, an den anderen Tagen bis Mitternacht. Ohne Reservierung seid ihr immer willkommen, f\u00fcr gr\u00f6\u00dfere Gruppen empfehlen wir aber, vorher zu buchen.<\/p>\n<p>Unter acht Meter hohen Decken und Kerim Seilers leuchtender Installation Space Knot verbindet unsere Bar historische Architektur mit kreativer Mixology. Entdeckt Klassiker mit Twist, eigene Signature Drinks und eine durchdachte alkoholfreie Auswahl. Hunger? Bar Food kommt aus derselben K\u00fcche wie unser <a href=\"\/restaurant\/\">Restaurant<\/a>.<\/p>\n<p>An ausgew\u00e4hlten Abenden bringen DJs eine andere Energie in den Raum, und aus entspannten Abenden werden lebendige N\u00e4chte. Lieber in Ruhe reden? Dann kommt am besten fr\u00fcher. Im <a href=\"\/\">Programm auf der Startseite<\/a> findet ihr kommende Events und DJ-Abende.<\/p>\n<p>Ihr plant eine private Feier? Unsere Bar l\u00e4sst sich exklusiv mieten, mit 124 Barpl\u00e4tzen oder f\u00fcr bis zu 250 G\u00e4ste stehend. Ob eine <a href=\"\/events\/firmenfeier-berlin\/\">Firmenfeier am Abend<\/a>, ein <a href=\"\/events\/geburtstagsfeier-berlin\/\">Geburtstag mit Freunden<\/a> oder ein gr\u00f6\u00dferes Event \u00fcber mehrere R\u00e4ume: Unser Team hilft euch, einen Abend zu gestalten, der bleibt.<\/p>\n<p>Schaut euch alle unsere <a href=\"\/events\/\">R\u00e4ume<\/a> an und findet den passenden Rahmen.<\/p>\n<\/div><\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_page_layout":"et_right_sidebar","_et_pb_side_nav":"off","footnotes":""},"class_list":["post-20","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/pages\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":117,"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/pages\/20\/revisions"}],"predecessor-version":[{"id":4051,"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/pages\/20\/revisions\/4051"}],"wp:attachment":[{"href":"https:\/\/kink-berlin.de\/en\/wp-json\/wp\/v2\/media?parent=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}